AHDL



AHDL Truth Table lpm_compare lpm_decode .

7segment.tdf, , (LED). LED .

 

SUBDESIGN 7segment

(

i[3..0] : INPUT;

a, b, c, d, e, f, g : OUTPUT;

)

BEGIN

TABLE

i[3..0] => a, b, c, d, e, f, g;

 

H"0" => 1, 1, 1, 1, 1, 1, 0;

H"1" => 0, 1, 1, 0, 0, 0, 0;

H"2" => 1, 1, 0, 1, 1, 0, 1;

H"3" => 1, 1, 1, 1, 0, 0, 1;

H"4" => 0, 1, 1, 0, 0, 1, 1;

H"5" => 1, 0, 1, 1, 0, 1, 1;

H"6" => 1, 0, 1, 1, 1, 1, 1;

H"7" => 1, 1, 1, 0, 0, 0, 0;

H"8" => 1, 1, 1, 1, 1, 1, 1;

H"9" => 1, 1, 1, 1, 0, 1, 1;

H"A" => 1, 1, 1, 0, 1, 1, 1;

H"B" => 0, 0, 1, 1, 1, 1, 1;

H"C" => 1, 0, 0, 1, 1, 1, 0;

H"D" => 0, 1, 1, 1, 1, 0, 1;

H"E" => 1, 0, 0, 1, 1, 1, 1;

H"F" => 1, 0, 0, 0, 1, 1, 1;

END TABLE;

END;

 

16 i[3..0] Truth Table

decode3.tdf, , 16- .

 

SUBDESIGN decode3

(

addr[15..0], m/io : INPUT;

rom, ram, print, sp[2..1] : OUTPUT;

)

BEGIN

TABLE

m/io, addr[15..0] => rom, ram, print, sp[];

1, B"00XXXXXXXXXXXXXX" => 1, 0, 0, B"00";

1, B"100XXXXXXXXXXXXX" => 0, 1, 0, B"00";

0, B"0000001010101110" => 0, 0, 1, B"00";