Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > need help on VHDL

Reply
Thread Tools

need help on VHDL

 
 
ghouol ghouol is offline
Junior Member
Join Date: Oct 2009
Posts: 2
 
      10-29-2009
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
 
Reply With Quote
 
 
 
 
eliascm eliascm is offline
Member
Join Date: Jan 2009
Posts: 42
 
      10-30-2009
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;
 
Reply With Quote
 
 
 
 
tooh83 tooh83 is offline
Junior Member
Join Date: Oct 2009
Posts: 1
 
      10-30-2009
ISE 8.2 doesn't support generic types which is a new vhdl2008 construct
 
Reply With Quote
 
ghouol ghouol is offline
Junior Member
Join Date: Oct 2009
Posts: 2
 
      10-31-2009
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?
 
Reply With Quote
 
 
 
Reply

Thread Tools

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
VHDL-2002 vs VHDL-93 vs VHDL-87? afd VHDL 1 03-23-2007 09:33 AM
BPSK on VHDL (warning - VHDL newbie) pygmalion VHDL 6 06-23-2006 07:30 PM
VHDL 2002 vs VHDL 1993 dude VHDL 1 03-23-2006 01:18 PM
multiD-vhdl: Multi Dimensional Arrays (allowing generics on each dimension) for VHDL (including ports) albert.neu@gmail.com VHDL 2 03-21-2006 04:05 PM
what's the difference between VHDL 93 CONCATENATION and VHDL 87 CONCATENATION? walala VHDL 3 09-18-2003 04:17 AM



Advertisments
 



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 47 48 49 50 51 52 53 54 55 56 57