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

Reply

VHDL - vhdl vector subtraction

 
Thread Tools Search this Thread
Old 11-05-2008, 10:52 AM   #1
Default vhdl vector subtraction


Hi i have this code that doesn't work:


library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_arith.all;
use IEEE.std_logic_unsigned.all;


V_NEW_1 <= V_STORE_1 - GRAD_NORM_1;

where all are: SIGNAL std_logic_vector (7 down to 0)

and this warning:

There is an 'U'|'X'|'W'|'Z'|'-' in an arithmetic operand, the result will be 'X'(es).

Someone can help me?
thanks


nicx82
nicx82 is offline   Reply With Quote
Old 11-05-2008, 01:25 PM   #2
jeppe
Senior Member
 
Join Date: Mar 2008
Location: Denmark
Posts: 245
Default
How about giving then an init value like
Signal V_NEW1: std_logic_vector (7 downto 0) := "00000000";

Jeppe


jeppe
jeppe is offline   Reply With Quote
Old 11-05-2008, 02:07 PM   #3
nicx82
Junior Member
 
Join Date: Nov 2008
Posts: 5
Default
thanks for the reply.


nicx82

Last edited by nicx82 : 11-05-2008 at 02:55 PM.
nicx82 is offline   Reply With Quote
Old 11-05-2008, 02:55 PM   #4
nicx82
Junior Member
 
Join Date: Nov 2008
Posts: 5
Default
By initializing the vectors the code works, but V_NEW_1 take the value of V_STORE_1 and not the value of the difference beetween V_STORE_1 and GRAD_NORM_1.

V_NEW_1 <= (V_STORE_1 - GRAD_NORM_1);


nicx82
nicx82 is offline   Reply With Quote
Old 11-05-2008, 06:11 PM   #5
jeppe
Senior Member
 
Join Date: Mar 2008
Location: Denmark
Posts: 245
Default
Well - I got a feeling - the REAL problem could be - GRAND_NORM_1 never given a value in your circuit.
Please check this
Jeppe


jeppe
jeppe 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