{ ===================================================== }
{ 74LP153 }
{ ===================================================== }
logicname 74LP153
{ ----------------------------------------------------- }
{ 手続き譜 }
{ ----------------------------------------------------- }
procedure mpx2to4
input ST;
input D[4];
input SEL[2];
output Y;
if (ST)
Y=0;
else
switch(SEL)
case 0: Y=D.0;
case 1: Y=D.1;
case 2: Y=D.2;
case 3: Y=D.3;
endswitch
endif
endp
{ ----------------------------------------------------- }
{ 実効譜 }
{ ----------------------------------------------------- }
entity TTL
input STA,STB;
input DA[4],DB[4];
input SELA[2],SELB[2];
output YA,YB;
YA=mpx2to4(STA,DA,SELA);
YB=mpx2to4(STB,DB,SELB);
ende
{ ----------------------------------------------------- }
{ 機能実行譜 }
{ ----------------------------------------------------- }
entity sim
output STA,STB;
output DA[4],DB[4];
output SELA[2],SELB[2];
output YA,YB;
bitr tc[5];
part TTL(STA,STB,DA,DB,SELA,SELB,YA,YB)
tc=tc+1;
{ - - - - - - - - - - - - - - - - - - - - - - - - - - - }
{ A }
{ - - - - - - - - - - - - - - - - - - - - - - - - - - - }
switch(tc)
case 5: DA.0=0; SELA=0;
case 6: DA.0=1; SELA=0;
case 7: DA.1=0; SELA=1;
case 8: DA.1=1; SELA=1;
case 9: DA.2=0; SELA=2;
case 10: DA.2=1; SELA=2;
case 11: DA.3=0; SELA=3;
case 12: DA.3=1; SELA=3;
endswitch
if ((tc>=5)&(tc<=15)) STA=0; else STA=1; endif
{ - - - - - - - - - - - - - - - - - - - - - - - - - - - }
{ B }
{ - - - - - - - - - - - - - - - - - - - - - - - - - - - }
switch(tc)
case 5: DB.0=0; SELB=0;
case 6: DB.0=1; SELB=0;
case 7: DB.1=0; SELB=1;
case 8: DB.1=1; SELB=1;
case 9: DB.2=0; SELB=2;
case 10: DB.2=1; SELB=2;
case 11: DB.3=0; SELB=3;
case 12: DB.3=1; SELB=3;
endswitch
if ((tc>=5)&(tc<=15)) STB=0; else STB=1; endif
ende
endlogic