1 |
2051e520
|
Arnaud Dieumegard
|
library ieee;
|
2 |
|
|
use ieee.std_logic_1164.all;
|
3 |
|
|
|
4 |
|
|
library ieee;
|
5 |
|
|
use ieee.numeric_std.all;
|
6 |
|
|
|
7 |
|
|
entity mul_499 is
|
8 |
|
|
port (
|
9 |
|
|
result : out std_logic_vector(31 downto 0);
|
10 |
|
|
in_a : in std_logic_vector(31 downto 0);
|
11 |
|
|
in_b : in std_logic_vector(15 downto 0)
|
12 |
|
|
);
|
13 |
|
|
end mul_499;
|
14 |
|
|
|
15 |
|
|
architecture augh of mul_499 is
|
16 |
|
|
|
17 |
|
|
signal tmp_res : signed(47 downto 0);
|
18 |
|
|
|
19 |
|
|
begin
|
20 |
|
|
|
21 |
|
|
-- The actual multiplication
|
22 |
|
|
tmp_res <= signed(in_a) * signed(in_b);
|
23 |
|
|
|
24 |
|
|
-- Set the output
|
25 |
|
|
result <= std_logic_vector(tmp_res(31 downto 0));
|
26 |
|
|
|
27 |
|
|
end architecture;
|