SlideShare a Scribd company logo
1 of 9
Unsigned Integers
• Represents positive integers only
• Example: ASCII character codes
• Not necessary to indicate a sign, so all 8 or 16 bits can be
used for the magnitude:
– 1 byte = 8 bits = 28 = 256 (0 to 255)
– 2 bytes = 16 bits = 216 = 65,536 (0 to 65,535)
– 4 bytes = 32 bits = 232
= 4,294,967,296 (0 to 4,294,967,295)
Signed Integers
 Represents positive and negative integers
… -2, -1, 0, 1, 2, …
 MSB (Most Significant Bit – leftmost bit) used to indicate
sign
0 = positive, 1 = negative
 One less bit is used for the magnitude, with one extra
negative value
1 byte = 8-1 bits = 27 (-128 to +127)
2 bytes = 16-1 bits = 215 (-32,768 to +32,767)
4 bytes = 32-1 bits = 231 (-2,147,483,648 to
+2,147,483,647 )
Signed Integers
 Let consider the binary:
I I 0 0 0 I I 0
Convert it to decimal number.
 Use positional representation as shown previously with one change in
the MSB
-27 * 1 = -128
26 * 1 = 64
25 * 0 = 0
24 * 0 = 0
23 * 0 = 0
22 * 1 = 4
21 * 1 = 2
20 * 0 = 0
-128 +(64+4+2)=58
Signed Integers
Some values of interest (8-bit example):
• +0
0 0 0 0 0 0 0 0
• +1
0 0 0 0 0 0 0 I
• -1
I 0 0 0 0 0 0 0
I I I I I I I I
Signed Integers
Some values of interest (8-bit example):
• Max positive value
0 I I I I I I I = 127
• Most negative value
I 0 0 0 0 0 0 0 = -128
1’s & 2’s Complement
• 1’s complement form
– Formed by reversing (complementing) each bit
• 2’s complement form
– Formed by adding 1 to 1's complement
– Negative numbers are stored this way
• Additive inverse of a number
• Computer never has to subtract
• A – B = A + (-B)
Signed Integers (8-bit)
 Example: -9
1. 0000 1001b
2. 1111 0110b
+1b
1111 0111b
247
 Example: -32
1. 0010 0000b
2. 1101 1111b
+1b
1110 0000b
224
Class Exercise
• Convert the following negative decimal
numbers to 8 bit binary using the 2’s
complement
– -1, -3, -8, -17
Class Exercise
• Evaluate 25 + (- 5) in 8 bit binary
– Convert 25 to binary
– Convert -5 to 2’s complement
– Add together
– Check your answer by converting back to decimal

More Related Content

What's hot

Bca 2nd sem-u-1.3 digital logic circuits, digital component
Bca 2nd sem-u-1.3 digital logic circuits, digital componentBca 2nd sem-u-1.3 digital logic circuits, digital component
Bca 2nd sem-u-1.3 digital logic circuits, digital componentRai University
 
What is binary and why do we use it?
What is binary and why do we use it?What is binary and why do we use it?
What is binary and why do we use it?grahamwell
 
Binary Concepts Review
Binary Concepts ReviewBinary Concepts Review
Binary Concepts ReviewLeo Hernandez
 
Working With Binary Numbers
Working With Binary NumbersWorking With Binary Numbers
Working With Binary Numbersadil raja
 
Binary Arithmetic
Binary ArithmeticBinary Arithmetic
Binary Arithmeticgavhays
 
Decimal number system
Decimal number systemDecimal number system
Decimal number systemNisarg Amin
 
B.sc cs-ii-u-1.3 digital logic circuits, digital component
B.sc cs-ii-u-1.3 digital logic circuits, digital componentB.sc cs-ii-u-1.3 digital logic circuits, digital component
B.sc cs-ii-u-1.3 digital logic circuits, digital componentRai University
 
Number system in Digital Electronics
Number system in Digital ElectronicsNumber system in Digital Electronics
Number system in Digital ElectronicsJanki Shah
 
Binary to Decimal Conversion
Binary to Decimal ConversionBinary to Decimal Conversion
Binary to Decimal ConversionMac Mac
 
CCS103 Bits, Bytes, Binary
CCS103 Bits, Bytes, BinaryCCS103 Bits, Bytes, Binary
CCS103 Bits, Bytes, BinaryRichard Homa
 
Octal COnversion
Octal COnversionOctal COnversion
Octal COnversionMac Mac
 
Hexadecimal Conversion
Hexadecimal ConversionHexadecimal Conversion
Hexadecimal ConversionMac Mac
 
Decimal to Binary Conversion
Decimal to Binary ConversionDecimal to Binary Conversion
Decimal to Binary ConversionMac Mac
 

What's hot (20)

Bca 2nd sem-u-1.3 digital logic circuits, digital component
Bca 2nd sem-u-1.3 digital logic circuits, digital componentBca 2nd sem-u-1.3 digital logic circuits, digital component
Bca 2nd sem-u-1.3 digital logic circuits, digital component
 
Arithmetic circuits
Arithmetic circuitsArithmetic circuits
Arithmetic circuits
 
What is binary and why do we use it?
What is binary and why do we use it?What is binary and why do we use it?
What is binary and why do we use it?
 
Binary Concepts Review
Binary Concepts ReviewBinary Concepts Review
Binary Concepts Review
 
Signed Binary Numbers
Signed Binary NumbersSigned Binary Numbers
Signed Binary Numbers
 
Working With Binary Numbers
Working With Binary NumbersWorking With Binary Numbers
Working With Binary Numbers
 
Number System
Number SystemNumber System
Number System
 
Binary Arithmetic
Binary ArithmeticBinary Arithmetic
Binary Arithmetic
 
Decimal number system
Decimal number systemDecimal number system
Decimal number system
 
B.sc cs-ii-u-1.3 digital logic circuits, digital component
B.sc cs-ii-u-1.3 digital logic circuits, digital componentB.sc cs-ii-u-1.3 digital logic circuits, digital component
B.sc cs-ii-u-1.3 digital logic circuits, digital component
 
Number system in Digital Electronics
Number system in Digital ElectronicsNumber system in Digital Electronics
Number system in Digital Electronics
 
Binary true ppt
Binary true pptBinary true ppt
Binary true ppt
 
Binary to Decimal Conversion
Binary to Decimal ConversionBinary to Decimal Conversion
Binary to Decimal Conversion
 
Binary
BinaryBinary
Binary
 
CCS103 Bits, Bytes, Binary
CCS103 Bits, Bytes, BinaryCCS103 Bits, Bytes, Binary
CCS103 Bits, Bytes, Binary
 
Binary addition
Binary additionBinary addition
Binary addition
 
Number system
Number systemNumber system
Number system
 
Octal COnversion
Octal COnversionOctal COnversion
Octal COnversion
 
Hexadecimal Conversion
Hexadecimal ConversionHexadecimal Conversion
Hexadecimal Conversion
 
Decimal to Binary Conversion
Decimal to Binary ConversionDecimal to Binary Conversion
Decimal to Binary Conversion
 

Viewers also liked

8 elementary sorts-selection
8 elementary sorts-selection8 elementary sorts-selection
8 elementary sorts-selectionirdginfo
 
5 data structures-stack
5 data structures-stack5 data structures-stack
5 data structures-stackirdginfo
 
4 character encoding-ascii
4 character encoding-ascii4 character encoding-ascii
4 character encoding-asciiirdginfo
 
3 number systems-floatingpoint
3 number systems-floatingpoint3 number systems-floatingpoint
3 number systems-floatingpointirdginfo
 
8 elementary sorts-bubble
8 elementary sorts-bubble8 elementary sorts-bubble
8 elementary sorts-bubbleirdginfo
 
4 character encoding
4 character encoding4 character encoding
4 character encodingirdginfo
 
1 number systems-hex
1 number systems-hex1 number systems-hex
1 number systems-hexirdginfo
 
1 number systems-octal
1 number systems-octal1 number systems-octal
1 number systems-octalirdginfo
 
2 number systems-scientificnotation
2 number systems-scientificnotation2 number systems-scientificnotation
2 number systems-scientificnotationirdginfo
 
5 data structures-arraysandlinkedlist
5 data structures-arraysandlinkedlist5 data structures-arraysandlinkedlist
5 data structures-arraysandlinkedlistirdginfo
 
6 arrays injava
6 arrays injava6 arrays injava
6 arrays injavairdginfo
 
8 elementary sorts-insertion
8 elementary sorts-insertion8 elementary sorts-insertion
8 elementary sorts-insertionirdginfo
 
10 merge sort
10 merge sort10 merge sort
10 merge sortirdginfo
 
5 data structures-hashtable
5 data structures-hashtable5 data structures-hashtable
5 data structures-hashtableirdginfo
 
7 searching injava-binary
7 searching injava-binary7 searching injava-binary
7 searching injava-binaryirdginfo
 
Quicksort Presentation
Quicksort PresentationQuicksort Presentation
Quicksort Presentationirdginfo
 
1 number systems-binary
1 number systems-binary1 number systems-binary
1 number systems-binaryirdginfo
 

Viewers also liked (17)

8 elementary sorts-selection
8 elementary sorts-selection8 elementary sorts-selection
8 elementary sorts-selection
 
5 data structures-stack
5 data structures-stack5 data structures-stack
5 data structures-stack
 
4 character encoding-ascii
4 character encoding-ascii4 character encoding-ascii
4 character encoding-ascii
 
3 number systems-floatingpoint
3 number systems-floatingpoint3 number systems-floatingpoint
3 number systems-floatingpoint
 
8 elementary sorts-bubble
8 elementary sorts-bubble8 elementary sorts-bubble
8 elementary sorts-bubble
 
4 character encoding
4 character encoding4 character encoding
4 character encoding
 
1 number systems-hex
1 number systems-hex1 number systems-hex
1 number systems-hex
 
1 number systems-octal
1 number systems-octal1 number systems-octal
1 number systems-octal
 
2 number systems-scientificnotation
2 number systems-scientificnotation2 number systems-scientificnotation
2 number systems-scientificnotation
 
5 data structures-arraysandlinkedlist
5 data structures-arraysandlinkedlist5 data structures-arraysandlinkedlist
5 data structures-arraysandlinkedlist
 
6 arrays injava
6 arrays injava6 arrays injava
6 arrays injava
 
8 elementary sorts-insertion
8 elementary sorts-insertion8 elementary sorts-insertion
8 elementary sorts-insertion
 
10 merge sort
10 merge sort10 merge sort
10 merge sort
 
5 data structures-hashtable
5 data structures-hashtable5 data structures-hashtable
5 data structures-hashtable
 
7 searching injava-binary
7 searching injava-binary7 searching injava-binary
7 searching injava-binary
 
Quicksort Presentation
Quicksort PresentationQuicksort Presentation
Quicksort Presentation
 
1 number systems-binary
1 number systems-binary1 number systems-binary
1 number systems-binary
 

Similar to 1 number systems-unsignedsignedintegers

Similar to 1 number systems-unsignedsignedintegers (20)

arithmetic
arithmeticarithmetic
arithmetic
 
09 arithmetic
09 arithmetic09 arithmetic
09 arithmetic
 
Alu1
Alu1Alu1
Alu1
 
Number system and codes
Number system and codesNumber system and codes
Number system and codes
 
09 binary number systems
09   binary number systems09   binary number systems
09 binary number systems
 
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
 
Arithmetic.ppt
Arithmetic.pptArithmetic.ppt
Arithmetic.ppt
 
Number System.pptx
Number System.pptxNumber System.pptx
Number System.pptx
 
Network Slides
Network SlidesNetwork Slides
Network Slides
 
Computer Systems Data Representation
Computer Systems   Data RepresentationComputer Systems   Data Representation
Computer Systems Data Representation
 
Chapter 2_Number system (EEEg4302).pdf
Chapter 2_Number system (EEEg4302).pdfChapter 2_Number system (EEEg4302).pdf
Chapter 2_Number system (EEEg4302).pdf
 
data representation
 data representation data representation
data representation
 
3.Fixed-Floating Point.ppt
3.Fixed-Floating Point.ppt3.Fixed-Floating Point.ppt
3.Fixed-Floating Point.ppt
 
Digital fundamendals r001a
Digital fundamendals r001aDigital fundamendals r001a
Digital fundamendals r001a
 
Representation of Integers
Representation of IntegersRepresentation of Integers
Representation of Integers
 
Number Systems.ppt
Number Systems.pptNumber Systems.ppt
Number Systems.ppt
 
Complement
ComplementComplement
Complement
 
number system.ppt
number system.pptnumber system.ppt
number system.ppt
 
Binary numbers
Binary numbersBinary numbers
Binary numbers
 
Number Systems - AK.pptx
Number Systems - AK.pptxNumber Systems - AK.pptx
Number Systems - AK.pptx
 

Recently uploaded

Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
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
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
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
 
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
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonJericReyAuditor
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 

Recently uploaded (20)

Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
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
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
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
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
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
 
Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lesson
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 

1 number systems-unsignedsignedintegers

  • 1. Unsigned Integers • Represents positive integers only • Example: ASCII character codes • Not necessary to indicate a sign, so all 8 or 16 bits can be used for the magnitude: – 1 byte = 8 bits = 28 = 256 (0 to 255) – 2 bytes = 16 bits = 216 = 65,536 (0 to 65,535) – 4 bytes = 32 bits = 232 = 4,294,967,296 (0 to 4,294,967,295)
  • 2. Signed Integers  Represents positive and negative integers … -2, -1, 0, 1, 2, …  MSB (Most Significant Bit – leftmost bit) used to indicate sign 0 = positive, 1 = negative  One less bit is used for the magnitude, with one extra negative value 1 byte = 8-1 bits = 27 (-128 to +127) 2 bytes = 16-1 bits = 215 (-32,768 to +32,767) 4 bytes = 32-1 bits = 231 (-2,147,483,648 to +2,147,483,647 )
  • 3. Signed Integers  Let consider the binary: I I 0 0 0 I I 0 Convert it to decimal number.  Use positional representation as shown previously with one change in the MSB -27 * 1 = -128 26 * 1 = 64 25 * 0 = 0 24 * 0 = 0 23 * 0 = 0 22 * 1 = 4 21 * 1 = 2 20 * 0 = 0 -128 +(64+4+2)=58
  • 4. Signed Integers Some values of interest (8-bit example): • +0 0 0 0 0 0 0 0 0 • +1 0 0 0 0 0 0 0 I • -1 I 0 0 0 0 0 0 0 I I I I I I I I
  • 5. Signed Integers Some values of interest (8-bit example): • Max positive value 0 I I I I I I I = 127 • Most negative value I 0 0 0 0 0 0 0 = -128
  • 6. 1’s & 2’s Complement • 1’s complement form – Formed by reversing (complementing) each bit • 2’s complement form – Formed by adding 1 to 1's complement – Negative numbers are stored this way • Additive inverse of a number • Computer never has to subtract • A – B = A + (-B)
  • 7. Signed Integers (8-bit)  Example: -9 1. 0000 1001b 2. 1111 0110b +1b 1111 0111b 247  Example: -32 1. 0010 0000b 2. 1101 1111b +1b 1110 0000b 224
  • 8. Class Exercise • Convert the following negative decimal numbers to 8 bit binary using the 2’s complement – -1, -3, -8, -17
  • 9. Class Exercise • Evaluate 25 + (- 5) in 8 bit binary – Convert 25 to binary – Convert -5 to 2’s complement – Add together – Check your answer by converting back to decimal