Subtraction : LUSENET : ece342 : One Thread

This may be a stupid question but how do we do subtraction in VHDL?? I'm not sure how to decrement the Count variable by 2.

-- Stumpey (, March 10, 1999


In case anyone is still looking for an answer to this, you can *not* by default treat STD_LOGIC_VECTORs as if they were numbers (with operators like + or -.) If you use the following library:

USE ieee.std_logic_unsigned.all;

then it becomes legal to do

count <= count + 2; -- count is STD_LOGIC_VECTOR


-- Robin Grindley (, March 13, 1999.

Moderation questions? read the FAQ