need help on VHDL

Discussion in 'VHDL' started by ghouol, Oct 29, 2009.

  1. ghouol

    ghouol

    Joined:
    Oct 29, 2009
    Messages:
    2
    hi
    I have problem with my first program in VHDL ,
    I am working with ISE 8.2
    my code is:

    entity mux2 is
    generic(type DATA_TYPE );
    port (sel : in bit; a, b : in DATA_TYPE ; z : out DATA_TYPE );
    end mux2;

    architecture RTL of mux2 is

    begin
    z <= a when sel ='0' else b;

    end architecture RTL;

    the problem is:
    ERROR:HDLParsers:164 - "J:/FPGA/test/Mux2/mux2.vhd" Line 31. parse error, unexpected TYPE, expecting IDENTIFIER


    would you please help me
     
    ghouol, Oct 29, 2009
    #1
    1. Advertising

  2. ghouol

    eliascm

    Joined:
    Jan 30, 2009
    Messages:
    42
    Help on VHDL

    You do not use generic( ) for types; use a type statement like:

    TYPE DATA_TYPE is std_logic_vector(15 downto 0); --use your own type
    --definition

    Do not use z as a port name; it will work, but it can be confusing since "Z" is a possible value of std_logic.

    This should work for your entity:

    entity mux2 is

    port (sel : in bit; a, b : in DATA_TYPE ; z : out DATA_TYPE );

    end mux2;
     
    eliascm, Oct 30, 2009
    #2
    1. Advertising

  3. ghouol

    tooh83

    Joined:
    Oct 30, 2009
    Messages:
    1
    ISE 8.2 doesn't support generic types which is a new vhdl2008 construct
     
    tooh83, Oct 30, 2009
    #3
  4. ghouol

    ghouol

    Joined:
    Oct 29, 2009
    Messages:
    2
    thanks

    YES i think this is a cause,, i am reading from morgan kufman book,, what book do you propose to read for a fast learning?
     
    ghouol, Oct 31, 2009
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. walala
    Replies:
    3
    Views:
    4,832
    walala
    Sep 18, 2003
  2. albert.neu@gmail.com
    Replies:
    2
    Views:
    8,733
    Jim Lewis
    Mar 21, 2006
  3. dude

    VHDL 2002 vs VHDL 1993

    dude, Mar 23, 2006, in forum: VHDL
    Replies:
    1
    Views:
    1,306
    Nicolas Matringe
    Mar 23, 2006
  4. pygmalion
    Replies:
    6
    Views:
    5,571
    Dave Higton
    Jun 23, 2006
  5. afd
    Replies:
    1
    Views:
    8,420
    Colin Paul Gloster
    Mar 23, 2007
Loading...

Share This Page