Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
8 years ago

Easiest Testbench for my VHDL code (multiplication)

Hello there. Is there somebody who can make testbench from my vhdl code? It is multiplication of 2 integers, which are n-1 downto 0.. n=16. Thanks a lot..

library IEEE;use IEEE.STD_LOGIC_1164.ALL;
use IEEE.numeric_std.ALL;
entity MultExample is
Generic ( n  : natural := 16);
Port (A,B : in std_logic_vector(n-1 downto 0);        
			Q : out std_logic_vector(n*2-1 downto 0);
		
			 
end MultExample;
architecture Behavioral of MultExample is
BEGIN
	Q <= std_logic_vector(signed(A) * signed(B));
end architecture Behavioral;

12 Replies