Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > Need help initializing LPM_Add_Sub to do Sub

Reply
Thread Tools

Need help initializing LPM_Add_Sub to do Sub

 
 
hellbinder hellbinder is offline
Junior Member
Join Date: Jun 2009
Posts: 1
 
      06-28-2009
Well I got a final Project for tomorrow and the teacher is making us write in VHDL when we never even seen the language, I'm trying to make a subtraction using the LPM_add_sub as he requested (4 bit variables)

I got this using quartus:
LIBRARY ieee;
USE ieee.std_logic_1164.all;

LIBRARY lpm;
USE lpm.lpm_components.all;

ENTITY Finalprojsub IS
PORT
(
dataa : IN STD_LOGIC_VECTOR (3 DOWNTO 0);
datab : IN STD_LOGIC_VECTOR (3 DOWNTO 0);
result : OUT STD_LOGIC_VECTOR (3 DOWNTO 0)
);
END Finalprojsub;


ARCHITECTURE SYN OF finalprojsub IS

SIGNAL sub_wire0 : STD_LOGIC_VECTOR (3 DOWNTO 0);



COMPONENT lpm_add_sub
GENERIC (
lpm_width : NATURAL;
lpm_direction : STRING;
lpm_type : STRING;
lpm_hint : STRING
);
PORT (
dataa : IN STD_LOGIC_VECTOR (3 DOWNTO 0);
datab : IN STD_LOGIC_VECTOR (3 DOWNTO 0);
result : OUT STD_LOGIC_VECTOR (3 DOWNTO 0)
);
END COMPONENT;

BEGIN
result <= sub_wire0(3 DOWNTO 0);

lpm_add_sub_component : lpm_add_sub
GENERIC MAP (
lpm_width => 4,
lpm_direction => "SUB",
lpm_type => "LPM_ADD_SUB",
lpm_hint => "ONE_INPUT_IS_CONSTANT=NO,CIN_USED=NO"
)
PORT MAP (
dataa => dataa,
datab => datab,
result => sub_wire0
);

Each time I try to compile it I get I keep getting "error: Node instance instantiates undefined entity FinalProject"
FinalProject being the name of the project.
Can anyone help me out?
 
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
Death To Sub-Sub-Sub-Directories! Lawrence D'Oliveiro Java 92 05-20-2011 06:50 AM
Recognising Sub-Items and sub-sub items using xslt Ben XML 2 09-19-2007 09:35 AM
what's the differences between "Overrides Sub OnError" and "Sub Page_Error" ? Tee ASP .Net 2 07-09-2004 09:50 AM
Possible to terminate a sub that loads another sub? Kathy Burke ASP .Net 3 11-24-2003 02:01 PM
how do make a pop-up in sub ASP.net sub ? THY ASP .Net 1 08-18-2003 11:30 PM



Advertisments