Skip to content

Commit d152565

Browse files
committed
ADD: multiplier code in VHDL - independent
1 parent 3fd3d8b commit d152565

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

multiplier.vhd

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
----------------------------------------------------------------------------------
2+
-- Company:
3+
-- Engineer:
4+
--
5+
-- Create Date: 18.02.2018 19:37:46
6+
-- Design Name:
7+
-- Module Name: multiplier - Behavioral
8+
-- Project Name:
9+
-- Target Devices:
10+
-- Tool Versions:
11+
-- Description:
12+
--
13+
-- Dependencies:
14+
--
15+
-- Revision:
16+
-- Revision 0.01 - File Created
17+
-- Additional Comments:
18+
--
19+
----------------------------------------------------------------------------------
20+
21+
22+
library IEEE;
23+
use IEEE.STD_LOGIC_1164.ALL;
24+
25+
-- Uncomment the following library declaration if using
26+
-- arithmetic functions with Signed or Unsigned values
27+
use IEEE.NUMERIC_STD.ALL;
28+
29+
-- Uncomment the following library declaration if instantiating
30+
-- any Xilinx leaf cells in this code.
31+
--library UNISIM;
32+
--use UNISIM.VComponents.all;
33+
34+
entity multiplier is
35+
Port ( op1 : in STD_LOGIC_VECTOR (31 downto 0);
36+
op2 : in STD_LOGIC_VECTOR (31 downto 0);
37+
out1 : out STD_LOGIC_VECTOR (31 downto 0));
38+
end multiplier;
39+
40+
architecture Behavioral of multiplier is
41+
signal outemp: std_logic_vector(63 downto 0);
42+
begin
43+
outemp <= std_logic_vector(signed(op1)*signed(op2));
44+
out1(31 downto 0) <= outemp(31 downto 0);
45+
46+
end Behavioral;

0 commit comments

Comments
 (0)