SlideShare a Scribd company logo
EE141
Unsigned
Combinational
Multiplier
2/23/2024
EE141
CombinationalMultiplier (unsigned)
X3 X2 X1 X0
* Y3 Y2 Y1 Y0
+
+
+
HA
X3Y0 X2Y0 X1Y0 X0Y0
X3Y1 X2Y1 X1Y1 X0Y1
X3Y2 X2Y2 X1Y2 X0Y2
X3Y3 X2Y3 X1Y3 X0Y3
Z7 Z6 Z5 Z4 Z3 Z2 Z1 Z0
x3
FA
x2
FA
x1
FA
x2
FA
x1
HA
x0
FA
x1
HA
x0
HA
x0
FA
x3
FA
x2
FA
x3
z0
z1
z2
z3
z4
z5
z6
z7
y3
y2
y1
y0
Propagation delay ~2N
Partial products, one for each bit in
multiplier (each bit needs just one
AND gate)
x3 x2 x1 x0
multiplicand
multiplier
2/23/2024
Carry-Save Addition
• Speeding up multiplication is a
matter of speeding up the
summing of the partial products.
• “Carry-save” addition can help.
• Carry-save addition passes
(saves) the carries to the output,
rather than propagating them.
• Example: sum three numbers,
310 = 0011, 210 = 0010, 310 = 0011
310 0011
+ 210 0010
c 0100 = 410
s 0001 = 110
310 0011
c 0010 = 210
s 0110 = 610
carry-save add
carry-save add
carry-propagate add
1000 = 810
• In general, carry-save addition takes in 3 numbers and produces 2.
• Whereas, carry-propagate takes 2 and produces 1.
• With this technique, we can avoid carry propagation until final addition
2/23/2024
Carry-save Circuits
• When adding sets of numbers,
carry-save can be used on all
but the final sum.
• Standard adder (carry
propagate) is used for final sum.
• Carry-save is fast (no carry
propagation) and cheap (same
cost as ripple adder)
2/23/2024
EE141
Signed Multipliers
2/23/2024
EE141
Combinational Multiplier (signed!)
(-3) * (-2)
(-3) 1 0 1 (X)
(-2) * 1 1 0 (Y)
0 0 0 0 0 0 Y0*X = 0
+ 1 1 1 0 1 2Y1*X = -6
- 1 1 0 1 4Y2*X = -12
(+6) 0 0 0 1 1 0
2/23/2024
EE141
CombinationalMultiplier (signed)
X3 X2 X1 X0
* Y3 Y2 Y1 Y0
X3Y0 X3Y0 X3Y0 X3Y0 X3Y0 X2Y0 X1Y0 X0Y0
+ X3Y1 X3Y1 X3Y1 X3Y1 X2Y1 X1Y1 X0Y1
+ X3Y2 X3Y2 X3Y2 X2Y2 X1Y2 X0Y2
- X3Y3 X3Y3 X2Y3 X1Y3 X0Y3
Z7 Z6 Z5 Z4 Z3 Z2 Z1 Z0
x3
FA
x2
FA
x1
FA
x2
FA
x1
FA
x0
FA
x1
HA
x0
HA
x0
FA
x3
FA
x2
FA
x3
x3 x2 x1 x0
z0
z1
z2
z3
z4
z5
z6
z7
y3
y2
y1
y0
FA
FA
FA
FA
FA
FA
FA
1
There are tricks we can use
to eliminate the extra
circuitry we added…
2/23/2024
EE141
2’sComplementMultiplication
(Baugh-Wooley)
X3 X2 X1 X0
* Y3 Y2 Y1 Y0
--------------------
X3Y0 X3Y0 X3Y0 X3Y0 X3Y0 X2Y0 X1Y0 X0Y0
+ X3Y1 X3Y1 X3Y1 X3Y1 X2Y1 X1Y1 X0Y1
+ X3Y2 X3Y2 X3Y2 X2Y2 X1Y2 X0Y2
- X3Y3 X3Y3 X2Y3 X1Y3 X0Y3
Z7 Z6 Z5 Z4 Z3 Z2 Z1 Z0
X3Y0 X2Y0 X1Y0 X0Y0
X3Y1 X2Y1 X1Y1 X0Y1
X2Y2 X1Y2 X0Y2
X3Y3 X2Y3 X1Y3 X0Y3
+
+
+
+
+ 1
1
1
Step 1: two’s complement operands so high
order bit is –2N-1. Must sign extend partial
products and subtract the last one
Step 3: add the ones to the partial products
and propagate the carries. All the sign
extension bits go away!
Step 4: finish computing the constants…
Result: multiplying 2’s complement operands
takes just about same amount of hardware as
multiplying unsigned operands!
X3Y0 X2Y0 X1Y0 X0Y0
X3Y1 X2Y1 X1Y1 X0Y1
X2Y2 X1Y2 X0Y2
X3Y3 X2Y3 X1Y3 X0Y3
+
+
+
+
+
- 1 1 1
1
1
Step 2: don’t want all those extra additions, so
add a carefully chosen constant, remembering
to subtract it at the end. Convert subtraction
into add of (complement + 1).
X3Y0 X3Y0 X3Y0 X3Y0 X3Y0 X2Y0 X1Y0 X0Y0
+ 1
+ X3Y1 X3Y1 X3Y1 X3Y1 X2Y1 X1Y1 X0Y1
+ 1
+ X3Y2 X3Y2 X3Y2 X2Y2 X1Y2 X0Y2
+ 1
+ X3Y3 X3Y3 X2Y3 X1Y3 X0Y3
+ 1
+
-
1
1 1 1 1
–B = ~B + 1
2/23/2024
EE141
2’sComplementMultiplication
FA
x3
FA
x2
FA
x1
FA
x2
FA
x1
HA
x0
FA
x1
HA
x0
HA
x0
FA
x3
FA
x2
FA
x3
HA
1
1
x3 x2 x1 x0
z0
z1
z2
z3
z4
z5
z6
z7
y3
y2
y1
y0
22
2/23/2024
EE141
Multiplicationin Verilog
You can use the “*” operator to multiply two numbers:
wire [9:0] a,b;
wire [19:0] result = a*b; // unsigned multiplication!
If you want Verilog to treat your operands as signed two’s complement
numbers, add the keyword signed to your wire or reg declaration:
wire signed [9:0] a,b;
wire signed [19:0] result = a*b; // signed multiplication!
Remember: unlike addition and subtraction, you need different circuitry
if your multiplication operands are signed vs. unsigned. Same is true of
the >>> (arithmetic right shift) operator. To get signed operations all
operands must be signed.
wire signed [9:0] a;
wire [9:0] b;
wire signed [19:0] result = a*$signed(b);
To make a signed constant: 10’sh37C 23
2/23/2024

More Related Content

Similar to unsigned binary numbers Each bit of the (20)

PDF
logic.deghjkl;jldddghbmedgygshedgyssfjfheueh
menna67hassan
 
PPT
Addition and subtraction with signed magnitude data (mano
cs19club
 
PDF
Arithmetic Unit Addition Subtraction Multiplication and Division
RNShukla7
 
PDF
This is abouts are you doing the same time who is the best person to be safe and
codekeliyehai
 
PDF
mrecadvancedvlsi subject sub-unit-4-ppt.pdf
BEVARAVASUDEVAAP1813
 
PDF
Design and Simulation of Radix-8 Booth Encoder Multiplier for Signed and Unsi...
ijsrd.com
 
PDF
COMPUTER ORGANIZATION NOTES Unit 6
Dr.MAYA NAYAK
 
PPT
ece552_08_integer_mccccccccccultiply.ppt
speedcomcyber25
 
PPT
integers multipliers and their functioning
HarshKumar915986
 
PPT
Booth Multiplier
Sudhir Kumar
 
PPTX
COA(Unit_3.pptx)
Thapar Institute
 
PPTX
Lec20
Zain Ul Abedeen
 
PPT
ece552_08_integer_multiply.ppt
ansariparveen06
 
PPT
ece552_08_integer_multiply.ppt
AnalBhandari
 
PPT
ece552_08_integer_multiply.ppt
AshokRachapalli1
 
PPTX
Computer arithmetic
Balakrishna Chowdary
 
PPT
Parallel Prefix Adders Presentation
Peeyush Pashine
 
PPTX
CA UNIT II.pptx
ssuser9dbd7e
 
PPT
Datapath subsystem multiplication
Rabindranath Tagore University, Bhopal
 
PDF
Radix8
Murali Krishna
 
logic.deghjkl;jldddghbmedgygshedgyssfjfheueh
menna67hassan
 
Addition and subtraction with signed magnitude data (mano
cs19club
 
Arithmetic Unit Addition Subtraction Multiplication and Division
RNShukla7
 
This is abouts are you doing the same time who is the best person to be safe and
codekeliyehai
 
mrecadvancedvlsi subject sub-unit-4-ppt.pdf
BEVARAVASUDEVAAP1813
 
Design and Simulation of Radix-8 Booth Encoder Multiplier for Signed and Unsi...
ijsrd.com
 
COMPUTER ORGANIZATION NOTES Unit 6
Dr.MAYA NAYAK
 
ece552_08_integer_mccccccccccultiply.ppt
speedcomcyber25
 
integers multipliers and their functioning
HarshKumar915986
 
Booth Multiplier
Sudhir Kumar
 
COA(Unit_3.pptx)
Thapar Institute
 
ece552_08_integer_multiply.ppt
ansariparveen06
 
ece552_08_integer_multiply.ppt
AnalBhandari
 
ece552_08_integer_multiply.ppt
AshokRachapalli1
 
Computer arithmetic
Balakrishna Chowdary
 
Parallel Prefix Adders Presentation
Peeyush Pashine
 
CA UNIT II.pptx
ssuser9dbd7e
 
Datapath subsystem multiplication
Rabindranath Tagore University, Bhopal
 

More from ssuser6feece1 (8)

PPT
FSMThe Finite State Machine is an ab.ppt
ssuser6feece1
 
PPTX
LED workshop pptLight-emitting diod.pptx
ssuser6feece1
 
PPT
briefDigital circuits make up all comput
ssuser6feece1
 
PPTX
FIELD EFFECT TRANSISTORThe field-effect transistor (FET) is a type.pptx
ssuser6feece1
 
PPT
lab_1 This Lab is used for conducting th
ssuser6feece1
 
PDF
Sequential circuits Sequential circuits1
ssuser6feece1
 
PPTX
The electronics industry has achie ved a
ssuser6feece1
 
PPTX
Digital-Logic40124sequential circuits logic gatepptx
ssuser6feece1
 
FSMThe Finite State Machine is an ab.ppt
ssuser6feece1
 
LED workshop pptLight-emitting diod.pptx
ssuser6feece1
 
briefDigital circuits make up all comput
ssuser6feece1
 
FIELD EFFECT TRANSISTORThe field-effect transistor (FET) is a type.pptx
ssuser6feece1
 
lab_1 This Lab is used for conducting th
ssuser6feece1
 
Sequential circuits Sequential circuits1
ssuser6feece1
 
The electronics industry has achie ved a
ssuser6feece1
 
Digital-Logic40124sequential circuits logic gatepptx
ssuser6feece1
 
Ad

Recently uploaded (20)

DOCX
8th International Conference on Electrical Engineering (ELEN 2025)
elelijjournal653
 
PDF
IoT - Unit 2 (Internet of Things-Concepts) - PPT.pdf
dipakraut82
 
PPTX
ISO/IEC JTC 1/WG 9 (MAR) Convenor Report
Kurata Takeshi
 
PPTX
site survey architecture student B.arch.
sri02032006
 
PDF
ARC--BUILDING-UTILITIES-2-PART-2 (1).pdf
IzzyBaniquedBusto
 
PDF
MAD Unit - 1 Introduction of Android IT Department
JappanMavani
 
PDF
Statistical Data Analysis Using SPSS Software
shrikrishna kesharwani
 
PPTX
Introduction to Design of Machine Elements
PradeepKumarS27
 
PPTX
Hashing Introduction , hash functions and techniques
sailajam21
 
PPTX
UNIT DAA PPT cover all topics 2021 regulation
archu26
 
PPTX
Heart Bleed Bug - A case study (Course: Cryptography and Network Security)
Adri Jovin
 
PPTX
REINFORCEMENT AS CONSTRUCTION MATERIALS.pptx
mohaiminulhaquesami
 
DOC
MRRS Strength and Durability of Concrete
CivilMythili
 
PPTX
Thermal runway and thermal stability.pptx
godow93766
 
PPTX
Arduino Based Gas Leakage Detector Project
CircuitDigest
 
PPTX
Day2 B2 Best.pptx
helenjenefa1
 
PPTX
Break Statement in Programming with 6 Real Examples
manojpoojary2004
 
PPTX
Benefits_^0_Challigi😙🏡💐8fenges[1].pptx
akghostmaker
 
PDF
POWER PLANT ENGINEERING (R17A0326).pdf..
haneefachosa123
 
PPTX
Green Building & Energy Conservation ppt
Sagar Sarangi
 
8th International Conference on Electrical Engineering (ELEN 2025)
elelijjournal653
 
IoT - Unit 2 (Internet of Things-Concepts) - PPT.pdf
dipakraut82
 
ISO/IEC JTC 1/WG 9 (MAR) Convenor Report
Kurata Takeshi
 
site survey architecture student B.arch.
sri02032006
 
ARC--BUILDING-UTILITIES-2-PART-2 (1).pdf
IzzyBaniquedBusto
 
MAD Unit - 1 Introduction of Android IT Department
JappanMavani
 
Statistical Data Analysis Using SPSS Software
shrikrishna kesharwani
 
Introduction to Design of Machine Elements
PradeepKumarS27
 
Hashing Introduction , hash functions and techniques
sailajam21
 
UNIT DAA PPT cover all topics 2021 regulation
archu26
 
Heart Bleed Bug - A case study (Course: Cryptography and Network Security)
Adri Jovin
 
REINFORCEMENT AS CONSTRUCTION MATERIALS.pptx
mohaiminulhaquesami
 
MRRS Strength and Durability of Concrete
CivilMythili
 
Thermal runway and thermal stability.pptx
godow93766
 
Arduino Based Gas Leakage Detector Project
CircuitDigest
 
Day2 B2 Best.pptx
helenjenefa1
 
Break Statement in Programming with 6 Real Examples
manojpoojary2004
 
Benefits_^0_Challigi😙🏡💐8fenges[1].pptx
akghostmaker
 
POWER PLANT ENGINEERING (R17A0326).pdf..
haneefachosa123
 
Green Building & Energy Conservation ppt
Sagar Sarangi
 
Ad

unsigned binary numbers Each bit of the

  • 2. EE141 CombinationalMultiplier (unsigned) X3 X2 X1 X0 * Y3 Y2 Y1 Y0 + + + HA X3Y0 X2Y0 X1Y0 X0Y0 X3Y1 X2Y1 X1Y1 X0Y1 X3Y2 X2Y2 X1Y2 X0Y2 X3Y3 X2Y3 X1Y3 X0Y3 Z7 Z6 Z5 Z4 Z3 Z2 Z1 Z0 x3 FA x2 FA x1 FA x2 FA x1 HA x0 FA x1 HA x0 HA x0 FA x3 FA x2 FA x3 z0 z1 z2 z3 z4 z5 z6 z7 y3 y2 y1 y0 Propagation delay ~2N Partial products, one for each bit in multiplier (each bit needs just one AND gate) x3 x2 x1 x0 multiplicand multiplier 2/23/2024
  • 3. Carry-Save Addition • Speeding up multiplication is a matter of speeding up the summing of the partial products. • “Carry-save” addition can help. • Carry-save addition passes (saves) the carries to the output, rather than propagating them. • Example: sum three numbers, 310 = 0011, 210 = 0010, 310 = 0011 310 0011 + 210 0010 c 0100 = 410 s 0001 = 110 310 0011 c 0010 = 210 s 0110 = 610 carry-save add carry-save add carry-propagate add 1000 = 810 • In general, carry-save addition takes in 3 numbers and produces 2. • Whereas, carry-propagate takes 2 and produces 1. • With this technique, we can avoid carry propagation until final addition 2/23/2024
  • 4. Carry-save Circuits • When adding sets of numbers, carry-save can be used on all but the final sum. • Standard adder (carry propagate) is used for final sum. • Carry-save is fast (no carry propagation) and cheap (same cost as ripple adder) 2/23/2024
  • 6. EE141 Combinational Multiplier (signed!) (-3) * (-2) (-3) 1 0 1 (X) (-2) * 1 1 0 (Y) 0 0 0 0 0 0 Y0*X = 0 + 1 1 1 0 1 2Y1*X = -6 - 1 1 0 1 4Y2*X = -12 (+6) 0 0 0 1 1 0 2/23/2024
  • 7. EE141 CombinationalMultiplier (signed) X3 X2 X1 X0 * Y3 Y2 Y1 Y0 X3Y0 X3Y0 X3Y0 X3Y0 X3Y0 X2Y0 X1Y0 X0Y0 + X3Y1 X3Y1 X3Y1 X3Y1 X2Y1 X1Y1 X0Y1 + X3Y2 X3Y2 X3Y2 X2Y2 X1Y2 X0Y2 - X3Y3 X3Y3 X2Y3 X1Y3 X0Y3 Z7 Z6 Z5 Z4 Z3 Z2 Z1 Z0 x3 FA x2 FA x1 FA x2 FA x1 FA x0 FA x1 HA x0 HA x0 FA x3 FA x2 FA x3 x3 x2 x1 x0 z0 z1 z2 z3 z4 z5 z6 z7 y3 y2 y1 y0 FA FA FA FA FA FA FA 1 There are tricks we can use to eliminate the extra circuitry we added… 2/23/2024
  • 8. EE141 2’sComplementMultiplication (Baugh-Wooley) X3 X2 X1 X0 * Y3 Y2 Y1 Y0 -------------------- X3Y0 X3Y0 X3Y0 X3Y0 X3Y0 X2Y0 X1Y0 X0Y0 + X3Y1 X3Y1 X3Y1 X3Y1 X2Y1 X1Y1 X0Y1 + X3Y2 X3Y2 X3Y2 X2Y2 X1Y2 X0Y2 - X3Y3 X3Y3 X2Y3 X1Y3 X0Y3 Z7 Z6 Z5 Z4 Z3 Z2 Z1 Z0 X3Y0 X2Y0 X1Y0 X0Y0 X3Y1 X2Y1 X1Y1 X0Y1 X2Y2 X1Y2 X0Y2 X3Y3 X2Y3 X1Y3 X0Y3 + + + + + 1 1 1 Step 1: two’s complement operands so high order bit is –2N-1. Must sign extend partial products and subtract the last one Step 3: add the ones to the partial products and propagate the carries. All the sign extension bits go away! Step 4: finish computing the constants… Result: multiplying 2’s complement operands takes just about same amount of hardware as multiplying unsigned operands! X3Y0 X2Y0 X1Y0 X0Y0 X3Y1 X2Y1 X1Y1 X0Y1 X2Y2 X1Y2 X0Y2 X3Y3 X2Y3 X1Y3 X0Y3 + + + + + - 1 1 1 1 1 Step 2: don’t want all those extra additions, so add a carefully chosen constant, remembering to subtract it at the end. Convert subtraction into add of (complement + 1). X3Y0 X3Y0 X3Y0 X3Y0 X3Y0 X2Y0 X1Y0 X0Y0 + 1 + X3Y1 X3Y1 X3Y1 X3Y1 X2Y1 X1Y1 X0Y1 + 1 + X3Y2 X3Y2 X3Y2 X2Y2 X1Y2 X0Y2 + 1 + X3Y3 X3Y3 X2Y3 X1Y3 X0Y3 + 1 + - 1 1 1 1 1 –B = ~B + 1 2/23/2024
  • 10. EE141 Multiplicationin Verilog You can use the “*” operator to multiply two numbers: wire [9:0] a,b; wire [19:0] result = a*b; // unsigned multiplication! If you want Verilog to treat your operands as signed two’s complement numbers, add the keyword signed to your wire or reg declaration: wire signed [9:0] a,b; wire signed [19:0] result = a*b; // signed multiplication! Remember: unlike addition and subtraction, you need different circuitry if your multiplication operands are signed vs. unsigned. Same is true of the >>> (arithmetic right shift) operator. To get signed operations all operands must be signed. wire signed [9:0] a; wire [9:0] b; wire signed [19:0] result = a*$signed(b); To make a signed constant: 10’sh37C 23 2/23/2024