Guest
hi,
I have this code (pseudo code, all inputs and signal should be unsigned
integers):
input first_input, second_input: std_logic_vector (4 downto 0);
Library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_arith.all;
use IEEE.std_logic_unsigned.all;
signal total : std_logic_vector (5 downto 0);
get_total : process (my_inputs)
begin -- process
total <= '0' & (("11110" - first_input) + ("11110" -
second_input));
end process;
that is, total = (30 - first input) + (30 -second_input).
When first_input and second_input are both zero total comes equal to 28
decimal, not 60,
with modelsim. What am i doing wrong? Bad libraries, bad signal types,
what? I have experience
with Verilog, but not vhdl....
Thanks,
Mon
I have this code (pseudo code, all inputs and signal should be unsigned
integers):
input first_input, second_input: std_logic_vector (4 downto 0);
Library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_arith.all;
use IEEE.std_logic_unsigned.all;
signal total : std_logic_vector (5 downto 0);
get_total : process (my_inputs)
begin -- process
total <= '0' & (("11110" - first_input) + ("11110" -
second_input));
end process;
that is, total = (30 - first input) + (30 -second_input).
When first_input and second_input are both zero total comes equal to 28
decimal, not 60,
with modelsim. What am i doing wrong? Bad libraries, bad signal types,
what? I have experience
with Verilog, but not vhdl....
Thanks,
Mon