logicname sample { -------------------------------------- } { 実効譜 } { -------------------------------------- } entity rsreg input r,s; output q; bitr rq; if (s) rq = 1; else if (r) rq = 0; else rq = rq; endif endif q = rq; ende { -------------------------------------- } { 機能実行譜 } { -------------------------------------- } entity sim output s,r; output q; bitr tc[4]; part rsreg(r,s,q) tc=tc+1; if (tc==5) s=1; endif if (tc==10) r=1; endif ende endlogic |