vhdl vector subtraction

Joined
Nov 5, 2008
Messages
9
Reaction score
0
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
 
Joined
Mar 10, 2008
Messages
348
Reaction score
0
How about giving then an init value like
Signal V_NEW1: std_logic_vector (7 downto 0) := "00000000";

Jeppe
 
Joined
Nov 5, 2008
Messages
9
Reaction score
0
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);
 
Joined
Mar 10, 2008
Messages
348
Reaction score
0
Well - I got a feeling - the REAL problem could be - GRAND_NORM_1 never given a value in your circuit.
Please check this :)
Jeppe
 

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

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top