subtraction of negative number - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

subtraction of negative number

Hi

i am trying ot subtract a negative number as follows:

use ieee.std_logic_numeric.all

constant a signed(16 downto 0):= '0' & x"8000";
constant b signed(16 downto 0):= '1' & x"0030";

signal c signed(16 downto 0);


c <= a - b;

c should be 32816 but i get 32720

please help

Many thanks

Sign In or Register to comment.