Professional Documents
Culture Documents
multiplier?
TA: R07943123 馬咏治
Contact: R07943123@ntu.edu.tw
How to compute 4*3?
• Easy! Ans = 4+4+4 = 12
• How about 4*5 ?
• Ans = 4+4+4+4+4 = 20
• The result of multiplication is the answer of successive addition.
Software implementation
• To compute a*b
• C++: • Python
• ans = 0; • ans = 0
• for(int i=0;i<b;++i) • for i in range(b):
• ans = ans + a;
• ans = ans + a
Hardware implementation ?
Does it work?
b times
直式乘法
Multiplication Detail
A3 A2 A1 A0
B3 B2 B1 B0
M7 M6 M5 M4 M3 M2 M1 M0
Step 1 compute trivial term
A3 A2 A1 A0
B3 B2 B1 B0
M7 M6 M5 M4 M3 M2 M1 M0
Step 2 compute partial sum
A3 A2 A1 A0
FA4_1_Co(Carry out)
B2A3 B2A2 B2A1 B2A0
M7 M6 M5 M4 M3 M2 M1 M0
Step 2 compute partial sum(cont.)
A3 A2 A1 A0
out here
FA4_1_Co(Carry out)
B2A3 B2A2 B2A1 B2A0
M7 M6 M5 M4 M3 M2 M1 M0
Step 2 compute partial sum(cont.)
A3 A2 A1 A0
FA4_1_
FA4_1_2 FA4_1_2 FA4_1_1
Co
B3 B2 B1 B0
B2A3 B2A2 B2A1 B2A0
M7 M6 M5 M4 M3 M2 M1 M0
Step 2 compute partial sum(cont.)
A3 A2 A1 A0
B3 B2 B1 B0
FA4_2_
FA4_2_2 FA4_2_2 FA4_2_1
Co
M6 M5 M4 M3
M7(Carry out)
How to implement
multiplier on Quartus II?
• Step 1 : reuses your 4bits full adder,
create a symbol of it. (FA4.bsf)