need help on VHDL

Joined
Oct 29, 2009
Messages
2
Reaction score
0
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
 
Joined
Jan 30, 2009
Messages
42
Reaction score
0
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;
 
Joined
Oct 29, 2009
Messages
2
Reaction score
0
thanks

tooh83 said:
ISE 8.2 doesn't support generic types which is a new vhdl2008 construct

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?
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

VHDL 2008 syntax error 4
pls help me ; vhdl; 0
2 JK Circuit in VHDL 0
Illegal sequential statement (VHDL) 0
code vhdl 1
VHDL code error 10
VHDL program error 2
erreur VHDL 3

Members online

No members online now.

Forum statistics

Threads
473,983
Messages
2,570,187
Members
46,747
Latest member
jojoBizaroo

Latest Threads

Top