SlideShare a Scribd company logo
Multiplication and Division with
Signed-Magnitude Data
Module II
Eight Conditions for Signed-
Magnitude Addition/Subtraction
Operation
ADD
Magnit
udes
SUBTRACT Magnitudes
A > B A < B A = B
(+A) + (+B) + (A + B)
(+A) + (-B) + (A – B ) - (B – A ) + (A – B )
(-A) + (+B) - (A – B ) + (B – A ) + (A – B )
(-A) + (-B) - ( A + B)
(+A) - (+B) + (A – B ) - (B – A ) + (A – B )
(+A) - (-B) + (A + B)
(-A) - (+B) - ( A + B)
(-A) - (-B) - (A – B ) + (B – A ) + (A – B )
Examples
Example of adding
two magnitudes
when the result is
the sign of both
operands:
+3 0 011
+ +2 0 010
+5 0 101
Example of adding two
magnitudes when the
result is the sign of
the larger magnitude:
-3 1 011
+ +2 0 010
-( +3
011
- +2) 010
Flowchart of Addition and Subtraction
with Signed-Magnitude Data
Addition and Subtraction with Signed-
Magnitude Data Hardware Design
A register
AVF
E
Bs
As
B register
Complementer
Parallel Adder
S
Load
Sum
M
Mode
Control
Input
Carry
Output
Carry
Summary of Addition and Subtraction
with Signed-Magnitude Data
 The signs use an exclusive OR gate where if
the output is 0, then the signs are the same.
 Hence, add the magnitudes of the same
signed numbers. If the sum is an overflow,
then a carry is stored in E where E = 1 and
transferred to the flip-flop AVF, add-
overflow.
 Otherwise, the signs are opposite and
subtraction is initiated and stored in A.
 No overflow can occur with subtraction so
the AVF is cleared.
 If E = 1, then A > B.
 However, if A = 0, then A = B and the sign is
made positive.
 If E = 0, then A < B and sign for A is
BCD Adder
Is a circuit that adds two BCD digits in
parallel and produces the sum in BCD.
Correction logic
Derivation of BCD Adder
Block Diagram of BCD Adder
Correction logic formula
C=1 add 0110 to the binary sum
Operation
Decimal digits are added with input
carry with binary adder.
If output carry is zero, nothing is to be
added to the binary sum.
When output carry=1, 0110 is added to
the binary sum through the next adder.
 the next output carry can be ignored..
Multiplication
• A complex operation compared with
addition and subtraction
Many algorithms are used, esp. for
large numbers
Simple algorithm is the same long
multiplication taught in grade school —
Compute partial product for each digit
— Add partial products
Multiplication Example
 1011 Multiplicand (11 dec)
 x 1101 Multiplier (13 dec)
 1011 Partial products
0000 Note: if multiplier bit is 1 copy
1011 multiplicand (place value)
1011 otherwise zero
10001111 Product (143 dec)
Note: need double length result
Multiplication Algorithms
looking at successive bits of the multiplier, least
significant bit first.
If the multiplier bit is a 1, the multiplicand is
copied down;
otherwise, zeros are copied down.
The numbers copied down in successive lines
are shifted one position to the left from the
previous number.
Add these numbers.
Array Multiplier
Positive numbers can be implemented
in a combinational two-dimensional
array
Main component of each cell is a full
adder FA
Arithmetic Unit Addition Subtraction Multiplication and Division
Arithmetic Unit Addition Subtraction Multiplication and Division
Array multiplier is well known due to its
regular structure. Multiplier circuit is based
on add and shift algorithm. Each partial
product is generated by the multiplication of
the multiplicand with one multiplier bit. The
partial product are shifted according to their
bit orders and then added. The addition can
be performed with normal carry propagate
adder. N-1 adders are required where N is
the multiplier length
Arithmetic Unit Addition Subtraction Multiplication and Division
Arithmetic Unit Addition Subtraction Multiplication and Division
Flowchart
Arithmetic Unit Addition Subtraction Multiplication and Division
Booths Multiplication
Algorithms
1. The multiplicand is subtracted from the
partial product upon encountering the first least
significant 1 in a string of 1's in the multiplier.
2. The multiplicand is added to the partial
product upon encountering the first 0 (provided
that there was a previous 1) in a string of O's in
the multiplier.
3. The partial product does not change when
the multiplier bit is identical to the previous
multiplier bit.
Hardware Implementation
Flowchart
Booths Multiplication
Division Algorithms
Hardware Implementation for
Signed-Magnitude Data for
restoring divioin
Instead of shifting the partial product to
the right,the divisor and partial product
are shifted to the right.
For subtraction, perform 2’s
complemented addition.
Arithmetic Unit Addition Subtraction Multiplication and Division
Algorithms steps
Do the following n times
Shift A and Q left one binary position
Subtract M from A, and place the answer
back in A.(2’s complement addition of
divisor)
If E=1 A>=B set Qn=1.
Quotient bit 1 is added in Qn bit of partial
remainder and that is shifted to the left.
If E=0,A<B so the quotient in Qn
remains a 0.
 The value of B is then added to the partial
remainder and is shifted to the left.
Finally, , the quotient is in Q and final
remainder in A.
Arithmetic Unit Addition Subtraction Multiplication and Division
Divide Overflow
Critical when implemented in hardware
The length of the registers is finite and
will not hold a number exceeds its
length.
When the dividend is twice as long as
the divisor, overflow occurs:
If the high-order half bits of the dividend
constitute a number greater than or equal
to the divisor.
Division by zero must be avoided.
 detected by DVF(divide overflow
flipflop).
Handling Divide Overflow
Duty of the programmer
The occurrence of a divide overflow
stopped the computer (divide stop).
Not recommended(time consuming)
Provide an interrupt request when DVF
is set.
Suspend the current program and branch
to a service routine to take the corrective
actions.
Corrective measure:
Remove the program and type an error
message stating the reason.
The best way to avoid divide overflow
is use floating point data.
Flowchart

More Related Content

PPTX
Data cube computation
PPTX
1.1. the central concepts of automata theory
PPTX
Lecture 10 data structures and algorithms
PPTX
Unit 4-booth algorithm
PPT
01 knapsack using backtracking
PDF
Operating system Memory management
PPTX
Parallel sorting algorithm
PPTX
Booth’s algorithm.(a014& a015)
Data cube computation
1.1. the central concepts of automata theory
Lecture 10 data structures and algorithms
Unit 4-booth algorithm
01 knapsack using backtracking
Operating system Memory management
Parallel sorting algorithm
Booth’s algorithm.(a014& a015)

What's hot (20)

PPT
Hash tables
PPTX
Lecture 1 ddbms
PDF
Recurrence relation solutions
PDF
Array Processor
PPTX
Sequential multiplication
PDF
COMPILER DESIGN- Syntax Directed Translation
PPTX
B and B+ tree
PPT
Computer Organization and Architecture.
PPTX
Data Structure and Algorithms.pptx
PPTX
Lecture 3 threads
PPT
heap sort in the design anad analysis of algorithms
PPTX
Pipelining And Vector Processing
PPTX
Deadlock dbms
PPT
File Management in Operating Systems
PPTX
Design and Analysis of Algorithms Lecture Notes
PPT
Chapter 12 ds
PPTX
Chapter-7 Relational Calculus
PPTX
Free Space Management, Efficiency & Performance, Recovery and NFS
PDF
Parallel sorting Algorithms
Hash tables
Lecture 1 ddbms
Recurrence relation solutions
Array Processor
Sequential multiplication
COMPILER DESIGN- Syntax Directed Translation
B and B+ tree
Computer Organization and Architecture.
Data Structure and Algorithms.pptx
Lecture 3 threads
heap sort in the design anad analysis of algorithms
Pipelining And Vector Processing
Deadlock dbms
File Management in Operating Systems
Design and Analysis of Algorithms Lecture Notes
Chapter 12 ds
Chapter-7 Relational Calculus
Free Space Management, Efficiency & Performance, Recovery and NFS
Parallel sorting Algorithms
Ad

Similar to Arithmetic Unit Addition Subtraction Multiplication and Division (20)

PDF
Computer arithmetic
PPT
Computer Architecture refers to those attributes of a system that have a dire...
PPT
index of all of the financial accounts in a company's general ledger. In shor...
PPT
computer arithmatic
PDF
N akkk4lmealkkk3eqklaflerkpwoerkwflskkes
DOCX
Computer organization and architecture lab manual
PDF
Unit-8-Computer-Arithmetic.pdf
PPTX
COA(Unit_3.pptx)
PPTX
Unit_3 OF COMPUTER ARCHITECTUREUnit.pptx
PPTX
1.COMPUTER ARITHMETIC which is related to coa.pptx
PPTX
Arithmetic Logic
PPTX
Computer arithmetic
PPT
Comp Arithmetic Basic.ppt
PPTX
Computer organization algorithms like addition and subtraction and multiplica...
PDF
2.1COMPUTER ORG_ Computer Arithmetic.pdf
PDF
Implementation and Simulation of Ieee 754 Single-Precision Floating Point Mul...
PPT
105_2_digitalSystem_Chap_3_part_3.ppt
PPTX
PPS
Arithmetic Operations
PPS
Arithmetic Process in Computer Systems
Computer arithmetic
Computer Architecture refers to those attributes of a system that have a dire...
index of all of the financial accounts in a company's general ledger. In shor...
computer arithmatic
N akkk4lmealkkk3eqklaflerkpwoerkwflskkes
Computer organization and architecture lab manual
Unit-8-Computer-Arithmetic.pdf
COA(Unit_3.pptx)
Unit_3 OF COMPUTER ARCHITECTUREUnit.pptx
1.COMPUTER ARITHMETIC which is related to coa.pptx
Arithmetic Logic
Computer arithmetic
Comp Arithmetic Basic.ppt
Computer organization algorithms like addition and subtraction and multiplica...
2.1COMPUTER ORG_ Computer Arithmetic.pdf
Implementation and Simulation of Ieee 754 Single-Precision Floating Point Mul...
105_2_digitalSystem_Chap_3_part_3.ppt
Arithmetic Operations
Arithmetic Process in Computer Systems
Ad

Recently uploaded (20)

PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PDF
Automation-in-Manufacturing-Chapter-Introduction.pdf
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PDF
Digital Logic Computer Design lecture notes
PPTX
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
PPTX
Sustainable Sites - Green Building Construction
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PPTX
Lecture Notes Electrical Wiring System Components
PPTX
web development for engineering and engineering
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PPTX
Geodesy 1.pptx...............................................
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PDF
R24 SURVEYING LAB MANUAL for civil enggi
PPT
CRASH COURSE IN ALTERNATIVE PLUMBING CLASS
PPTX
CH1 Production IntroductoryConcepts.pptx
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
Model Code of Practice - Construction Work - 21102022 .pdf
Automation-in-Manufacturing-Chapter-Introduction.pdf
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
Digital Logic Computer Design lecture notes
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
Sustainable Sites - Green Building Construction
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
Lecture Notes Electrical Wiring System Components
web development for engineering and engineering
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
Geodesy 1.pptx...............................................
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
UNIT-1 - COAL BASED THERMAL POWER PLANTS
CYBER-CRIMES AND SECURITY A guide to understanding
R24 SURVEYING LAB MANUAL for civil enggi
CRASH COURSE IN ALTERNATIVE PLUMBING CLASS
CH1 Production IntroductoryConcepts.pptx
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx

Arithmetic Unit Addition Subtraction Multiplication and Division

  • 1. Multiplication and Division with Signed-Magnitude Data Module II
  • 2. Eight Conditions for Signed- Magnitude Addition/Subtraction Operation ADD Magnit udes SUBTRACT Magnitudes A > B A < B A = B (+A) + (+B) + (A + B) (+A) + (-B) + (A – B ) - (B – A ) + (A – B ) (-A) + (+B) - (A – B ) + (B – A ) + (A – B ) (-A) + (-B) - ( A + B) (+A) - (+B) + (A – B ) - (B – A ) + (A – B ) (+A) - (-B) + (A + B) (-A) - (+B) - ( A + B) (-A) - (-B) - (A – B ) + (B – A ) + (A – B )
  • 3. Examples Example of adding two magnitudes when the result is the sign of both operands: +3 0 011 + +2 0 010 +5 0 101 Example of adding two magnitudes when the result is the sign of the larger magnitude: -3 1 011 + +2 0 010 -( +3 011 - +2) 010
  • 4. Flowchart of Addition and Subtraction with Signed-Magnitude Data
  • 5. Addition and Subtraction with Signed- Magnitude Data Hardware Design A register AVF E Bs As B register Complementer Parallel Adder S Load Sum M Mode Control Input Carry Output Carry
  • 6. Summary of Addition and Subtraction with Signed-Magnitude Data  The signs use an exclusive OR gate where if the output is 0, then the signs are the same.  Hence, add the magnitudes of the same signed numbers. If the sum is an overflow, then a carry is stored in E where E = 1 and transferred to the flip-flop AVF, add- overflow.  Otherwise, the signs are opposite and subtraction is initiated and stored in A.  No overflow can occur with subtraction so the AVF is cleared.  If E = 1, then A > B.  However, if A = 0, then A = B and the sign is made positive.  If E = 0, then A < B and sign for A is
  • 7. BCD Adder Is a circuit that adds two BCD digits in parallel and produces the sum in BCD. Correction logic
  • 9. Block Diagram of BCD Adder
  • 10. Correction logic formula C=1 add 0110 to the binary sum
  • 11. Operation Decimal digits are added with input carry with binary adder. If output carry is zero, nothing is to be added to the binary sum. When output carry=1, 0110 is added to the binary sum through the next adder.  the next output carry can be ignored..
  • 12. Multiplication • A complex operation compared with addition and subtraction Many algorithms are used, esp. for large numbers Simple algorithm is the same long multiplication taught in grade school — Compute partial product for each digit — Add partial products
  • 13. Multiplication Example  1011 Multiplicand (11 dec)  x 1101 Multiplier (13 dec)  1011 Partial products 0000 Note: if multiplier bit is 1 copy 1011 multiplicand (place value) 1011 otherwise zero 10001111 Product (143 dec) Note: need double length result
  • 15. looking at successive bits of the multiplier, least significant bit first. If the multiplier bit is a 1, the multiplicand is copied down; otherwise, zeros are copied down. The numbers copied down in successive lines are shifted one position to the left from the previous number. Add these numbers.
  • 16. Array Multiplier Positive numbers can be implemented in a combinational two-dimensional array Main component of each cell is a full adder FA
  • 19. Array multiplier is well known due to its regular structure. Multiplier circuit is based on add and shift algorithm. Each partial product is generated by the multiplication of the multiplicand with one multiplier bit. The partial product are shifted according to their bit orders and then added. The addition can be performed with normal carry propagate adder. N-1 adders are required where N is the multiplier length
  • 24. Booths Multiplication Algorithms 1. The multiplicand is subtracted from the partial product upon encountering the first least significant 1 in a string of 1's in the multiplier. 2. The multiplicand is added to the partial product upon encountering the first 0 (provided that there was a previous 1) in a string of O's in the multiplier. 3. The partial product does not change when the multiplier bit is identical to the previous multiplier bit.
  • 29. Hardware Implementation for Signed-Magnitude Data for restoring divioin Instead of shifting the partial product to the right,the divisor and partial product are shifted to the right. For subtraction, perform 2’s complemented addition.
  • 31. Algorithms steps Do the following n times Shift A and Q left one binary position Subtract M from A, and place the answer back in A.(2’s complement addition of divisor) If E=1 A>=B set Qn=1. Quotient bit 1 is added in Qn bit of partial remainder and that is shifted to the left.
  • 32. If E=0,A<B so the quotient in Qn remains a 0.  The value of B is then added to the partial remainder and is shifted to the left. Finally, , the quotient is in Q and final remainder in A.
  • 34. Divide Overflow Critical when implemented in hardware The length of the registers is finite and will not hold a number exceeds its length. When the dividend is twice as long as the divisor, overflow occurs: If the high-order half bits of the dividend constitute a number greater than or equal to the divisor.
  • 35. Division by zero must be avoided.  detected by DVF(divide overflow flipflop).
  • 36. Handling Divide Overflow Duty of the programmer The occurrence of a divide overflow stopped the computer (divide stop). Not recommended(time consuming) Provide an interrupt request when DVF is set. Suspend the current program and branch to a service routine to take the corrective actions.
  • 37. Corrective measure: Remove the program and type an error message stating the reason. The best way to avoid divide overflow is use floating point data.