, >>>

ChipNews

2003: 
1, 2, 3, 4, 5, 6, 7, 8, 9, 10
2002: 
1, 5, 6, 7, 8, 9
2001: 
1, 2, 3, 4, 5, 6, 7, 8, 9, 10
2000: 
1, 2, 3, 4, 5, 6, 7, 8, 9, 10
1999: 
1, 2, 3, 4, 5, 6, 7, 8, 9, 10

ChipNews

Новости строительства

827:

827 0688759652

:

- . , , " " " ", .

2963-2 (RUS) . :

2963-2

II ... 372:

!

. , .

5. AHDL

AHDL

     AHDL Altera , , (state machine) Altera. MAX+PlusII. , AHDL, "*.TDF" (Text design file). TDF- MAX+PlusII, . , TDF-, , Altera.

     AHDL , . AHDL TDF-, AHDL, . AHDL , , , MAX+PlusII , .

    , AHDL, - . MAX+PlusII , TDF-, (GDF-). TDF- 300 , Altera. , MAX+PlusII, Altera "*.inc", INCLUDE.

     AHDL , . , . . AHDL " " (Golden Rules). AHDL .

" AHDL"

AHDL

     . AHDL , , .

     2 decode1.tdf, , , 370h.

2

SUDESIGN decode1
      (
      address[15..0] : INPUT;
      chip_enable : OUTPUT;
      )
BEGIN
      chip_enable = (adress[15..0] == H"0370");
END;

     , . H"0370" , .

     AHDL . , , , ; , UPPER_LI , 103. AHDL CONSTANT.

     , . , , .

     , , . AHDL , . , .

     , , , , , , . . 3 boole1.tdf, , .

3

SUBDESIGN boole1
       (
       a0, a1, b : INPUT;
       out1, out2 : OUTPUT;
       )
BEGIN
       out1 = a1 & !a0;
       out2 = out1 # b;
END;

     out1 , a1 a0, out2 out1 b. , .

    , VARIABLE NODE, .

     , . boole1.tdf - ( 4).

4

SUBDESIGN boole2
       (
       a0, a1, b : INPUT;
       out : OUTPUT;
       )
VARIABLE
       a_equals_2 : NODE;
BEGIN
       a_equals_2 = a1 & !a0;
       out = a_equals_2 # b;
END;

     a_equals_2, "a1 & !a0". , .

     AHDL . 256 (), . , , , VCC, GND, 1 0. .

     , [ ]. , a[4..1] a[ ].

     . IF CASE:

IF

     priority.tdf ( 5), , . , , VCC.

5

SUBDESIGN priority
       (
       low, middle, high : INPUT;
       highest_level[1..0] : OUTPUT;
       )
BEGIN
       IF high THEN
          highest_level[] = 3;
       ELSIF middle THEN
          highest_level[] = 2;
       ELSIF low THEN
          highest_level[] = 1;
       ELSE
          highest_level[] = 0;
       END IF;
END;

     low, middle high, , VCC. , , VCC. , 0.

CASE

     decoder.tdf ( 6), , . " ", , : 0001, 0010, 0100, 1000.

6

SUBDESIGN decoder
             (
                    code[1..0] : INPUT;
                    out[3..0] : OUTPUT;
             )
      BEGIN
             CASE  code[] IS
WHEN 0 => out[] = B"0001";
WHEN 1 => out[] = B"0010";
WHEN 2 => out[] = B"0100";
WHEN 3 => out[] = B"1000";
               END CASE;
       END;

     code [1..2] 0, 1, 2, 3. , , . , code [] 1, out "0010".

     IF CASE . . :

     AHDL. , . AHDL TABLE.

     7 7segment.tdf, , . ( 0 9 A F).

7

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, 0, 0, 0, 0, 0;
 H"2" => 1, 1, 0, 1, 1, 0, 0;
 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;

     (i[3..0]) (a, b, c, d, e, f, g), "" . .

     8 decode3.tdf .

8

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;

     (), . , "" , , . , rom () 16384 addr[15..0], 00. , 00, "". .

     9 decode4.tdf lpm_decode , decode1.tdf.

9

INCLUDE "lpm_decode.inc";

SUBDESIGN decode4
(
 address[15..0] : INPUT;
 chip_enable : OUTPUT;
)
BEGIN
 chip_eneble = lpm_decode(.data[]=address[])
 WITH (LPM_WIDTH=16, LPM_DECODES=2^10)
 RETURNS (.eq[H"0370"]);
END;

     . , , . AHDL -. , . , GND.

     DEFAULTS , IF CASE.

     10 default1.tdf, ASCII-.

10

SUBDESIGN default1
             (
                    i[3..0] : INPUT;
                    ascii_code[7..0] : OUTPUT;
             )
      BEGIN
                    DEFAULTS
      ascii_code[] = B"00111111";% ASCII question mark"?" % END DEFAULTS;
                   TABLE
                          i[3..0] => ascii_code[];
                          B"1000" => B"01100001"; % "a" %
B"0100" => B"01100010"; % "b" %
B"0010" => B"01100011"; & "c" %
B"0001" => B"01100100"; % "d" %
                      END TABLE;
	  END;	

     , ASCII- . () , B"00111111" ( ).

     11 default2.tdf , AHDL.

11

SUBDESIGN default2
             (
a, b, c : INPUT;
select_a, select_b, select_c : INPUT;
wire_or, wire_and : OUTPUT;
             )
      BEGIN
                  DEFAULTS
                        wire_or = GND;
                        wire_and = VCC;
                  END DEFAULTS;
                  IF select_a THEN
                              wire_or = a;
                              wire_and = a;
                  END IF;
       IF select_b THEN
                              wire_or = b;
                              wire_and = b;
                  END IF;
                  IF select_c THEN
                              wire_or = c;
                              wire_and = c;
                  END IF;
      END;

     wire_or a, b c, select_a, select_b select_c. VCC, wire_or , GND.

     (select_a, select_b select_c) VCC, wire_or . , select_a select_b VCC, wire_or a b.

     wire_and , VCC, select VCC, , , VCC.

     . GND. , .

     12 daisy.tdf, (daisy chain). ( ) . ( ) . .

12

  SUBDESIGN daisy
              (
                    /local_request : INPUT;
                    /local_grant : OUTPUT;
                    /request_in : INPUT; % from lower priority % /request_out : OUTPUT; % to higher
priority % /grant_in : INPUT; % from higher priority % /grant_out : OUTPUT; % to lower priority %
              )
      BEGIN
                   DEFAULTS
      /local_grant = VCC; % active-low output % /request_out = VCC; % signals should default % /
grant_out = VCC; % to VCC %
                   END DEFAULTS;
      IF /request_in == GND # /local_request == GND THEN
       /request_out = GND;
      END IF;
      IF /grant_in == GND THEN
  IF /local_request == GND THEN
    /local_grant = GND;
  ELSIF /request_in -- GND THEN
   /grant_out = GND;
                    END IF;
       END IF;
  END;

     . Altera - , , "/", , .

     IF , , GND. , , IF.

     DEFAULTS , VCC, .

     MAX+PlusII / (I/O) Altera . BIDIR, TRI. , .

     13 bus_reg2.tdf , , , .

13

SUBDESIGN bus_reg2
             (
                    clk : INPUT;
                    oe : INPUT;
                    io : BIDIR;
             )
     BEGIN
             io = TRI(DFF(io, clk,, ), oe);
     END;

     io, TRI, d D- (DFF). clrn prn. .

     TDF- . TDF- RETURNS. 14 bidir1.tdf bus_reg2.

14

FUNCTION bus_reg2 (clk, oe) RETURNS (io);
      SUBDESIGN bidir1
             (
                  clk, oe : INPUT;
                  io[3..0] : BIDIR;
             )
     BEGIN
             io0 = bus_reg2 )clk, oe);
             io1 = bus_reg2 )clk, oe);
             io2 = bus_reg2 )clk, oe);
             io3 = bus_reg2 )clk, oe);
     END;

     AHDL .

.: 263 6736
E-mail: stesheenk@sm.bmstu.ru






5. AHDL :
 :
: :
<b> </b>
<i></i>
<a href="http://site.ru"> </a>