L
lezah
Guest
Hi,
I encounter some question about addition in Maxplus II,
Some addition result is wrong. A,B,D in either signed or
std_logic_vector are wrong. What is the problem?
Thanks
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_signed.all;
use IEEE.std_logic_arith.all;
entity test1 is
port(
clk :in std_logic;
A :in signed(4 downto 0);
B :in signed(4 downto 0);
D ut signed(5 downto 0)
);
end test1;
architecture behave of test1 is
begin
process(clk)
begin
if falling_edge(clk) then
D<=A+B;
end if;
end process;
end behave;
I encounter some question about addition in Maxplus II,
Some addition result is wrong. A,B,D in either signed or
std_logic_vector are wrong. What is the problem?
Thanks
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_signed.all;
use IEEE.std_logic_arith.all;
entity test1 is
port(
clk :in std_logic;
A :in signed(4 downto 0);
B :in signed(4 downto 0);
D ut signed(5 downto 0)
);
end test1;
architecture behave of test1 is
begin
process(clk)
begin
if falling_edge(clk) then
D<=A+B;
end if;
end process;
end behave;