Chapter 2
Data Representation
• Data Representation
• Compliments
• Subtraction of Unsigned Numbers
using r’s complement
• How To Represent Signed Numbers
• Floating-Point Representation
Data Types
• The data types stored in digital computers
may be classified as being one of the
following categories:
1. numbers used in arithmetic computations,
2. letters of the alphabet used in data
processing, and
3. other discrete symbols used for specific
purposes.
All types of data are represented in computers in
binary-coded form.
Binary Numbers
• Binary numbers are made of binary digits (bits):
0 and 1
• Convert the following to decimal
(1011)2 = 1x23 + 0x22 + 1x21 + 1x20 = (11)10
Example
• Use radix representation to convert the binary number
(101.01) into decimal.
• The position value is power of 2
• 1 0 1. 0 1
•
• 22 21 20 2-1 2-2
• 4 + 0 + 1 + 0 + 1/22 = 5.25
(101.01)2  (5.25)10
Converting an Integer from Decimal to Another
Base
• Divide the decimal number by the base (e.g.
• The remainder is the lowest-order digit
• Repeat the first two steps until no divisor
remains.
• For binary the even number has no remainder
‘0’, while the odd has ‘1’
For each digit position:
Converting an Integer from Decimal to
Another Base
Example
for (13)10:
Integer
Quotient
13/2 = (12+1)½ a0 = 1
6/2 = ( 6+0 )½ a1 = 0
3/2 = (2+1 )½ a2 = 1
1/2 = (0+1) ½ a3 = 1
Remainder Coefficient
Answer (13)10 = (a3 a2 a1 a0)2 = (1101)2
Converting a Fraction from Decimal
to Another Base
Example for
(0.625)10: Integer
0.625 x 2 = 1 + 0.25 a-1 = 1
0.250 x 2 = 0 + 0.50 a-2 = 0
0.500 x 2 = 1 + 0 a-3 = 1
Fraction Coefficient
Answer (0.625)10 = (0.a-1 a-2 a-3 )2 = (0.101)2
DECIMAL TO BINARY CONVERSION
(INTEGER+FRACTION)
(1) Separate the decimal number into integer and fraction parts.
(2) Repeatedly divide the integer part by 2 to give a quotient
and a remainder and
Remove the remainder. Arrange the sequence of remainders
right to left from the period. (Least significant bit first)
(3) Repeatedly multiply the fraction part by 2 to give an integer
and a fraction part
and remove the integer. Arrange the sequence of integers
left to right from the period. (Most significant fraction bit first)
(Example) (41.6875)10 (?)2
Integer = 41, Fraction = 0.6875
The first procedure produces
41= 1 x 25 + 0 x 24 + 1 x 23 + 0 x 22 + 0 x 2 + 1 = (101001)
0.6875=0.1011
41.6875 (10) = 101001.1011 (2)
Integer remainder
41 /2 1
20 0
10 0
5 1
2 0
1 1
Overflow Fraction
X by 2 .6875
1 .3750
0 .750
1 .5
1 0
Octal Numbers
• Octal numbers (Radix or base=8) are made of octal
digits: (0,1,2,3,4,5,6,7)
• How many items does an octal number represent?
• Convert the following octal number to decimal
(465.27)8 = 4x82 + 6x81 + 5x80 + 2x8-1 + 7x8-2
Converting an Integer from Decimal
to Octal
Example for (0.3125)10:
Integer
0.3125 x 8 = 2 + 0.5 a-1 = 2
0.5000 x 8 = 4 + 0 a-2 = 4
Fraction Coefficient
Answer (0.3125)10 = (0.24)8
Combine the two (175.3125)10 = (257.24)8
Remainder
of division
Overflow of
multiplication
Hexadecimal Numbers
• Hexadecimal numbers are made of 16 symbols:
o (0,1,2,3,4,5,6,7,8,9,A, B, C, D, E, F)
• Convert a hexadecimal number to decimal
o (3A9F)16 = 3x163 + 10x162 + 9x161 + 15x160 = 1499910
• Hexadecimal with fractions:
o (2D3.5)16 = 2x162 + 13x161 + 3x160 + 5x16-1 = 723.312510
• Note that each hexadecimal digit can be
represented with four bits.
o (1110) 2 = (E)16
• Groups of four bits are called a nibble.
o (1110) 2
Example
• Convert the decimal number
(107.00390625)10 into hexadecimal number.
• (107.00390625)10  (6B.01)16
Integer remainde
r
107 Divide/16
6 11=B
0 6
Overflow Fraction
X by 16 .
00390625
0 .0625
1 .0000
.
Closer to
the period
Conversion Between Number Bases
Decimal(base 10)
Octal(base 8)
Binary(base 2)
Hexadecimal
(base16)
° We normally convert to base 10
because we are naturally used to the
decimal number system.
° We can also convert to other number
systems
One to one comparison
• Binary, octal, and
hexadecimal similar
• Easy to build circuits to
operate on these
representations
• Possible to convert
between the three formats
Converting between Base 16 and
Base 2
° Conversion is easy!
 Determine 4-bit value for each hex digit
° Note that there are 24 = 16 different values of
four bits which means each 16 value is
converted to four binary bits.
° Easier to read and write in hexadecimal.
° Representations are equivalent!
3A9F16 = 0011 1010 1001 11112
3 A 9 F
Converting between Base 16 and
Base 8
1. Convert from Base 16 to Base 2
2. Regroup bits into groups of three starting from right
3. Ignore leading zeros
4. Each group of three bits forms an octal digit (8 is
represented by 3 binary bits).
352378 = 011 101 010 011 1112
5 2 3 73
3A9F16 = 0011 1010 1001 11112
3 A 9 F
Example
Convert 101011110110011 to
a. octal number
b. hexadecimal number
a. Each 3 bits are converted to octal :
(101) (011) (110) (110) (011)
5 3 6 6 3
101011110110011 = (53663)8
b. Each 4 bits are converted to hexadecimal:
(0101) (0111) (1011) (0011)
5 7 B 3
101011110110011 = (57B3)16
Conversion from binary to hexadecimal is similar except that the bits
divided into groups of four.
Compliments
Complements Of Numbers
Subtraction using
addition
• Conventional addition (using carry) is easily
• implemented in digital computers.
• However; subtraction by borrowing is
difficult and inefficient for digital computers.
• Much more efficient to implement
subtraction using ADDITION OF the
COMPLEMENTS of numbers.
Binary Addition
1 1 1 1 0 1
+ 1 0 1 1 1
---------------------
0
1
0
1
1
1111
1 1 00
carries
Example Add (11110)2 to
(10111)2
(111101)2 + (10111) 2 = (1010100)2
carry
Binary Subtraction
• We can also perform subtraction (with borrows).
• Example: subtract (10111) from (1001101)
1 10
0 10 10 0 0 10
1 0 0 1 1 0 1
- 1 0 1 1 1
------------------------
0 1 1 0 1 1 0
borrows
1+1=
2
(1001101)2 - (10111)2 = (0110110)2
The complement 1’s of
1011001 is 0100110
0 1 1 0 0- 1
1 1 1 1 1 1
1 0 0 1 1 0
0 0 1 1 1- 1
1 1 1 1 1 1
1 1 0 0 0 0
1
1
0
The 1’s complement of
0001111 is 1110000
0
1
1
l’s complement
For binary numbers, r = 2,
r’s complement is the 2’s complement.
The 2’s complement of N is 2n - N.
2’s complement
Digit
n
Digit
n-1
Next
digit
Next
digit
First
digit
0 0 0 0 0
-
1
2’s complement Example
The 2’s complement of
1011001 is 0100111
The 2’s complement of
0001111 is 1110001
0 1 1 0 0- 1
0 0 0 0 0 0
1 0 0 1 1 1
0 0 1 1 1- 1
1 1 0 0 0 1
1
0
0
0
1
1
0 0 0 0 0 001
Fast Methods for 2’s
Complement
Method 1:
The 2’s complement of binary number is obtained by adding 1 to the
l’s complement value.
Example:
1’s complement of 101100 is 010011 (invert the 0’s and 1’s)
2’s complement of 101100 is 010011 + 1 = 010100
Fast Methods for 2’s
Complement
Method 2:
The 2’s complement can be formed by leaving all least significant 0’s
and the first 1 unchanged, and then replacing l’s by 0’s and 0’s by l’s
in all other higher significant bits.
Example:
The 2’s complement of 1101100 is
0010100
Leave the two low-order 0’s and the first 1 unchanged, and then
replacing 1’s by 0’s and 0’s by 1’s in the four most significant bits.
Examples
o Finding the 2’s complement of (01100101)2
• Method 1 – Simply complement each bit and
then add 1 to the result.
(01100101)2
[N] = 2’s complement = 1’s complement (10011010)2
+1
=(10011011)2
• Method 2 – Starting with the least significant
bit, copy all the bits up to and including the
first 1 bit and then complement the remaining
bits.
N = 0 1 1 0 0 1 0 1
[N] = 1 0 0 1 1 0 1 1
Video Reference
• http://www.youtube.com/watch?v=SXAr35BiqK8

More Related Content

PPTX
Number Systems
PDF
Slide03 Number System and Operations Part 1
PDF
Digital and Logic Design Chapter 1 binary_systems
PPTX
Introducing to number system
PPTX
Number system
PPTX
Introduction to digital electornics
PPSX
Basic of number system
PPT
Number system
Number Systems
Slide03 Number System and Operations Part 1
Digital and Logic Design Chapter 1 binary_systems
Introducing to number system
Number system
Introduction to digital electornics
Basic of number system
Number system

What's hot (20)

PPTX
PPT ON NUMBER SYSTEM
PPTX
Computer Number system
PPTX
Number system computer fundamental
PPTX
Number System
PPT
01.number systems
PPT
Numbersystemcont
PPT
Number systems ppt
PPTX
Representation Of Numbers and Characters
PPT
Binary number systems
PPTX
PPTX
Logic Circuits Design - "Chapter 1: Digital Systems and Information"
PPSX
Sig figs.ppt
PPTX
Number system and their conversion
PDF
Chapter 1 digital systems and binary numbers
PPT
01.number systems
PPT
Bolum1cozumler
PPT
Number system and codes
PDF
Digital Electronics- Number systems & codes
PPTX
Natural and Whole Numbers
PPT ON NUMBER SYSTEM
Computer Number system
Number system computer fundamental
Number System
01.number systems
Numbersystemcont
Number systems ppt
Representation Of Numbers and Characters
Binary number systems
Logic Circuits Design - "Chapter 1: Digital Systems and Information"
Sig figs.ppt
Number system and their conversion
Chapter 1 digital systems and binary numbers
01.number systems
Bolum1cozumler
Number system and codes
Digital Electronics- Number systems & codes
Natural and Whole Numbers
Ad

Viewers also liked (15)

PPT
Register transfer & microoperations moris mano ch 04
PPT
Mc namer test of correlation
PPTX
Statistical analysis training course
PPTX
Register transfer language
PPTX
Artificial Neural Network
PPTX
PPTX
Neural Network Classification and its Applications in Insurance Industry
PDF
Instruction cycle
PPTX
Register transfer and micro-operation
PPTX
Register transfer language
PPTX
Chapter 5 - Fuzzy Logic
PPTX
Artificial neural network
PPT
Fuzzy logic ppt
PPT
Instruction cycle
PPTX
Fuzzy Sets Introduction With Example
Register transfer & microoperations moris mano ch 04
Mc namer test of correlation
Statistical analysis training course
Register transfer language
Artificial Neural Network
Neural Network Classification and its Applications in Insurance Industry
Instruction cycle
Register transfer and micro-operation
Register transfer language
Chapter 5 - Fuzzy Logic
Artificial neural network
Fuzzy logic ppt
Instruction cycle
Fuzzy Sets Introduction With Example
Ad

Similar to Data representation (20)

PDF
digital-electronics (1)_watermark.pdfhindi
PPTX
Switching Theory and Logic Circuits-LEC.pptx
PDF
UNIT-1- Logic gates and Boolean algebras
PPT
Module I - Digital Systems & Logic Gates.ppt
PPTX
digital-electronics.pptx
PPTX
Number system in Digital Electronics
PDF
uyuyuy.pdf
PPTX
chapter1digitalsystemsandbinarynumbers-151021072016-lva1-app6891.pptx
PPTX
Number system conversion
PDF
Module 1 Digital Logic Design .pptx.pdf
PPT
chapter 3 000Number_Systems.ppt
PPT
Number system on various number tyoes decimal
PPT
45196656565656565656565656565656565656566.ppt
PPT
Number Systems and its effectiveness .ppt
PPT
An introduction to the different number systems
PPT
Number_Systems decimal, binary, octal, and hexadecimal
PPT
Number_Systems_Number base conversions.ppt
PPT
Number_Systems _binary_octal_hex_dec.ppt
PDF
Course Name: Digital System Design Number System.pdf
PDF
Cse115 lecture01numbersystems
digital-electronics (1)_watermark.pdfhindi
Switching Theory and Logic Circuits-LEC.pptx
UNIT-1- Logic gates and Boolean algebras
Module I - Digital Systems & Logic Gates.ppt
digital-electronics.pptx
Number system in Digital Electronics
uyuyuy.pdf
chapter1digitalsystemsandbinarynumbers-151021072016-lva1-app6891.pptx
Number system conversion
Module 1 Digital Logic Design .pptx.pdf
chapter 3 000Number_Systems.ppt
Number system on various number tyoes decimal
45196656565656565656565656565656565656566.ppt
Number Systems and its effectiveness .ppt
An introduction to the different number systems
Number_Systems decimal, binary, octal, and hexadecimal
Number_Systems_Number base conversions.ppt
Number_Systems _binary_octal_hex_dec.ppt
Course Name: Digital System Design Number System.pdf
Cse115 lecture01numbersystems

Recently uploaded (20)

PDF
Dell Pro Micro: Speed customer interactions, patient processing, and learning...
PDF
Auditboard EB SOX Playbook 2023 edition.
PDF
Comparative analysis of machine learning models for fake news detection in so...
PDF
Transform-Your-Factory-with-AI-Driven-Quality-Engineering.pdf
PDF
The influence of sentiment analysis in enhancing early warning system model f...
PDF
The-2025-Engineering-Revolution-AI-Quality-and-DevOps-Convergence.pdf
PPTX
AI-driven Assurance Across Your End-to-end Network With ThousandEyes
PPTX
GROUP4NURSINGINFORMATICSREPORT-2 PRESENTATION
PDF
Improvisation in detection of pomegranate leaf disease using transfer learni...
PPTX
Training Program for knowledge in solar cell and solar industry
PDF
AI.gov: A Trojan Horse in the Age of Artificial Intelligence
PDF
Early detection and classification of bone marrow changes in lumbar vertebrae...
PPTX
Microsoft User Copilot Training Slide Deck
PDF
Lung cancer patients survival prediction using outlier detection and optimize...
PDF
sustainability-14-14877-v2.pddhzftheheeeee
PDF
NewMind AI Weekly Chronicles – August ’25 Week IV
PPTX
Internet of Everything -Basic concepts details
PDF
Produktkatalog für HOBO Datenlogger, Wetterstationen, Sensoren, Software und ...
PPT
Galois Field Theory of Risk: A Perspective, Protocol, and Mathematical Backgr...
PDF
“A New Era of 3D Sensing: Transforming Industries and Creating Opportunities,...
Dell Pro Micro: Speed customer interactions, patient processing, and learning...
Auditboard EB SOX Playbook 2023 edition.
Comparative analysis of machine learning models for fake news detection in so...
Transform-Your-Factory-with-AI-Driven-Quality-Engineering.pdf
The influence of sentiment analysis in enhancing early warning system model f...
The-2025-Engineering-Revolution-AI-Quality-and-DevOps-Convergence.pdf
AI-driven Assurance Across Your End-to-end Network With ThousandEyes
GROUP4NURSINGINFORMATICSREPORT-2 PRESENTATION
Improvisation in detection of pomegranate leaf disease using transfer learni...
Training Program for knowledge in solar cell and solar industry
AI.gov: A Trojan Horse in the Age of Artificial Intelligence
Early detection and classification of bone marrow changes in lumbar vertebrae...
Microsoft User Copilot Training Slide Deck
Lung cancer patients survival prediction using outlier detection and optimize...
sustainability-14-14877-v2.pddhzftheheeeee
NewMind AI Weekly Chronicles – August ’25 Week IV
Internet of Everything -Basic concepts details
Produktkatalog für HOBO Datenlogger, Wetterstationen, Sensoren, Software und ...
Galois Field Theory of Risk: A Perspective, Protocol, and Mathematical Backgr...
“A New Era of 3D Sensing: Transforming Industries and Creating Opportunities,...

Data representation

  • 1. Chapter 2 Data Representation • Data Representation • Compliments • Subtraction of Unsigned Numbers using r’s complement • How To Represent Signed Numbers • Floating-Point Representation
  • 2. Data Types • The data types stored in digital computers may be classified as being one of the following categories: 1. numbers used in arithmetic computations, 2. letters of the alphabet used in data processing, and 3. other discrete symbols used for specific purposes. All types of data are represented in computers in binary-coded form.
  • 3. Binary Numbers • Binary numbers are made of binary digits (bits): 0 and 1 • Convert the following to decimal (1011)2 = 1x23 + 0x22 + 1x21 + 1x20 = (11)10
  • 4. Example • Use radix representation to convert the binary number (101.01) into decimal. • The position value is power of 2 • 1 0 1. 0 1 • • 22 21 20 2-1 2-2 • 4 + 0 + 1 + 0 + 1/22 = 5.25 (101.01)2  (5.25)10
  • 5. Converting an Integer from Decimal to Another Base • Divide the decimal number by the base (e.g. • The remainder is the lowest-order digit • Repeat the first two steps until no divisor remains. • For binary the even number has no remainder ‘0’, while the odd has ‘1’ For each digit position:
  • 6. Converting an Integer from Decimal to Another Base Example for (13)10: Integer Quotient 13/2 = (12+1)½ a0 = 1 6/2 = ( 6+0 )½ a1 = 0 3/2 = (2+1 )½ a2 = 1 1/2 = (0+1) ½ a3 = 1 Remainder Coefficient Answer (13)10 = (a3 a2 a1 a0)2 = (1101)2
  • 7. Converting a Fraction from Decimal to Another Base Example for (0.625)10: Integer 0.625 x 2 = 1 + 0.25 a-1 = 1 0.250 x 2 = 0 + 0.50 a-2 = 0 0.500 x 2 = 1 + 0 a-3 = 1 Fraction Coefficient Answer (0.625)10 = (0.a-1 a-2 a-3 )2 = (0.101)2
  • 8. DECIMAL TO BINARY CONVERSION (INTEGER+FRACTION) (1) Separate the decimal number into integer and fraction parts. (2) Repeatedly divide the integer part by 2 to give a quotient and a remainder and Remove the remainder. Arrange the sequence of remainders right to left from the period. (Least significant bit first) (3) Repeatedly multiply the fraction part by 2 to give an integer and a fraction part and remove the integer. Arrange the sequence of integers left to right from the period. (Most significant fraction bit first)
  • 9. (Example) (41.6875)10 (?)2 Integer = 41, Fraction = 0.6875 The first procedure produces 41= 1 x 25 + 0 x 24 + 1 x 23 + 0 x 22 + 0 x 2 + 1 = (101001) 0.6875=0.1011 41.6875 (10) = 101001.1011 (2) Integer remainder 41 /2 1 20 0 10 0 5 1 2 0 1 1 Overflow Fraction X by 2 .6875 1 .3750 0 .750 1 .5 1 0
  • 10. Octal Numbers • Octal numbers (Radix or base=8) are made of octal digits: (0,1,2,3,4,5,6,7) • How many items does an octal number represent? • Convert the following octal number to decimal (465.27)8 = 4x82 + 6x81 + 5x80 + 2x8-1 + 7x8-2
  • 11. Converting an Integer from Decimal to Octal Example for (0.3125)10: Integer 0.3125 x 8 = 2 + 0.5 a-1 = 2 0.5000 x 8 = 4 + 0 a-2 = 4 Fraction Coefficient Answer (0.3125)10 = (0.24)8 Combine the two (175.3125)10 = (257.24)8 Remainder of division Overflow of multiplication
  • 12. Hexadecimal Numbers • Hexadecimal numbers are made of 16 symbols: o (0,1,2,3,4,5,6,7,8,9,A, B, C, D, E, F) • Convert a hexadecimal number to decimal o (3A9F)16 = 3x163 + 10x162 + 9x161 + 15x160 = 1499910 • Hexadecimal with fractions: o (2D3.5)16 = 2x162 + 13x161 + 3x160 + 5x16-1 = 723.312510 • Note that each hexadecimal digit can be represented with four bits. o (1110) 2 = (E)16 • Groups of four bits are called a nibble. o (1110) 2
  • 13. Example • Convert the decimal number (107.00390625)10 into hexadecimal number. • (107.00390625)10  (6B.01)16 Integer remainde r 107 Divide/16 6 11=B 0 6 Overflow Fraction X by 16 . 00390625 0 .0625 1 .0000 . Closer to the period
  • 14. Conversion Between Number Bases Decimal(base 10) Octal(base 8) Binary(base 2) Hexadecimal (base16) ° We normally convert to base 10 because we are naturally used to the decimal number system. ° We can also convert to other number systems
  • 15. One to one comparison • Binary, octal, and hexadecimal similar • Easy to build circuits to operate on these representations • Possible to convert between the three formats
  • 16. Converting between Base 16 and Base 2 ° Conversion is easy!  Determine 4-bit value for each hex digit ° Note that there are 24 = 16 different values of four bits which means each 16 value is converted to four binary bits. ° Easier to read and write in hexadecimal. ° Representations are equivalent! 3A9F16 = 0011 1010 1001 11112 3 A 9 F
  • 17. Converting between Base 16 and Base 8 1. Convert from Base 16 to Base 2 2. Regroup bits into groups of three starting from right 3. Ignore leading zeros 4. Each group of three bits forms an octal digit (8 is represented by 3 binary bits). 352378 = 011 101 010 011 1112 5 2 3 73 3A9F16 = 0011 1010 1001 11112 3 A 9 F
  • 18. Example Convert 101011110110011 to a. octal number b. hexadecimal number a. Each 3 bits are converted to octal : (101) (011) (110) (110) (011) 5 3 6 6 3 101011110110011 = (53663)8 b. Each 4 bits are converted to hexadecimal: (0101) (0111) (1011) (0011) 5 7 B 3 101011110110011 = (57B3)16 Conversion from binary to hexadecimal is similar except that the bits divided into groups of four.
  • 20. Subtraction using addition • Conventional addition (using carry) is easily • implemented in digital computers. • However; subtraction by borrowing is difficult and inefficient for digital computers. • Much more efficient to implement subtraction using ADDITION OF the COMPLEMENTS of numbers.
  • 21. Binary Addition 1 1 1 1 0 1 + 1 0 1 1 1 --------------------- 0 1 0 1 1 1111 1 1 00 carries Example Add (11110)2 to (10111)2 (111101)2 + (10111) 2 = (1010100)2 carry
  • 22. Binary Subtraction • We can also perform subtraction (with borrows). • Example: subtract (10111) from (1001101) 1 10 0 10 10 0 0 10 1 0 0 1 1 0 1 - 1 0 1 1 1 ------------------------ 0 1 1 0 1 1 0 borrows 1+1= 2 (1001101)2 - (10111)2 = (0110110)2
  • 23. The complement 1’s of 1011001 is 0100110 0 1 1 0 0- 1 1 1 1 1 1 1 1 0 0 1 1 0 0 0 1 1 1- 1 1 1 1 1 1 1 1 1 0 0 0 0 1 1 0 The 1’s complement of 0001111 is 1110000 0 1 1 l’s complement
  • 24. For binary numbers, r = 2, r’s complement is the 2’s complement. The 2’s complement of N is 2n - N. 2’s complement Digit n Digit n-1 Next digit Next digit First digit 0 0 0 0 0 - 1
  • 25. 2’s complement Example The 2’s complement of 1011001 is 0100111 The 2’s complement of 0001111 is 1110001 0 1 1 0 0- 1 0 0 0 0 0 0 1 0 0 1 1 1 0 0 1 1 1- 1 1 1 0 0 0 1 1 0 0 0 1 1 0 0 0 0 0 001
  • 26. Fast Methods for 2’s Complement Method 1: The 2’s complement of binary number is obtained by adding 1 to the l’s complement value. Example: 1’s complement of 101100 is 010011 (invert the 0’s and 1’s) 2’s complement of 101100 is 010011 + 1 = 010100
  • 27. Fast Methods for 2’s Complement Method 2: The 2’s complement can be formed by leaving all least significant 0’s and the first 1 unchanged, and then replacing l’s by 0’s and 0’s by l’s in all other higher significant bits. Example: The 2’s complement of 1101100 is 0010100 Leave the two low-order 0’s and the first 1 unchanged, and then replacing 1’s by 0’s and 0’s by 1’s in the four most significant bits.
  • 28. Examples o Finding the 2’s complement of (01100101)2 • Method 1 – Simply complement each bit and then add 1 to the result. (01100101)2 [N] = 2’s complement = 1’s complement (10011010)2 +1 =(10011011)2 • Method 2 – Starting with the least significant bit, copy all the bits up to and including the first 1 bit and then complement the remaining bits. N = 0 1 1 0 0 1 0 1 [N] = 1 0 0 1 1 0 1 1