{ ===================================================== }
{ 74LP85 }
{ ===================================================== }
logicname 74LP85
{ ----------------------------------------------------- }
{ 実効譜 }
{ ----------------------------------------------------- }
entity TTL
input A[4],B[4];
input CEQ,CBG,CSM;
output EQ,BG,SM;
if (A==B)
if (CEQ)
BG=0; SM=0; EQ=1; { A=B }
else
switch(CBG,CSM,CEQ)
case 0,0,0: BG=1; SM=1; EQ=0;
case 0,1,0: BG=0; SM=1; EQ=0; { A<B }
case 1,0,0: BG=1; SM=0; EQ=0; { A>B }
case 1,1,0: BG=0; SM=0; EQ=0;
endswitch
endif
else
if (A>B)
BG=1; SM=0; EQ=0; { A>B }
else
BG=0; SM=1; EQ=0; { A<B }
endif
endif
ende
{ ----------------------------------------------------- }
{ 機能実行譜 }
{ ----------------------------------------------------- }
entity sim
output A[4],B[4];
output CEQ,CBG,CSM;
output EQ,BG,SM;
bitr tc[10];
bitr tp[8];
part TTL(A,B,CEQ,CBG,CSM,EQ,BG,SM)
tc=tc+1;
if (tc>10) tp=tp+1; endif
if (tc<9)
A=0; B=0;
else
A=tp.0:3;
B=tp.4:7;
endif
if (tc<9)
CEQ=tc.0;
CSM=tc.1;
CBG=tc.2;
else
CEQ=1;
endif
ende
endlogic