{ ===================================================== }
{ 74LP253 }
{ ===================================================== }
logicname 74LP253
{ ----------------------------------------------------- }
{ 手続き譜 }
{ ----------------------------------------------------- }
procedure mpx2to4
input D[4];
input SEL[2];
output Y;
switch(SEL)
case 0: Y=D.0;
case 1: Y=D.1;
case 2: Y=D.2;
case 3: Y=D.3;
endswitch
endp
{ ----------------------------------------------------- }
{ 実効譜 }
{ ----------------------------------------------------- }
entity TTL
input STA,STB;
input DA[4],DB[4];
input SELA[2],SELB[2];
inout YA,YB;
output TP_YA,TP_YB; {<font COLOR="red">仮端子</font>}
bitn ya,yb;
bitn nc;
bitn sta,stb;
enable(YA,nc,ya,sta)
enable(YB,nc,yb,stb)
sta=STA;
stb=STB;
ya=mpx2to4(DA,SELA);
yb=mpx2to4(DB,SELB);
TP_YA=ya;
TP_YB=yb;
ende
{ ----------------------------------------------------- }
{ 機能実行譜 }
{ ----------------------------------------------------- }
entity sim
output STA,STB;
output DA[4],DB[4];
output SELA[2],SELB[2];
output YA,YB;
output TP_YA,TP_YB;
bitr tc[5];
part TTL(STA,STB,DA,DB,SELA,SELB,YA,YB,TP_YA,TP_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