(romA and romB) and another one which contains the type of the equation (A+A, A+B, B-A C - A etc) -> C is the last result . After the result is calculated, it is saved in a register.
Then in the test bench I the address of the numbers (e.g "0000", "0001" -> the numbers are saved in a 16 size array so I selected them by those 4 bits). However, the last result is NOT saved in the register!!! This is code for the register:
- Code: Select all
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity register_c is
Port ( clk : in std_logic;
reset : in std_logic;
write : in std_logic;
data_in : in std_logic_vector(7 downto 0);
data_out : out std_logic_vector(7 downto 0));
end register_c;
architecture Behavioral of register_c is
signal temp : std_logic_vector(7 downto 0);
begin
regis : process (clk,write,reset,data_in)
begin
if reset ='0' then
if (clk'event and clk='1') then
if write='1' then
temp <=data_in;
else
temp<=temp;
end if;
end if;
elsif reset='1' then
temp <= "00000000";
end if;
end process;
u0: data_out <= temp;
end Behavioral;
Is my way of doing it wrong or is the data of the temp signal lost?