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";




0, B"0000001011011110" => 0, 0, 0, B"01";

0, B"0000001101110000" => 0, 0, 0, B"10";

END TABLE;

END;

Truth Table

. , . , TABLE rom 16,384 addr[15..0], 00. , .

ՠ . AHDL .

decode4.tdf, , lpm_decode decode1.tdf.

INCLUDE "lpm_decode.inc";

SUBDESIGN decode4

(

address[15..0] : INPUT;

chip_enable : OUTPUT;

)

BEGIN

chip_enable = lpm_decode(.data[]=address[])

WITH (LPM_WIDTH=16, LPM_DECODES=2^10)

RETURNS (.eq[H"0370"]);

END;