LPokr
New Contributor
8 years agoHow to write testbench for 18x18 multiplier
I need to write testbench for 18x18 multiplier, which reads input from a text file (at least 10 numbers). Every input has to have at least 1 one and 1 zero in 4 most significant bits, and half of the tested numbers are negative. If the results are correct, must be tested in testbench file.
Code is simple:
LIBRARY ieee;
USE ieee.std_logic_1164.ALL;
USE ieee.numeric_std.ALL;
ENTITY signed_mult18 is
PORT( a : IN SIGNED (17 DOWNTO 0);
b : IN SIGNED (17 DOWNTO 0);
result : OUT SIGNED (35 DOWNTO 0));
END ENTITY;
ARCHITECTURE rtl OF signed_mult18 IS
BEGIN
result <= a * b;
END rtl;Thank you very much.