------------------------------------------------------------------------------- -- -- This is a multiplier -- -- Paul Chow -- Department of Electrical and Computer Engineering -- University of Toronto -- -- January 1998 -- ------------------------------------------------------------------------------- library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_signed.all; entity booth is port( iClk : in STD_LOGIC; iReset : in STD_LOGIC; iGo : in STD_LOGIC; oDone : out STD_LOGIC; iMer : in STD_LOGIC_VECTOR(7 downto 0); iMand : in STD_LOGIC_VECTOR(7 downto 0); oProduct : out STD_LOGIC_VECTOR(15 downto 0) ); end booth; architecture Behave of booth is signal Product : signed (15 downto 0); signal Done : STD_LOGIC; begin -- Behave mult: process (iClk,iReset,iGo,iMer,IMand) begin -- mult if (iReset = '1') then Product <= (others => '0'); Done <= '0'; elsif (iClk'event and iClk = '1') then Product <= signed(iMer) * signed(iMand); Done <= '1'; end if; end process mult; oProduct <= STD_LOGIC_VECTOR(Product); oDone <= Done; end Behave; -- of booth