SlideShare a Scribd company logo
1 of 15
DATA REPRESENTATION
ARITHMETIC & LOGIC UNIT
 Does the calculations
 Everything else in the computer is there to
service this unit
 Handles integers
 May handle floating point numbers
 May be separate FPU
ALU INPUTS AND OUTPUTS
INTEGER REPRESENTATION
 Only have binary digits (0 & 1) to represent
numbers.
 Positive numbers stored in binary
 e.g. 41=00101001
 Sign-Magnitude
 Two’s compliment
An 8 -bit word can represent the numbers from
0 to 255,including
00000000 = 0
00000001 = 1
00101001 = 41
10000000 = 128
11111111 = 255
If an n-bit sequence of binary digits an-1an-2…a1a0 is
interpreted as an unsigned integer A, its value is
A= i
n
i
i
a



1
0
2
SIGN-MAGNITUDE
 Left most bit is sign bit
 0 means positive
 1 means negative
 If there are n bits, then rightmost n-1 bits hold the magnitude of
the integer.
 +18 = 00010010
 -18 = 10010010
 Problems
 Need to consider both sign and magnitude in
arithmetic
 Two representations of zero (+0 and -0)
(e.g) +010 =00000000
-010 =10000000
CHARACTERISTICS OF TWOS COMPLEMENT
REPRESENTATION AND ARITHMETIC
BENEFITS
 One representation of zero
 Arithmetic works easily
 Negating is fairly easy
 3 = 00000011
 Boolean complement gives 11111100
 Add 1 to LSB gives 11111101
VALUE BOX FOR CONVERSION BETWEEN
TWOS COMPLEMENT BINARY AND DECIMAL
SOLUTION
Move the sign bit to the new leftmost position and fill in with
copies of the sign bit.(Sign Extension)
-18 = 11101110(twos complement,8 bits)
-18 = 1111111111101110(twos complement,16 bits)
NEGATION
Rules:
1) Take the Boolean complement of each bit of the
integer.(including the sign bit)
2) Treating the result as an unsigned binary integer , add
1.
Eg) +18 = 00010010
bitwise complement = 11101101
1 +
11101110 = -18
NEGATION SPECIAL CASE 1
 0 = 00000000
 Bitwise not 11111111
 Add 1 to LSB +1
 Result 1 00000000
 Overflow is ignored, so:
 - 0 = 0
NEGATION SPECIAL CASE 2
 -128 = 10000000
 bitwise not 01111111
 Add 1 to LSB +1
 Result 10000000
 So:
 -(-128) = -128

More Related Content

Similar to Data Representation.pptx

3.Fixed-Floating Point.ppt
3.Fixed-Floating Point.ppt3.Fixed-Floating Point.ppt
3.Fixed-Floating Point.pptRavikumarR77
 
Arithmetic logic units
Arithmetic logic unitsArithmetic logic units
Arithmetic logic unitsowaisahmad125
 
Chapter 2_Number system (EEEg4302).pdf
Chapter 2_Number system (EEEg4302).pdfChapter 2_Number system (EEEg4302).pdf
Chapter 2_Number system (EEEg4302).pdfTamiratDejene1
 
09 arithmetic
09 arithmetic09 arithmetic
09 arithmeticargiaggi
 
Lecture 06 computer arithmatic
Lecture 06 computer arithmaticLecture 06 computer arithmatic
Lecture 06 computer arithmaticObaidur Rahman
 
Mba admission in india
Mba admission in indiaMba admission in india
Mba admission in indiaEdhole.com
 
Akash Saha CSE 33 ADEpptx.pptx
Akash Saha CSE 33 ADEpptx.pptxAkash Saha CSE 33 ADEpptx.pptx
Akash Saha CSE 33 ADEpptx.pptxAkashSaha816377
 
Working With Binary Numbers
Working With Binary NumbersWorking With Binary Numbers
Working With Binary Numbersadil raja
 
1. NUMBER SYSTEM.pptx Computer Applications in Pharmacy
1. NUMBER SYSTEM.pptx Computer Applications in Pharmacy1. NUMBER SYSTEM.pptx Computer Applications in Pharmacy
1. NUMBER SYSTEM.pptx Computer Applications in PharmacyVedika Narvekar
 
Convertion of single precision
Convertion of single precisionConvertion of single precision
Convertion of single precisionnikhilarora2211
 
Data representation and Arithmetic Algorithms
Data representation and Arithmetic AlgorithmsData representation and Arithmetic Algorithms
Data representation and Arithmetic AlgorithmsMumthas Shaikh
 
1’s and 2’s complements
1’s and 2’s complements1’s and 2’s complements
1’s and 2’s complementsarunachalamr16
 
Chapter 2 Data Representation on CPU (part 1)
Chapter 2 Data Representation on CPU (part 1)Chapter 2 Data Representation on CPU (part 1)
Chapter 2 Data Representation on CPU (part 1)Frankie Jones
 

Similar to Data Representation.pptx (20)

3.Fixed-Floating Point.ppt
3.Fixed-Floating Point.ppt3.Fixed-Floating Point.ppt
3.Fixed-Floating Point.ppt
 
Arithmetic logic units
Arithmetic logic unitsArithmetic logic units
Arithmetic logic units
 
Chapter 2_Number system (EEEg4302).pdf
Chapter 2_Number system (EEEg4302).pdfChapter 2_Number system (EEEg4302).pdf
Chapter 2_Number system (EEEg4302).pdf
 
CA UNIT II.pptx
CA UNIT II.pptxCA UNIT II.pptx
CA UNIT II.pptx
 
Arithmetic unit.ppt
Arithmetic unit.pptArithmetic unit.ppt
Arithmetic unit.ppt
 
09 arithmetic
09 arithmetic09 arithmetic
09 arithmetic
 
09 arithmetic 2
09 arithmetic 209 arithmetic 2
09 arithmetic 2
 
Representation of Negative Numbers
Representation of Negative NumbersRepresentation of Negative Numbers
Representation of Negative Numbers
 
09 arithmetic
09 arithmetic09 arithmetic
09 arithmetic
 
Lecture 06 computer arithmatic
Lecture 06 computer arithmaticLecture 06 computer arithmatic
Lecture 06 computer arithmatic
 
Mba admission in india
Mba admission in indiaMba admission in india
Mba admission in india
 
Akash Saha CSE 33 ADEpptx.pptx
Akash Saha CSE 33 ADEpptx.pptxAkash Saha CSE 33 ADEpptx.pptx
Akash Saha CSE 33 ADEpptx.pptx
 
Number system
Number systemNumber system
Number system
 
Number system
Number systemNumber system
Number system
 
Working With Binary Numbers
Working With Binary NumbersWorking With Binary Numbers
Working With Binary Numbers
 
1. NUMBER SYSTEM.pptx Computer Applications in Pharmacy
1. NUMBER SYSTEM.pptx Computer Applications in Pharmacy1. NUMBER SYSTEM.pptx Computer Applications in Pharmacy
1. NUMBER SYSTEM.pptx Computer Applications in Pharmacy
 
Convertion of single precision
Convertion of single precisionConvertion of single precision
Convertion of single precision
 
Data representation and Arithmetic Algorithms
Data representation and Arithmetic AlgorithmsData representation and Arithmetic Algorithms
Data representation and Arithmetic Algorithms
 
1’s and 2’s complements
1’s and 2’s complements1’s and 2’s complements
1’s and 2’s complements
 
Chapter 2 Data Representation on CPU (part 1)
Chapter 2 Data Representation on CPU (part 1)Chapter 2 Data Representation on CPU (part 1)
Chapter 2 Data Representation on CPU (part 1)
 

More from nivedita murugan

More from nivedita murugan (7)

HTML_Forms_.ppt
HTML_Forms_.pptHTML_Forms_.ppt
HTML_Forms_.ppt
 
Types of Memory.ppt
Types of Memory.pptTypes of Memory.ppt
Types of Memory.ppt
 
Number_Systems (2).ppt
Number_Systems (2).pptNumber_Systems (2).ppt
Number_Systems (2).ppt
 
performance evaluation of parallel processors.pptx
performance evaluation of parallel processors.pptxperformance evaluation of parallel processors.pptx
performance evaluation of parallel processors.pptx
 
Function Overloading.ppt
Function Overloading.pptFunction Overloading.ppt
Function Overloading.ppt
 
constructor.ppt
constructor.pptconstructor.ppt
constructor.ppt
 
Performance of processor.ppt
Performance of processor.pptPerformance of processor.ppt
Performance of processor.ppt
 

Recently uploaded

Learn the concepts of Thermodynamics on Magic Marks
Learn the concepts of Thermodynamics on Magic MarksLearn the concepts of Thermodynamics on Magic Marks
Learn the concepts of Thermodynamics on Magic MarksMagic Marks
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"mphochane1998
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.Kamal Acharya
 
Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)Ramkumar k
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Call Girls Mumbai
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesMayuraD1
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdfKamal Acharya
 
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
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsvanyagupta248
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...HenryBriggs2
 
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptxOrlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptxMuhammadAsimMuhammad6
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfJiananWang21
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdfAldoGarca30
 
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...Amil baba
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startQuintin Balsdon
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdfKamal Acharya
 
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)
 
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
 
Moment Distribution Method For Btech Civil
Moment Distribution Method For Btech CivilMoment Distribution Method For Btech Civil
Moment Distribution Method For Btech CivilVinayVitekari
 

Recently uploaded (20)

Learn the concepts of Thermodynamics on Magic Marks
Learn the concepts of Thermodynamics on Magic MarksLearn the concepts of Thermodynamics on Magic Marks
Learn the concepts of Thermodynamics on Magic Marks
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
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
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech students
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
 
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptxOrlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
 
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
 
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...
 
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
 
Moment Distribution Method For Btech Civil
Moment Distribution Method For Btech CivilMoment Distribution Method For Btech Civil
Moment Distribution Method For Btech Civil
 

Data Representation.pptx

  • 2. ARITHMETIC & LOGIC UNIT  Does the calculations  Everything else in the computer is there to service this unit  Handles integers  May handle floating point numbers  May be separate FPU
  • 3. ALU INPUTS AND OUTPUTS
  • 4. INTEGER REPRESENTATION  Only have binary digits (0 & 1) to represent numbers.  Positive numbers stored in binary  e.g. 41=00101001  Sign-Magnitude  Two’s compliment
  • 5. An 8 -bit word can represent the numbers from 0 to 255,including 00000000 = 0 00000001 = 1 00101001 = 41 10000000 = 128 11111111 = 255 If an n-bit sequence of binary digits an-1an-2…a1a0 is interpreted as an unsigned integer A, its value is A= i n i i a    1 0 2
  • 6. SIGN-MAGNITUDE  Left most bit is sign bit  0 means positive  1 means negative  If there are n bits, then rightmost n-1 bits hold the magnitude of the integer.  +18 = 00010010  -18 = 10010010
  • 7.  Problems  Need to consider both sign and magnitude in arithmetic  Two representations of zero (+0 and -0) (e.g) +010 =00000000 -010 =10000000
  • 8. CHARACTERISTICS OF TWOS COMPLEMENT REPRESENTATION AND ARITHMETIC
  • 9. BENEFITS  One representation of zero  Arithmetic works easily  Negating is fairly easy  3 = 00000011  Boolean complement gives 11111100  Add 1 to LSB gives 11111101
  • 10. VALUE BOX FOR CONVERSION BETWEEN TWOS COMPLEMENT BINARY AND DECIMAL
  • 11.
  • 12. SOLUTION Move the sign bit to the new leftmost position and fill in with copies of the sign bit.(Sign Extension) -18 = 11101110(twos complement,8 bits) -18 = 1111111111101110(twos complement,16 bits)
  • 13. NEGATION Rules: 1) Take the Boolean complement of each bit of the integer.(including the sign bit) 2) Treating the result as an unsigned binary integer , add 1. Eg) +18 = 00010010 bitwise complement = 11101101 1 + 11101110 = -18
  • 14. NEGATION SPECIAL CASE 1  0 = 00000000  Bitwise not 11111111  Add 1 to LSB +1  Result 1 00000000  Overflow is ignored, so:  - 0 = 0
  • 15. NEGATION SPECIAL CASE 2  -128 = 10000000  bitwise not 01111111  Add 1 to LSB +1  Result 10000000  So:  -(-128) = -128