VHDL Mac
VHDL Mac
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity MACvhdl is
port(A,B :in std_logic_vector(7 downto 0);
int :in std_logic_vector(7 downto 0);
output :out std_logic_vector(16 downto 0));
end MACvhdl;
Test Bench:
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
ENTITY tb_MACvhdl IS
END tb_MACvhdl;
ARCHITECTURE behavior OF tb_MACvhdl IS
COMPONENT MACvhdl
PORT(
A : IN std_logic_vector(7 downto 0);
B : IN std_logic_vector(7 downto 0);
out : OUT std_logic_vector(16 downto 0)
);
END COMPONENT;
--Inputs
signal A : std_logic_vector(7 downto 0) := (others => '0');
signal B : std_logic_vector(7 downto 0) := (others => '0');
--Outputs
signal out : std_logic_vector(16 downto 0);
-- No clocks detected in port list. Replace <clock> below with
-- appropriate port name
BEGIN
stim_proc: process
begin
A<= 8'b00000000;
B<= 8'b00000000;
wait for 100 ns;
A<= 8'b00101100;
B<= 8'b00010011;
wait for 200 ns;
wait;
end process;
END;