-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMultiplier_2.vhd
83 lines (69 loc) · 1.8 KB
/
Multiplier_2.vhd
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
----------------------------------------------------------------------------------
-- Company:
-- Engineer:
--
-- Create Date: 02/27/2024 02:05:11 PM
-- Design Name:
-- Module Name: Multiplier_2 - Behavioral
-- Project Name:
-- Target Devices:
-- Tool Versions:
-- Description:
--
-- Dependencies:
--
-- Revision:
-- Revision 0.01 - File Created
-- Additional Comments:
--
----------------------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
-- Uncomment the following library declaration if using
-- arithmetic functions with Signed or Unsigned values
--use IEEE.NUMERIC_STD.ALL;
-- Uncomment the following library declaration if instantiating
-- any Xilinx leaf cells in this code.
--library UNISIM;
--use UNISIM.VComponents.all;
entity Multiplier_2 is
Port ( A : in STD_LOGIC_VECTOR (1 downto 0);
B : in STD_LOGIC_VECTOR (1 downto 0);
Y : out STD_LOGIC_VECTOR (3 downto 0));
end Multiplier_2;
architecture Behavioral of Multiplier_2 is
component FA is
Port ( A : in STD_LOGIC;
B : in STD_LOGIC;
C_in : in STD_LOGIC;
S : out STD_LOGIC;
C_out : out STD_LOGIC);
end component;
signal b0a0, b1a0, b0a1, b1a1 : std_logic;
signal c1, c2, s1, s2 : std_logic;
begin
FA_0_0 : FA
PORT MAP(
A => b1a0,
B => b0a1,
C_in => '0',
s => s1,
c_out => c1
);
FA_1_0 : FA
PORT MAP(
A => '0',
B => b1a1,
C_in => c1,
s => s2,
c_out => c2
);
b0a0 <= A(0) AND B(0);
b1a0 <= A(0) AND B(1);
b0a1 <= A(1) AND B(0);
b1a1 <= A(1) AND B(1);
Y(0) <= b0a0;
Y(1) <= s1;
Y(2) <= s2;
Y(3) <= c2;
end Behavioral;