-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMULTIPLY_UNIT.vhd
More file actions
50 lines (38 loc) · 1.62 KB
/
MULTIPLY_UNIT.vhd
File metadata and controls
50 lines (38 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
-- #######################################################
-- # < STORM CORE PROCESSOR by Stephan Nolting > #
-- # *************************************************** #
-- # Multiplication Unit #
-- # *************************************************** #
-- # Last modified: 19.03.2011 #
-- #######################################################
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;
library work;
use work.STORM_core_package.all;
entity MULTIPLY_UNIT is
port (
-- Function Operands --
--------------------------------------------------
OP_B_I : in STD_LOGIC_VECTOR(31 downto 0);
OP_C_I : in STD_LOGIC_VECTOR(31 downto 0);
RESULT_O : out STD_LOGIC_VECTOR(31 downto 0);
-- Flag Results --
--------------------------------------------------
CARRY_O : out STD_LOGIC;
OVFL_O : out STD_LOGIC
);
end MULTIPLY_UNIT;
architecture Behavioral of MULTIPLY_UNIT is
-- local signals --
signal TEMP : STD_LOGIC_VECTOR(63 downto 0);
begin
-- Multiplication Unit ---------------------------------------------------------------------------------
-- --------------------------------------------------------------------------------------------------------
TEMP <= std_logic_vector(unsigned(OP_B_I) * unsigned(OP_C_I));
RESULT_O <= TEMP(31 downto 0);
CARRY_O <= '0';
OVFL_O <= '0';
--CARRY_OUT <= '1' when (TEMP(63 downto 32) = x"00000001") else '0';
--OVFL_OUT <= '0' when (TEMP(63 downto 33) = (x"0000000" & "000")) else '1';
end Behavioral;