Professional Documents
Culture Documents
Figure 12.3 shows the diagram of a 4-bit parallel multiplier. Contrary to the case of
gure 12.1, here all input bits are applied to the system simultaneously. Therefore,
registers are not required. Notice in gure 12.3 that only AND gates and FAU (full
adder units) are necessary to construct a parallel multiplier. The operands are a and
b (each of four bits), and the resulting product is prod (eight bits).
b(3)
b(2)
b(1)
b(0)
a(0)
a(1)
p(0)
+
carry
sum
a(2)
p(1)
+
a(3)
p(2)
+
p(3)
+
p(7)
Figure 12.3
Parallel multiplier.
p(6)
p(5)
p(4)
Figure 12.4
Simulation results of parallel multiplier.
The VHDL code shown below was based on COMPONENT instantiation. Notice
that two basic components, AND_2 and FAU, were rst specied (shown in section
12.1). These components were then instantiated to construct higher-level components, top_row, mid_row, and lower_row. All of these components were then declared
in a PACKAGE called my_components, and nally used in the project called multiplier to implement the circuit of gure 12.3. Simulation results are shown in gure
12.4.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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
p: OUT STD_LOGIC);
28
END COMPONENT;
29
----------------------30
COMPONENT lower_row IS
31
PORT ( sin, cin: IN STD_LOGIC_VECTOR (2 DOWNTO 0);
32
p: OUT STD_LOGIC_VECTOR (3 DOWNTO 0);
33
END COMPONENT;
34
----------------------35 END my_components;
36 ---------------------------------------------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
Figure 12.5
Parallel multiplier inferred from the pre-dened * operator.
A Simpler Approach
The example above had the purpose of exploring several aspects related to system
design using VHDL. However, for the particular case of a parallel multiplier, it can
be immediately inferred by means of the pre-dened * (multiplication) operator.
Therefore, the circuit above can be represented using the compact form of gure
12.5, and the whole code above can be replaced by the following code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
--------------------------------------LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.std_logic_arith.all;
--------------------------------------ENTITY multiplier3 IS
PORT ( a, b: IN SIGNED(3 DOWNTO 0);
prod: OUT SIGNED(7 DOWNTO 0));
END multiplier3;
--------------------------------------ARCHITECTURE behavior OF multiplier3 IS
BEGIN
prod <= a * b;
END behavior;
---------------------------------------