SlideShare uma empresa Scribd logo
1 de 12
UNIT - 2
Arithmetic Unit
Table of Contents
 Addition and subtraction of signed numbers
 Design of fast adders
 Multiplication of positive numbers
 Signed operand multiplication,
 Fast multiplication- Bit pair recoding of Multipliers,
 Carry Save Addition of summands
 Integer division – Restoring Division and Non
Restoring Division
 Floating point numbers and operations
Integer Representation
• Only have 0 & 1 to represent everything
• Positive numbers stored in binary
– e.g. 41=00101001
• No minus sign
• No period
• Sign-Magnitude
• One's Complement
• Two’s compliment
• Sign Magnitude: One's Complement Two's
Complement
000 = +0 000 = +0 000 = +0
001 = +1 001 = +1 001 = +1
010 = +2 010 = +2 010 = +2
011 = +3 011 = +3 011 = +3
100 = -0 100 = -3 100 = -4
101 = -1 101 = -2 101 = -3
110 = -2 110 = -1 110 = -2
111 = -3 111 = -0 111 = -1
• Issues: balance, number of zeros, ease of operations
• Which one is best? Why?
Integer Representation (cont’d)
• Negating a two's complement number: invert all bits and
add 1
– remember: “negate” and “invert” are quite different!
• Converting n bit numbers into numbers with more than n
bits:
– MIPS 16 bit immediate gets converted to 32 bits for arithmetic
– copy the most significant bit (the sign bit) into the other bits
0010 -> 0000 0010
1010 -> 1111 1010
– "sign extension" (lbu vs. lb)
Two's Complement Operations
Signed and unsigned additions
• Unsigned addition
in 4-bit arithmetic
( carry) 11_
1011
+ 0011
1110
• 11 + 3 = 14
(8 + 4 + 2)
• Signed addition in
4-bit arithmetic
( carry) 11_
1011
+ 0011
1110
• -5 + 3 = -2
Signed and unsigned additions
• Same rules apply even though bit strings
represent different values
• Sole difference is overflow handling
Sign-Magnitude
• Left most bit is sign bit
• 0 means positive
• 1 means negative
• +18 = 00010010
• -18 = 10010010
• Problems
– Need to consider both sign and magnitude in
arithmetic
– Two representations of zero (+0 and -0)
Range of Numbers
• 8 bit 2s compliment
– +127 = 01111111 = 27 -1
– -128 = 10000000 = -27
• 16 bit 2s compliment
– +32767 = 011111111 11111111 = 215 - 1
– -32768 = 100000000 00000000 = -215
Conversion Between Lengths
• Positive number pack with leading zeros
• +18 = 00010010
• +18 = 00000000 00010010
• Negative numbers pack with leading ones
• -18 = 10010010
• -18 = 11111111 10010010
• i.e. pack with MSB (sign bit)
Addition and Subtraction
• Normal binary addition
• Monitor sign bit for overflow
• Take twos compliment of substahend and add
to minuend
– i.e. a - b = a + (-b)
• So we only need addition and complement
circuits
Hardware for Addition and
Subtraction

Mais conteúdo relacionado

Semelhante a Arithmetic unit.ppt

Lecture 06 computer arithmatic
Lecture 06 computer arithmaticLecture 06 computer arithmatic
Lecture 06 computer arithmaticObaidur Rahman
 
Chapter 2_Number system (EEEg4302).pdf
Chapter 2_Number system (EEEg4302).pdfChapter 2_Number system (EEEg4302).pdf
Chapter 2_Number system (EEEg4302).pdfTamiratDejene1
 
Number system
Number systemNumber system
Number systemaviban
 
Number Representation and Arithmetic Operations.pptx
 Number Representation and Arithmetic Operations.pptx Number Representation and Arithmetic Operations.pptx
Number Representation and Arithmetic Operations.pptxLikithaK8
 
UNIT - I.pptx
UNIT - I.pptxUNIT - I.pptx
UNIT - I.pptxamudhak10
 
UNIT - I.pptx
UNIT - I.pptxUNIT - I.pptx
UNIT - I.pptxamudhak10
 
Digital fundamendals r001a
Digital fundamendals r001aDigital fundamendals r001a
Digital fundamendals r001aarunachalamr16
 
BOOTH ALGO, DIVISION(RESTORING _ NON RESTORING) etc etc
BOOTH ALGO, DIVISION(RESTORING _ NON RESTORING) etc etcBOOTH ALGO, DIVISION(RESTORING _ NON RESTORING) etc etc
BOOTH ALGO, DIVISION(RESTORING _ NON RESTORING) etc etcAbhishek Rajpoot
 
Chapter 02 Data Types
Chapter 02   Data TypesChapter 02   Data Types
Chapter 02 Data TypesNathan Yeung
 
Number system utm notes
Number system utm notesNumber system utm notes
Number system utm notesKurenai Ryu
 

Semelhante a Arithmetic unit.ppt (20)

Alu1
Alu1Alu1
Alu1
 
CA Unit ii
CA Unit iiCA Unit ii
CA Unit ii
 
09 arithmetic
09 arithmetic09 arithmetic
09 arithmetic
 
ARITHMETIC FOR COMPUTERS
ARITHMETIC FOR COMPUTERS	  ARITHMETIC FOR COMPUTERS
ARITHMETIC FOR COMPUTERS
 
Lecture 06 computer arithmatic
Lecture 06 computer arithmaticLecture 06 computer arithmatic
Lecture 06 computer arithmatic
 
CA UNIT II.pptx
CA UNIT II.pptxCA UNIT II.pptx
CA UNIT II.pptx
 
Chapter 2_Number system (EEEg4302).pdf
Chapter 2_Number system (EEEg4302).pdfChapter 2_Number system (EEEg4302).pdf
Chapter 2_Number system (EEEg4302).pdf
 
Number system
Number systemNumber system
Number system
 
Number Representation and Arithmetic Operations.pptx
 Number Representation and Arithmetic Operations.pptx Number Representation and Arithmetic Operations.pptx
Number Representation and Arithmetic Operations.pptx
 
3810-08.ppt
3810-08.ppt3810-08.ppt
3810-08.ppt
 
UNIT - I.pptx
UNIT - I.pptxUNIT - I.pptx
UNIT - I.pptx
 
UNIT - I.pptx
UNIT - I.pptxUNIT - I.pptx
UNIT - I.pptx
 
Digital fundamendals r001a
Digital fundamendals r001aDigital fundamendals r001a
Digital fundamendals r001a
 
BOOTH ALGO, DIVISION(RESTORING _ NON RESTORING) etc etc
BOOTH ALGO, DIVISION(RESTORING _ NON RESTORING) etc etcBOOTH ALGO, DIVISION(RESTORING _ NON RESTORING) etc etc
BOOTH ALGO, DIVISION(RESTORING _ NON RESTORING) etc etc
 
Data Representation.pptx
Data Representation.pptxData Representation.pptx
Data Representation.pptx
 
Chapter 02 Data Types
Chapter 02   Data TypesChapter 02   Data Types
Chapter 02 Data Types
 
Number system
Number systemNumber system
Number system
 
digitalelectronics.ppt
digitalelectronics.pptdigitalelectronics.ppt
digitalelectronics.ppt
 
Number system utm notes
Number system utm notesNumber system utm notes
Number system utm notes
 
number system.ppt
number system.pptnumber system.ppt
number system.ppt
 

Último

Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdfKamal Acharya
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptxJIT KUMAR GUPTA
 
Air Compressor reciprocating single stage
Air Compressor reciprocating single stageAir Compressor reciprocating single stage
Air Compressor reciprocating single stageAbc194748
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdfKamal Acharya
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwaitjaanualu31
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptDineshKumar4165
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxSCMS School of Architecture
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationBhangaleSonal
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptNANDHAKUMARA10
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network DevicesChandrakantDivate1
 
Bridge Jacking Design Sample Calculation.pptx
Bridge Jacking Design Sample Calculation.pptxBridge Jacking Design Sample Calculation.pptx
Bridge Jacking Design Sample Calculation.pptxnuruddin69
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityMorshed Ahmed Rahath
 
Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersMairaAshraf6
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXssuser89054b
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTbhaskargani46
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapRishantSharmaFr
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Arindam Chakraborty, Ph.D., P.E. (CA, TX)
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptMsecMca
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdfKamal Acharya
 

Último (20)

Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
Air Compressor reciprocating single stage
Air Compressor reciprocating single stageAir Compressor reciprocating single stage
Air Compressor reciprocating single stage
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdf
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network Devices
 
Bridge Jacking Design Sample Calculation.pptx
Bridge Jacking Design Sample Calculation.pptxBridge Jacking Design Sample Calculation.pptx
Bridge Jacking Design Sample Calculation.pptx
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to Computers
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdf
 

Arithmetic unit.ppt

  • 2. Table of Contents  Addition and subtraction of signed numbers  Design of fast adders  Multiplication of positive numbers  Signed operand multiplication,  Fast multiplication- Bit pair recoding of Multipliers,  Carry Save Addition of summands  Integer division – Restoring Division and Non Restoring Division  Floating point numbers and operations
  • 3. Integer Representation • Only have 0 & 1 to represent everything • Positive numbers stored in binary – e.g. 41=00101001 • No minus sign • No period • Sign-Magnitude • One's Complement • Two’s compliment
  • 4. • Sign Magnitude: One's Complement Two's Complement 000 = +0 000 = +0 000 = +0 001 = +1 001 = +1 001 = +1 010 = +2 010 = +2 010 = +2 011 = +3 011 = +3 011 = +3 100 = -0 100 = -3 100 = -4 101 = -1 101 = -2 101 = -3 110 = -2 110 = -1 110 = -2 111 = -3 111 = -0 111 = -1 • Issues: balance, number of zeros, ease of operations • Which one is best? Why? Integer Representation (cont’d)
  • 5. • Negating a two's complement number: invert all bits and add 1 – remember: “negate” and “invert” are quite different! • Converting n bit numbers into numbers with more than n bits: – MIPS 16 bit immediate gets converted to 32 bits for arithmetic – copy the most significant bit (the sign bit) into the other bits 0010 -> 0000 0010 1010 -> 1111 1010 – "sign extension" (lbu vs. lb) Two's Complement Operations
  • 6. Signed and unsigned additions • Unsigned addition in 4-bit arithmetic ( carry) 11_ 1011 + 0011 1110 • 11 + 3 = 14 (8 + 4 + 2) • Signed addition in 4-bit arithmetic ( carry) 11_ 1011 + 0011 1110 • -5 + 3 = -2
  • 7. Signed and unsigned additions • Same rules apply even though bit strings represent different values • Sole difference is overflow handling
  • 8. Sign-Magnitude • Left most bit is sign bit • 0 means positive • 1 means negative • +18 = 00010010 • -18 = 10010010 • Problems – Need to consider both sign and magnitude in arithmetic – Two representations of zero (+0 and -0)
  • 9. Range of Numbers • 8 bit 2s compliment – +127 = 01111111 = 27 -1 – -128 = 10000000 = -27 • 16 bit 2s compliment – +32767 = 011111111 11111111 = 215 - 1 – -32768 = 100000000 00000000 = -215
  • 10. Conversion Between Lengths • Positive number pack with leading zeros • +18 = 00010010 • +18 = 00000000 00010010 • Negative numbers pack with leading ones • -18 = 10010010 • -18 = 11111111 10010010 • i.e. pack with MSB (sign bit)
  • 11. Addition and Subtraction • Normal binary addition • Monitor sign bit for overflow • Take twos compliment of substahend and add to minuend – i.e. a - b = a + (-b) • So we only need addition and complement circuits
  • 12. Hardware for Addition and Subtraction