SlideShare a Scribd company logo
1 of 17
Real Numbers & Integers
All numbers belong to the set or group called real numbers.
Inside the set of real numbers is a set of all positive and negative whole numbers.
This set is called integers.
Real numbers
-4.6
2.46
13.7
Integers
0
-7
5
221
-31
100.052
-52.414
0.0014
Signed Bit Representation
The simplest way of representing a negative number in binary is to
use the first bit of the number to represent whether the number is
positive or negative:
011 = 3
111 = -3
This is known as signed bit representation.
Signed Bit Representation
The simplest way of representing a negative number in binary is to
use the first bit of the number to represent whether the number is
positive or negative:
011 = 3
111 = -3
This is known as signed bit representation.
The problem with signed bit representation is that there are 2
values for zero:
000 = 0
100 = -0
Two’s Complement Representation
A better way of representing negative numbers in binary is by using Two’s
Complement.
Two’s Complement is designed so that:
Binary Decimal
11111101 -3
11111110 -2
11111111 -1
00000000 0
00000001 1
00000010 2
00000011 3
1. the set of integers show symmetry about zero
Two’s Complement Representation
Two’s complement is designed so that:
00000010
+ 1
00000011
2. adding 1 to any number produces the next number (ignoring carry bits)
Two’s Complement Representation
To find the Two’s Complement of a number (its opposite sign):
1. Change all the 1’s to 0 and 0’s to 1.
2. Add 1.
Two’s Complement Representation
For example, how would -5 be represented using Two’s
Complement?
5 = 000000101
1. Change all the 1’s to 0 and 0’s to 1.
11111010
Two’s Complement Representation
For example, how would -5 be represented using Two’s
Complement?
5 = 000000101
1. Change all the 1’s to 0 and 0’s to 1.
11111010
2. Add 1.
11111010
+1
11111011
So -5 as Two’s Complement = 11111011
Two’s Complement Representation
Example 2 - find the Two’s Complement of 88
88 = 01011000
1. Change all the 1’s to 0 and 0’s to 1.
10100111
Two’s Complement Representation
Example 2 - find the Two’s Complement of 88
88 = 01011000
1. Change all the 1’s to 0 and 0’s to 1.
10100111
2. Add 1.
10100111
+1
10101000
So -88 as Two’s Complement = 10101000
Range
The number of integers which could be stored in one byte (8 bits) is
28
= 256
Range
The number of integers which could be stored in one byte (8 bits) is
28
= 256
The range of integers which could be stored in one byte (8 bits) using
Two’s Complement is
-128 to +127
Why does there seem to be one less positive number?
There are 255 numbers plus the value 0. So there are 256 numbers in all.
Range
What range of numbers could be stored in two bytes using twos complement?
216
= 65536
Range
What range of numbers could be stored in two bytes using twos complement?
216
= 65536
The range of integers which could be stored in two bytes (16 bits) is
-32768 to +32767
Range
What range of numbers could be stored in two bytes using twos complement?
216
= 65536
The range of integers which could be stored in two bytes (16 bits) is
-32768 to +32767
This method of representing large numbers is unsuitable because of the
increased memory needed to store the large number of bits needed.
A solution to this is to use Floating Point Representation.
Credits
Higher Computing – Data Representation – Representation of Negative
Numbers
Produced by P. Greene and adapted by R. G. Simpson for the City of
Edinburgh Council 2004
Adapted by M. Cunningham 2010

More Related Content

What's hot

Floating point representation
Floating point representationFloating point representation
Floating point representationmissstevenson01
 
Binary coded decimal r004
Binary coded decimal   r004Binary coded decimal   r004
Binary coded decimal r004arunachalamr16
 
Integer Representation
Integer RepresentationInteger Representation
Integer Representationgavhays
 
Convertion of single precision
Convertion of single precisionConvertion of single precision
Convertion of single precisionnikhilarora2211
 
Quick tutorial on IEEE 754 FLOATING POINT representation
Quick tutorial on IEEE 754 FLOATING POINT representationQuick tutorial on IEEE 754 FLOATING POINT representation
Quick tutorial on IEEE 754 FLOATING POINT representationRitu Ranjan Shrivastwa
 
Data types
Data typesData types
Data typesgavhays
 
NUMBER SYSTEM
NUMBER SYSTEMNUMBER SYSTEM
NUMBER SYSTEMRap Aishu
 
Representation Of Data
Representation Of DataRepresentation Of Data
Representation Of Datagavhays
 
CBNST PPT, Floating point arithmetic,Normalization
CBNST PPT, Floating point arithmetic,NormalizationCBNST PPT, Floating point arithmetic,Normalization
CBNST PPT, Floating point arithmetic,NormalizationAmberSinghal1
 
Representation of Integers
Representation of IntegersRepresentation of Integers
Representation of IntegersSusantha Herath
 
Number system with conversions www.eakanchha.com
Number system with conversions www.eakanchha.comNumber system with conversions www.eakanchha.com
Number system with conversions www.eakanchha.comAkanchha Agrawal
 
Data representation
Data representationData representation
Data representationManish Kumar
 

What's hot (19)

Floating point representation
Floating point representationFloating point representation
Floating point representation
 
Binary Arithmetic
Binary ArithmeticBinary Arithmetic
Binary Arithmetic
 
Number System and Boolean Algebra
Number System and Boolean AlgebraNumber System and Boolean Algebra
Number System and Boolean Algebra
 
Binary coded decimal r004
Binary coded decimal   r004Binary coded decimal   r004
Binary coded decimal r004
 
Integer Representation
Integer RepresentationInteger Representation
Integer Representation
 
The Real Numbers
The Real NumbersThe Real Numbers
The Real Numbers
 
IEEE Floating Point
IEEE Floating PointIEEE Floating Point
IEEE Floating Point
 
Convertion of single precision
Convertion of single precisionConvertion of single precision
Convertion of single precision
 
Quick tutorial on IEEE 754 FLOATING POINT representation
Quick tutorial on IEEE 754 FLOATING POINT representationQuick tutorial on IEEE 754 FLOATING POINT representation
Quick tutorial on IEEE 754 FLOATING POINT representation
 
Data types
Data typesData types
Data types
 
NUMBER SYSTEM
NUMBER SYSTEMNUMBER SYSTEM
NUMBER SYSTEM
 
Number System
Number SystemNumber System
Number System
 
Representation Of Data
Representation Of DataRepresentation Of Data
Representation Of Data
 
CBNST PPT, Floating point arithmetic,Normalization
CBNST PPT, Floating point arithmetic,NormalizationCBNST PPT, Floating point arithmetic,Normalization
CBNST PPT, Floating point arithmetic,Normalization
 
Representation of Integers
Representation of IntegersRepresentation of Integers
Representation of Integers
 
Real numbers
Real numbersReal numbers
Real numbers
 
Number system with conversions www.eakanchha.com
Number system with conversions www.eakanchha.comNumber system with conversions www.eakanchha.com
Number system with conversions www.eakanchha.com
 
Number system
Number systemNumber system
Number system
 
Data representation
Data representationData representation
Data representation
 

Viewers also liked

Viewers also liked (12)

SD &D Binary Units
SD &D Binary UnitsSD &D Binary Units
SD &D Binary Units
 
SD & D Maintenance
SD & D MaintenanceSD & D Maintenance
SD & D Maintenance
 
SD & D High and low level languages
SD & D High and low level languagesSD & D High and low level languages
SD & D High and low level languages
 
SD & D Representing Positive Numbers
SD & D Representing Positive NumbersSD & D Representing Positive Numbers
SD & D Representing Positive Numbers
 
SD & D Types of programming language
SD & D Types of programming languageSD & D Types of programming language
SD & D Types of programming language
 
Integers in real world
Integers in real worldIntegers in real world
Integers in real world
 
Representing integers
Representing integersRepresenting integers
Representing integers
 
INTEGERS INTRO
INTEGERS INTROINTEGERS INTRO
INTEGERS INTRO
 
Introduction to web design
Introduction to web designIntroduction to web design
Introduction to web design
 
Virtual machines, emulators and mobile devices
Virtual machines, emulators and mobile devicesVirtual machines, emulators and mobile devices
Virtual machines, emulators and mobile devices
 
Integers in the Real World
Integers in the Real WorldIntegers in the Real World
Integers in the Real World
 
7. The Software Development Process - Maintenance
7. The Software Development Process - Maintenance7. The Software Development Process - Maintenance
7. The Software Development Process - Maintenance
 

Similar to SD & D Negative Numbers

Similar to SD & D Negative Numbers (20)

Binaty Arithmetic and Binary coding schemes
Binaty Arithmetic and Binary coding schemesBinaty Arithmetic and Binary coding schemes
Binaty Arithmetic and Binary coding schemes
 
Logic Design - Chapter 1: Number Systems and Codes
Logic Design - Chapter 1: Number Systems and CodesLogic Design - Chapter 1: Number Systems and Codes
Logic Design - Chapter 1: Number Systems and Codes
 
Binary arithmetic
Binary arithmeticBinary arithmetic
Binary arithmetic
 
lec2_BinaryArithmetic.ppt
lec2_BinaryArithmetic.pptlec2_BinaryArithmetic.ppt
lec2_BinaryArithmetic.ppt
 
2's complement
2's complement2's complement
2's complement
 
Chapter two FHI.pptx
Chapter two FHI.pptxChapter two FHI.pptx
Chapter two FHI.pptx
 
Chapter 02 Data Types
Chapter 02   Data TypesChapter 02   Data Types
Chapter 02 Data Types
 
Alu1
Alu1Alu1
Alu1
 
Chapter 2.1 introduction to number system
Chapter 2.1 introduction to number systemChapter 2.1 introduction to number system
Chapter 2.1 introduction to number system
 
ch2.pdf
ch2.pdfch2.pdf
ch2.pdf
 
Integers
IntegersIntegers
Integers
 
3.Fixed-Floating Point.ppt
3.Fixed-Floating Point.ppt3.Fixed-Floating Point.ppt
3.Fixed-Floating Point.ppt
 
Lesson 1 basic theory of information
Lesson 1   basic theory of informationLesson 1   basic theory of information
Lesson 1 basic theory of information
 
Lesson 1 basic theory of information
Lesson 1   basic theory of informationLesson 1   basic theory of information
Lesson 1 basic theory of information
 
Ch 4
Ch 4Ch 4
Ch 4
 
Video lectures
Video lecturesVideo lectures
Video lectures
 
Mba ebooks
Mba ebooksMba ebooks
Mba ebooks
 
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)
 
3.4
3.43.4
3.4
 
005618132.pdf
005618132.pdf005618132.pdf
005618132.pdf
 

More from Forrester High School (20)

Program Design
Program DesignProgram Design
Program Design
 
Database Evaluation
Database EvaluationDatabase Evaluation
Database Evaluation
 
Testing SQL
Testing SQLTesting SQL
Testing SQL
 
SQL
SQLSQL
SQL
 
Database Query Design
Database Query DesignDatabase Query Design
Database Query Design
 
Data Dictionary
Data DictionaryData Dictionary
Data Dictionary
 
Compound Keys
Compound KeysCompound Keys
Compound Keys
 
Entity Occurrence Diagrams
Entity Occurrence DiagramsEntity Occurrence Diagrams
Entity Occurrence Diagrams
 
Entity Relationship Diagrams
Entity Relationship DiagramsEntity Relationship Diagrams
Entity Relationship Diagrams
 
Database Analysis
Database AnalysisDatabase Analysis
Database Analysis
 
Software Evaluation
Software EvaluationSoftware Evaluation
Software Evaluation
 
Software Testing
Software TestingSoftware Testing
Software Testing
 
Standard Algorithms
Standard AlgorithmsStandard Algorithms
Standard Algorithms
 
File Handling
File HandlingFile Handling
File Handling
 
Python Predefined Functions
Python Predefined FunctionsPython Predefined Functions
Python Predefined Functions
 
Python Substrings
Python SubstringsPython Substrings
Python Substrings
 
Variable Scope
Variable ScopeVariable Scope
Variable Scope
 
Sub-programs
Sub-programsSub-programs
Sub-programs
 
Records in Python
Records in PythonRecords in Python
Records in Python
 
Parallel arrays in python
Parallel arrays in pythonParallel arrays in python
Parallel arrays in python
 

Recently uploaded

DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxJiesonDelaCerna
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 

Recently uploaded (20)

Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptx
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 

SD & D Negative Numbers

  • 1.
  • 2. Real Numbers & Integers All numbers belong to the set or group called real numbers. Inside the set of real numbers is a set of all positive and negative whole numbers. This set is called integers. Real numbers -4.6 2.46 13.7 Integers 0 -7 5 221 -31 100.052 -52.414 0.0014
  • 3. Signed Bit Representation The simplest way of representing a negative number in binary is to use the first bit of the number to represent whether the number is positive or negative: 011 = 3 111 = -3 This is known as signed bit representation.
  • 4. Signed Bit Representation The simplest way of representing a negative number in binary is to use the first bit of the number to represent whether the number is positive or negative: 011 = 3 111 = -3 This is known as signed bit representation. The problem with signed bit representation is that there are 2 values for zero: 000 = 0 100 = -0
  • 5. Two’s Complement Representation A better way of representing negative numbers in binary is by using Two’s Complement. Two’s Complement is designed so that: Binary Decimal 11111101 -3 11111110 -2 11111111 -1 00000000 0 00000001 1 00000010 2 00000011 3 1. the set of integers show symmetry about zero
  • 6. Two’s Complement Representation Two’s complement is designed so that: 00000010 + 1 00000011 2. adding 1 to any number produces the next number (ignoring carry bits)
  • 7. Two’s Complement Representation To find the Two’s Complement of a number (its opposite sign): 1. Change all the 1’s to 0 and 0’s to 1. 2. Add 1.
  • 8. Two’s Complement Representation For example, how would -5 be represented using Two’s Complement? 5 = 000000101 1. Change all the 1’s to 0 and 0’s to 1. 11111010
  • 9. Two’s Complement Representation For example, how would -5 be represented using Two’s Complement? 5 = 000000101 1. Change all the 1’s to 0 and 0’s to 1. 11111010 2. Add 1. 11111010 +1 11111011 So -5 as Two’s Complement = 11111011
  • 10. Two’s Complement Representation Example 2 - find the Two’s Complement of 88 88 = 01011000 1. Change all the 1’s to 0 and 0’s to 1. 10100111
  • 11. Two’s Complement Representation Example 2 - find the Two’s Complement of 88 88 = 01011000 1. Change all the 1’s to 0 and 0’s to 1. 10100111 2. Add 1. 10100111 +1 10101000 So -88 as Two’s Complement = 10101000
  • 12. Range The number of integers which could be stored in one byte (8 bits) is 28 = 256
  • 13. Range The number of integers which could be stored in one byte (8 bits) is 28 = 256 The range of integers which could be stored in one byte (8 bits) using Two’s Complement is -128 to +127 Why does there seem to be one less positive number? There are 255 numbers plus the value 0. So there are 256 numbers in all.
  • 14. Range What range of numbers could be stored in two bytes using twos complement? 216 = 65536
  • 15. Range What range of numbers could be stored in two bytes using twos complement? 216 = 65536 The range of integers which could be stored in two bytes (16 bits) is -32768 to +32767
  • 16. Range What range of numbers could be stored in two bytes using twos complement? 216 = 65536 The range of integers which could be stored in two bytes (16 bits) is -32768 to +32767 This method of representing large numbers is unsuitable because of the increased memory needed to store the large number of bits needed. A solution to this is to use Floating Point Representation.
  • 17. Credits Higher Computing – Data Representation – Representation of Negative Numbers Produced by P. Greene and adapted by R. G. Simpson for the City of Edinburgh Council 2004 Adapted by M. Cunningham 2010