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
CarryOutput
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
Addition and subtraction with signed magnitude data (mano
Addition and subtraction with signed magnitude data (mano
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
Addition and subtraction with signed magnitude data (mano
Addition and subtraction with signed magnitude data (mano
Flowchart
Addition and subtraction with signed magnitude data (mano
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.
Addition and subtraction with signed magnitude data (mano
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.
Addition and subtraction with signed magnitude data (mano
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
Computer Arithmetic
PPTX
Multiplication algorithm
PPT
DATA REPRESENTATION
PPTX
Arithmetic and logical instructions
PPTX
Signed Addition And Subtraction
PPTX
Chapter 03 arithmetic for computers
PPTX
Chapter 5: Cominational Logic with MSI and LSI
PPT
COMPUTER ORGANIZATION - Logic gates, Boolean Algebra, Combinational Circuits
Computer Arithmetic
Multiplication algorithm
DATA REPRESENTATION
Arithmetic and logical instructions
Signed Addition And Subtraction
Chapter 03 arithmetic for computers
Chapter 5: Cominational Logic with MSI and LSI
COMPUTER ORGANIZATION - Logic gates, Boolean Algebra, Combinational Circuits

What's hot (20)

PPTX
Restoring & Non-Restoring Division Algorithm By Sania Nisar
PPTX
ADDRESSING MODES
PPTX
Computer arithmetic
PPTX
Addressing sequencing
PPTX
bus and memory tranfer (computer organaization)
DOCX
Control Units : Microprogrammed and Hardwired:control unit
PPT
Pipeline hazards in computer Architecture ppt
PPTX
Unit 4-booth algorithm
PPS
Computer instructions
PPS
Cache memory
PPTX
memory reference instruction
PPTX
Design of Accumulator Unit
PPT
Instruction cycle
PDF
SOLUTION MANUAL OF COMPUTER ORGANIZATION BY CARL HAMACHER, ZVONKO VRANESIC & ...
PPTX
Register organization, stack
PPTX
General register organization (computer organization)
PPT
Instruction format
PPTX
COMPUTER INSTRUCTIONS & TIMING & CONTROL.
PPTX
Register transfer language
PPTX
instruction cycle ppt
Restoring & Non-Restoring Division Algorithm By Sania Nisar
ADDRESSING MODES
Computer arithmetic
Addressing sequencing
bus and memory tranfer (computer organaization)
Control Units : Microprogrammed and Hardwired:control unit
Pipeline hazards in computer Architecture ppt
Unit 4-booth algorithm
Computer instructions
Cache memory
memory reference instruction
Design of Accumulator Unit
Instruction cycle
SOLUTION MANUAL OF COMPUTER ORGANIZATION BY CARL HAMACHER, ZVONKO VRANESIC & ...
Register organization, stack
General register organization (computer organization)
Instruction format
COMPUTER INSTRUCTIONS & TIMING & CONTROL.
Register transfer language
instruction cycle ppt
Ad

Similar to Addition and subtraction with signed magnitude data (mano (20)

PPTX
1.COMPUTER ARITHMETIC which is related to coa.pptx
PPTX
COA(Unit_3.pptx)
PDF
2.1COMPUTER ORG_ Computer Arithmetic.pdf
PDF
Computer arithmetic
PDF
N akkk4lmealkkk3eqklaflerkpwoerkwflskkes
PDF
Arithmatic Ch 10 (4).pdf
PPTX
Unit_3 OF COMPUTER ARCHITECTUREUnit.pptx
PDF
Ch_10.pptx.pdf
PDF
Unit-8-Computer-Arithmetic.pdf
PPT
computer arithmatic
PPTX
Computer organization algorithms like addition and subtraction and multiplica...
PPT
index of all of the financial accounts in a company's general ledger. In shor...
PPT
Computer Architecture refers to those attributes of a system that have a dire...
PPT
Hardware implementation for Addition and subtraction in Digital Hardware
PPTX
Computer arithmetics (computer organisation &amp; arithmetics) ppt
PPTX
CA UNIT II.pptx
PPTX
CS304PC:Computer Organization and Architecture Session 19 Addition and subtra...
PDF
Computer arithmetics coa project pdf version
PDF
COMPUTER ORGANIZATION NOTES Unit 6
PPTX
1.COMPUTER ARITHMETIC which is related to coa.pptx
COA(Unit_3.pptx)
2.1COMPUTER ORG_ Computer Arithmetic.pdf
Computer arithmetic
N akkk4lmealkkk3eqklaflerkpwoerkwflskkes
Arithmatic Ch 10 (4).pdf
Unit_3 OF COMPUTER ARCHITECTUREUnit.pptx
Ch_10.pptx.pdf
Unit-8-Computer-Arithmetic.pdf
computer arithmatic
Computer organization algorithms like addition and subtraction and multiplica...
index of all of the financial accounts in a company's general ledger. In shor...
Computer Architecture refers to those attributes of a system that have a dire...
Hardware implementation for Addition and subtraction in Digital Hardware
Computer arithmetics (computer organisation &amp; arithmetics) ppt
CA UNIT II.pptx
CS304PC:Computer Organization and Architecture Session 19 Addition and subtra...
Computer arithmetics coa project pdf version
COMPUTER ORGANIZATION NOTES Unit 6
Ad

More from cs19club (17)

PDF
Podd notes
PDF
Podd note 1
PDF
Podd mod6
DOC
Module 3
PDF
Ch05
PDF
Ch04
DOCX
Oodp extra2
DOCX
Oodp mod4
PPT
Module vi
PPTX
Module5 part2
PPT
Module 5 part1
PPT
Module4
PPTX
Io pro
PDF
Io pro
PPTX
Floating point arithmetic operations (1)
PPT
Coa module2
PPT
Coa module1
Podd notes
Podd note 1
Podd mod6
Module 3
Ch05
Ch04
Oodp extra2
Oodp mod4
Module vi
Module5 part2
Module 5 part1
Module4
Io pro
Io pro
Floating point arithmetic operations (1)
Coa module2
Coa module1

Recently uploaded (20)

PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
Basic Mud Logging Guide for educational purpose
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PPTX
Pharma ospi slides which help in ospi learning
PPTX
Cell Types and Its function , kingdom of life
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
Module 4: Burden of Disease Tutorial Slides S2 2025
VCE English Exam - Section C Student Revision Booklet
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Microbial disease of the cardiovascular and lymphatic systems
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
102 student loan defaulters named and shamed – Is someone you know on the list?
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Basic Mud Logging Guide for educational purpose
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Anesthesia in Laparoscopic Surgery in India
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Pharma ospi slides which help in ospi learning
Cell Types and Its function , kingdom of life
Renaissance Architecture: A Journey from Faith to Humanism
2.FourierTransform-ShortQuestionswithAnswers.pdf
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
O5-L3 Freight Transport Ops (International) V1.pdf

Addition and subtraction with signed magnitude data (mano

  • 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 CarryOutput 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.