|
logicname sample
{ -------------------------------------- }
{ 実効譜 }
{ -------------------------------------- }
entity jkreg
input j,k;
output q;
bitr rq;
switch(j,k)
case 0,0: rq=rq;
case 0,1: rq=0;
case 1,0: rq=1;
case 1,1: rq=!rq;
endswitch
q = rq;
ende
{ -------------------------------------- }
{ 機能実行譜 }
{ -------------------------------------- }
entity sim
output j,k;
output q;
bitr tc[4];
part jkreg(j,k,q)
tc=tc+1;
if (tc==5) j=1; k=0; endif
if (tc==8) j=0; k=1; endif
if (tc==11) j=1; k=1; endif
if (tc==13) j=1; k=1; endif
ende
endlogic
|
|