Go Back   Velocity Reviews > Newsgroups > VHDL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

VHDL - need help on VHDL

 
Thread Tools Search this Thread
Old 10-29-2009, 10:53 PM   #1
Default need help on VHDL


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
ghouol is offline   Reply With Quote
Old 10-30-2009, 12:51 PM   #2
eliascm
Junior Member
 
Join Date: Jan 2009
Posts: 13
Default 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
eliascm is offline   Reply With Quote
Old 10-30-2009, 06:55 PM   #3
tooh83
Junior Member
 
Join Date: Oct 2009
Posts: 1
Default
ISE 8.2 doesn't support generic types which is a new vhdl2008 construct


tooh83
tooh83 is offline   Reply With Quote
Old 10-31-2009, 08:30 PM   #4
ghouol
Junior Member
 
Join Date: Oct 2009
Posts: 2
Default thanks
Quote:
Originally Posted by tooh83
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?


ghouol
ghouol is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46