J
Jeremy Pyle
Guest
Ok, got a question about the three types: STD_LOGIC_VECTOR, UNSIGNED and
SIGNED. The difference between UNSIGNED and SIGNED is pretty
obvious......SIGNED will always give a result in 2's compliment where
UNSIGNED will never give a result in 2's compliment. What about
STD_LOGIC_VECTOR, do I have to worry if I pass in something like this:
process
variable i : integer range 0 to 511 := 511;
variable j : STD_LOGIC_VECTOR(8 downto 0);
begin
j := CONV_STD_LOGIC_VECTOR(i, 9);
will this produce the vector as expected of 111111111 or will it sometimes
produce a 2's compliment vector? Can I get unexpected results doing
something like this?
Thanks,
Jeremy
SIGNED. The difference between UNSIGNED and SIGNED is pretty
obvious......SIGNED will always give a result in 2's compliment where
UNSIGNED will never give a result in 2's compliment. What about
STD_LOGIC_VECTOR, do I have to worry if I pass in something like this:
process
variable i : integer range 0 to 511 := 511;
variable j : STD_LOGIC_VECTOR(8 downto 0);
begin
j := CONV_STD_LOGIC_VECTOR(i, 9);
will this produce the vector as expected of 111111111 or will it sometimes
produce a 2's compliment vector? Can I get unexpected results doing
something like this?
Thanks,
Jeremy