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
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
Flowchart
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.
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.
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

What's hot

Weighted and Non Weighted Codes
Weighted and Non Weighted CodesWeighted and Non Weighted Codes
Weighted and Non Weighted Codes
SubhamSatpathy2
 
Computer organisation -morris mano
Computer organisation  -morris manoComputer organisation  -morris mano
Computer organisation -morris mano
vishnu murthy
 
Program control instructions
Program control instructionsProgram control instructions
Program control instructions
Dr. Girish GS
 
Register transfer language
Register transfer languageRegister transfer language
Register transfer language
Sanjeev Patel
 
Sorting
SortingSorting
Recognition-of-tokens
Recognition-of-tokensRecognition-of-tokens
Recognition-of-tokens
Dattatray Gandhmal
 
Demultiplexing of buses of 8085 microprocessor
Demultiplexing of buses of 8085 microprocessor Demultiplexing of buses of 8085 microprocessor
Demultiplexing of buses of 8085 microprocessor
Rajal Patel
 
State Space Representation and Search
State Space Representation and SearchState Space Representation and Search
State Space Representation and Search
Hitesh Mohapatra
 
Control Strategies in AI
Control Strategies in AIControl Strategies in AI
Control Strategies in AI
Amey Kerkar
 
bus and memory tranfer (computer organaization)
bus and memory tranfer (computer organaization)bus and memory tranfer (computer organaization)
bus and memory tranfer (computer organaization)
Siddhi Viradiya
 
Karnaugh map
Karnaugh mapKarnaugh map
Karnaugh map
Vanitha Chandru
 
Pipeline hazard
Pipeline hazardPipeline hazard
Pipeline hazard
AJAL A J
 
1.1. the central concepts of automata theory
1.1. the central concepts of automata theory1.1. the central concepts of automata theory
1.1. the central concepts of automata theory
Sampath Kumar S
 
Quadratic probing
Quadratic probingQuadratic probing
Quadratic probing
rajshreemuthiah
 
Generating code from dags
Generating code from dagsGenerating code from dags
Generating code from dags
indhu mathi
 
Instruction format
Instruction formatInstruction format
Instruction format
Sanjeev Patel
 
Multiplication algorithm, hardware and flowchart
Multiplication algorithm, hardware and flowchartMultiplication algorithm, hardware and flowchart
Multiplication algorithm, hardware and flowchart
Tanjarul Islam Mishu
 
Graph coloring using backtracking
Graph coloring using backtrackingGraph coloring using backtracking
Graph coloring using backtracking
shashidharPapishetty
 
Computer Organization and Architecture.
Computer Organization and Architecture.Computer Organization and Architecture.
Computer Organization and Architecture.
CS_GDRCST
 
Multiplication algorithm
Multiplication algorithmMultiplication algorithm
Multiplication algorithm
Gaurav Subham
 

What's hot (20)

Weighted and Non Weighted Codes
Weighted and Non Weighted CodesWeighted and Non Weighted Codes
Weighted and Non Weighted Codes
 
Computer organisation -morris mano
Computer organisation  -morris manoComputer organisation  -morris mano
Computer organisation -morris mano
 
Program control instructions
Program control instructionsProgram control instructions
Program control instructions
 
Register transfer language
Register transfer languageRegister transfer language
Register transfer language
 
Sorting
SortingSorting
Sorting
 
Recognition-of-tokens
Recognition-of-tokensRecognition-of-tokens
Recognition-of-tokens
 
Demultiplexing of buses of 8085 microprocessor
Demultiplexing of buses of 8085 microprocessor Demultiplexing of buses of 8085 microprocessor
Demultiplexing of buses of 8085 microprocessor
 
State Space Representation and Search
State Space Representation and SearchState Space Representation and Search
State Space Representation and Search
 
Control Strategies in AI
Control Strategies in AIControl Strategies in AI
Control Strategies in AI
 
bus and memory tranfer (computer organaization)
bus and memory tranfer (computer organaization)bus and memory tranfer (computer organaization)
bus and memory tranfer (computer organaization)
 
Karnaugh map
Karnaugh mapKarnaugh map
Karnaugh map
 
Pipeline hazard
Pipeline hazardPipeline hazard
Pipeline hazard
 
1.1. the central concepts of automata theory
1.1. the central concepts of automata theory1.1. the central concepts of automata theory
1.1. the central concepts of automata theory
 
Quadratic probing
Quadratic probingQuadratic probing
Quadratic probing
 
Generating code from dags
Generating code from dagsGenerating code from dags
Generating code from dags
 
Instruction format
Instruction formatInstruction format
Instruction format
 
Multiplication algorithm, hardware and flowchart
Multiplication algorithm, hardware and flowchartMultiplication algorithm, hardware and flowchart
Multiplication algorithm, hardware and flowchart
 
Graph coloring using backtracking
Graph coloring using backtrackingGraph coloring using backtracking
Graph coloring using backtracking
 
Computer Organization and Architecture.
Computer Organization and Architecture.Computer Organization and Architecture.
Computer Organization and Architecture.
 
Multiplication algorithm
Multiplication algorithmMultiplication algorithm
Multiplication algorithm
 

Similar to Addition and subtraction with signed magnitude data (mano

Computer arithmetic
Computer arithmeticComputer arithmetic
Computer arithmetic
Usiju Gadzama
 
Computer Architecture refers to those attributes of a system that have a dire...
Computer Architecture refers to those attributes of a system that have a dire...Computer Architecture refers to those attributes of a system that have a dire...
Computer Architecture refers to those attributes of a system that have a dire...
mayurjagdale4
 
index of all of the financial accounts in a company's general ledger. In shor...
index of all of the financial accounts in a company's general ledger. In shor...index of all of the financial accounts in a company's general ledger. In shor...
index of all of the financial accounts in a company's general ledger. In shor...
mayurjagdale4
 
computer arithmatic
computer arithmaticcomputer arithmatic
computer arithmatic
mahesh kumar prajapat
 
Computer organization and architecture lab manual
Computer organization and architecture lab manual Computer organization and architecture lab manual
Computer organization and architecture lab manual
Shankar Gangaju
 
Unit-8-Computer-Arithmetic.pdf
Unit-8-Computer-Arithmetic.pdfUnit-8-Computer-Arithmetic.pdf
Unit-8-Computer-Arithmetic.pdf
GafryMahmoud
 
COA(Unit_3.pptx)
COA(Unit_3.pptx)COA(Unit_3.pptx)
COA(Unit_3.pptx)
Thapar Institute
 
Arithmetic Logic
Arithmetic LogicArithmetic Logic
Arithmetic Logic
janani thirupathi
 
Comp Arithmetic Basic.ppt
Comp Arithmetic Basic.pptComp Arithmetic Basic.ppt
Comp Arithmetic Basic.ppt
skatiarrahaman
 
Computer organization algorithms like addition and subtraction and multiplica...
Computer organization algorithms like addition and subtraction and multiplica...Computer organization algorithms like addition and subtraction and multiplica...
Computer organization algorithms like addition and subtraction and multiplica...
michaelaaron25322
 
Implementation and Simulation of Ieee 754 Single-Precision Floating Point Mul...
Implementation and Simulation of Ieee 754 Single-Precision Floating Point Mul...Implementation and Simulation of Ieee 754 Single-Precision Floating Point Mul...
Implementation and Simulation of Ieee 754 Single-Precision Floating Point Mul...
inventionjournals
 
105_2_digitalSystem_Chap_3_part_3.ppt
105_2_digitalSystem_Chap_3_part_3.ppt105_2_digitalSystem_Chap_3_part_3.ppt
105_2_digitalSystem_Chap_3_part_3.ppt
Jeanie Delos Arcos
 
Arithmetic Operations
Arithmetic OperationsArithmetic Operations
Arithmetic Operations
gueste99d9a
 
Arithmetic Process in Computer Systems
Arithmetic Process in Computer SystemsArithmetic Process in Computer Systems
Arithmetic Process in Computer Systems
S N M P Simamora
 
ArithmeticCircuits.Ivy Nile vs. Rhea Ripley
ArithmeticCircuits.Ivy Nile vs. Rhea RipleyArithmeticCircuits.Ivy Nile vs. Rhea Ripley
ArithmeticCircuits.Ivy Nile vs. Rhea Ripley
RudraBhai3
 
Encoding Schemes for Multipliers
Encoding Schemes for MultipliersEncoding Schemes for Multipliers
Encoding Schemes for Multipliers
Silicon Mentor
 
COMPUTER ORGANIZATION NOTES Unit 6
COMPUTER ORGANIZATION NOTES Unit 6COMPUTER ORGANIZATION NOTES Unit 6
COMPUTER ORGANIZATION NOTES Unit 6
Dr.MAYA NAYAK
 
100_2_digitalSystem_Chap1 (2).ppt
100_2_digitalSystem_Chap1 (2).ppt100_2_digitalSystem_Chap1 (2).ppt
100_2_digitalSystem_Chap1 (2).ppt
namraashraf56
 
Unit ii ca--arithmetic
Unit ii ca--arithmeticUnit ii ca--arithmetic
Unit ii ca--arithmetic
Praba haran
 

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

Computer arithmetic
Computer arithmeticComputer arithmetic
Computer arithmetic
 
Computer Architecture refers to those attributes of a system that have a dire...
Computer Architecture refers to those attributes of a system that have a dire...Computer Architecture refers to those attributes of a system that have a dire...
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...
index of all of the financial accounts in a company's general ledger. In shor...index of all of the financial accounts in a company's general ledger. In shor...
index of all of the financial accounts in a company's general ledger. In shor...
 
computer arithmatic
computer arithmaticcomputer arithmatic
computer arithmatic
 
Computer organization and architecture lab manual
Computer organization and architecture lab manual Computer organization and architecture lab manual
Computer organization and architecture lab manual
 
Unit-8-Computer-Arithmetic.pdf
Unit-8-Computer-Arithmetic.pdfUnit-8-Computer-Arithmetic.pdf
Unit-8-Computer-Arithmetic.pdf
 
COA(Unit_3.pptx)
COA(Unit_3.pptx)COA(Unit_3.pptx)
COA(Unit_3.pptx)
 
Arithmetic Logic
Arithmetic LogicArithmetic Logic
Arithmetic Logic
 
Comp Arithmetic Basic.ppt
Comp Arithmetic Basic.pptComp Arithmetic Basic.ppt
Comp Arithmetic Basic.ppt
 
Computer organization algorithms like addition and subtraction and multiplica...
Computer organization algorithms like addition and subtraction and multiplica...Computer organization algorithms like addition and subtraction and multiplica...
Computer organization algorithms like addition and subtraction and multiplica...
 
Implementation and Simulation of Ieee 754 Single-Precision Floating Point Mul...
Implementation and Simulation of Ieee 754 Single-Precision Floating Point Mul...Implementation and Simulation of Ieee 754 Single-Precision Floating Point Mul...
Implementation and Simulation of Ieee 754 Single-Precision Floating Point Mul...
 
105_2_digitalSystem_Chap_3_part_3.ppt
105_2_digitalSystem_Chap_3_part_3.ppt105_2_digitalSystem_Chap_3_part_3.ppt
105_2_digitalSystem_Chap_3_part_3.ppt
 
Lec20
Lec20Lec20
Lec20
 
Arithmetic Operations
Arithmetic OperationsArithmetic Operations
Arithmetic Operations
 
Arithmetic Process in Computer Systems
Arithmetic Process in Computer SystemsArithmetic Process in Computer Systems
Arithmetic Process in Computer Systems
 
ArithmeticCircuits.Ivy Nile vs. Rhea Ripley
ArithmeticCircuits.Ivy Nile vs. Rhea RipleyArithmeticCircuits.Ivy Nile vs. Rhea Ripley
ArithmeticCircuits.Ivy Nile vs. Rhea Ripley
 
Encoding Schemes for Multipliers
Encoding Schemes for MultipliersEncoding Schemes for Multipliers
Encoding Schemes for Multipliers
 
COMPUTER ORGANIZATION NOTES Unit 6
COMPUTER ORGANIZATION NOTES Unit 6COMPUTER ORGANIZATION NOTES Unit 6
COMPUTER ORGANIZATION NOTES Unit 6
 
100_2_digitalSystem_Chap1 (2).ppt
100_2_digitalSystem_Chap1 (2).ppt100_2_digitalSystem_Chap1 (2).ppt
100_2_digitalSystem_Chap1 (2).ppt
 
Unit ii ca--arithmetic
Unit ii ca--arithmeticUnit ii ca--arithmetic
Unit ii ca--arithmetic
 

More from cs19club

Podd notes
Podd notesPodd notes
Podd notes
cs19club
 
Podd note 1
Podd note 1Podd note 1
Podd note 1
cs19club
 
Podd mod6
Podd mod6Podd mod6
Podd mod6
cs19club
 
Module 3
Module 3Module 3
Module 3
cs19club
 
Ch05
Ch05Ch05
Ch05
cs19club
 
Ch04
Ch04Ch04
Ch04
cs19club
 
Oodp extra2
Oodp extra2Oodp extra2
Oodp extra2
cs19club
 
Oodp mod4
Oodp mod4Oodp mod4
Oodp mod4
cs19club
 
Module vi
Module viModule vi
Module vi
cs19club
 
Module5 part2
Module5 part2Module5 part2
Module5 part2
cs19club
 
Module 5 part1
Module 5 part1Module 5 part1
Module 5 part1
cs19club
 
Module4
Module4Module4
Module4
cs19club
 
Io pro
Io proIo pro
Io pro
cs19club
 
Io pro
Io proIo pro
Io pro
cs19club
 
Coa module2
Coa module2Coa module2
Coa module2
cs19club
 
Coa module1
Coa module1Coa module1
Coa module1
cs19club
 

More from cs19club (16)

Podd notes
Podd notesPodd notes
Podd notes
 
Podd note 1
Podd note 1Podd note 1
Podd note 1
 
Podd mod6
Podd mod6Podd mod6
Podd mod6
 
Module 3
Module 3Module 3
Module 3
 
Ch05
Ch05Ch05
Ch05
 
Ch04
Ch04Ch04
Ch04
 
Oodp extra2
Oodp extra2Oodp extra2
Oodp extra2
 
Oodp mod4
Oodp mod4Oodp mod4
Oodp mod4
 
Module vi
Module viModule vi
Module vi
 
Module5 part2
Module5 part2Module5 part2
Module5 part2
 
Module 5 part1
Module 5 part1Module 5 part1
Module 5 part1
 
Module4
Module4Module4
Module4
 
Io pro
Io proIo pro
Io pro
 
Io pro
Io proIo pro
Io pro
 
Coa module2
Coa module2Coa module2
Coa module2
 
Coa module1
Coa module1Coa module1
Coa module1
 

Recently uploaded

Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
AzmatAli747758
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
PedroFerreira53928
 
How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative Thoughts
Col Mukteshwar Prasad
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)
rosedainty
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
Celine George
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
PedroFerreira53928
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
EduSkills OECD
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 

Recently uploaded (20)

Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
 
How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative Thoughts
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.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
  • 17.
  • 18.
  • 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
  • 20.
  • 21.
  • 23.
  • 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.
  • 30.
  • 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.
  • 33.
  • 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.