SlideShare a Scribd company logo
4
Most read
5
Most read
10
Most read
Unit 3 – Data representation
65
Denary to Binary
Start by writing out the place values.
1248163264128
Then write 1s underneath the place values that add up to the
denary number.
0 1 0 0 0 0 0 1
64 16 1+ + = 81
Binary to Denary
0 1 0 1 0 0 0 1
Start by writing the place values above each bit.
1248163264128
Then write out the place values of the 1s.
Finally add the numbers together.
Binary Addition
The process of performing addition in binary is very similar to
addition in denary.
1 1 1 1
0 1 1 0 1
0 0 1 1 1 +
1 0 1 0 0
Rules:
0 + 0 = 0
0 + 1 = 1
1 + 1 = 0 carry 1
1 + 1 + 1 = 1 carry 1
0 1 1 0 0
1 0 1 1 1 +
1 1 1 0 0
1 0 1 0 1 +
Overflow
When there isn’t enough room for a result, this is called an
overflow and it produces an overflow error.
1 1 1 1
1 1 1 0 1
1 1 0 1 1 1 +
1 1 0 1 0 0
No room for a carry, so it is lost and we get the wrong answer.
Humans can easily work around this, but it isn’t so easy for a
computer.
Binary Subtraction
The process of performing subtraction in binary is very similar
to subtraction in denary.
1 1 0 0
0 1 0 0 -
1 0 0 0
Rule:
0 - 1 won’t go so borrow 10 (2) from the column to the left. 2 - 1 = 1.
10 10
1 1 0 1
0 1 1 1 -
0 1 1 0
1 1 1 0
0 1 0 1 -
Sign and Magnitude
This is the simplest method of representing negative numbers
in binary. The most significant bit is the ‘sign bit’.
Sign bit 128 64 32 16 8 4 2 1
0 0 0 0 1 1 0 1 1 +27
1 0 0 0 1 1 0 1 1 -27
1 = minus 0 = plus
The Problem with Sign and Magnitude
The problem with sign and magnitude is that addition doesn’t
always work.
0 0 0 0 0 1 1 1 (+7)
1 0 0 0 0 1 0 1 (-5) +
1 0 0 0 1 1 0 0 (-12)
Two’s Complement
Two’s complement is an alternative method of representing
negative numbers. This method works with binary addition.
The most significant bit is a minus number.
-128 64 32 16 8 4 2 1
1 0 0 0 1 1 0 1
-128 + 8 + 4 + 1 = -115
Floating Point Numbers
In binary floating point numbers are split into two parts; the
Mantissa and the Exponent.
Mantissa Exponent
0111 1000 0000 0011
0 . 1 1 1 1 0 0 0
The mantissa contains the actual number and the exponent
defines the position of the binary point.
Floating Point Numbers
The numbers to the right of the binary point define the
fraction.
0 1 1 1 . 1 0 0 0
In denary the number above is:
7 ½
1/2 1/4 1/8 1/16
8/16 4/16 2/16 1/16
Hexadecimal
Programmers often use hexadecimal numbers as a shorthand
for binary to save time. Hexadecimal (hex) numbers are based
on the number 16. Each column has a value 16 times that of
the one on its right.
place value 256 16 1
There are 16 different values available in hex:
Letters are used for values 10-15 to ensure that only single
digits are used.
0 1 2 3 4 5 6 7 8 9 A B C D E F
Hexadecimal to Binary
Converting between hexadecimal and binary is particularly easy. You
just take each character and convert it into the equivalent binary
number.
Hex D B
Denary 13 11
Binary 1 1 0 1 1 0 1 1
In this example we will convert DB hex to binary.
Binary to Hexadecimal
You convert between binary and hexadecimal by doing the reverse.
You just take each group of four binary digits, starting from the
right and convert it into the equivalent hex number.
Binary 1 1 1 1 0 0 1 1
Hex F 3
In this example we will convert 11110011 to hexadecimal:

More Related Content

PPTX
Binary codes
Neha Jamini
 
PDF
Binary Arithmetic Operations
Digital System Design
 
PPTX
Complements of numbers
Kiriti Varkur
 
PPT
Data representation
shashikant pabari
 
DOCX
Best,worst,average case .17581556 045
university of Gujrat, pakistan
 
PPSX
Number system
Gagan Deep
 
PPTX
Number system....
mshoaib15
 
PPTX
Codes
Meenakshi Paul
 
Binary codes
Neha Jamini
 
Binary Arithmetic Operations
Digital System Design
 
Complements of numbers
Kiriti Varkur
 
Data representation
shashikant pabari
 
Best,worst,average case .17581556 045
university of Gujrat, pakistan
 
Number system
Gagan Deep
 
Number system....
mshoaib15
 

What's hot (20)

PPTX
Computer number systems
Revi Shahini
 
PPTX
Number system conversion
Kawsar Hamid Sumon
 
PPT
Arithmetic Logic Unit (ALU)
Student
 
PPT
Number system
kashee99
 
PPTX
Lecture 2 data structures and algorithms
Aakash deep Singhal
 
PPT
Complements
Sudheesh S Madhav
 
PPT
1’s and 2’s complements
arunachalamr16
 
PPTX
Microprocessor - Intel Pentium Series
Laguna State Polytechnic University
 
PPTX
Number System
itutor
 
PPTX
Computer arithmetic
Balakrishna Chowdary
 
PDF
Data representation
Prof. Dr. K. Adisesha
 
PPT
W 9 numbering system
Institute of Management Studies UOP
 
PPTX
Number system and its conversions
ShilpaKrishna6
 
PDF
Computer data representation (integers, floating-point numbers, text, images,...
ArtemKovera
 
PDF
Binary codes
GargiKhanna1
 
PPT
Complement
Sudheesh S Madhav
 
PPSX
Fixed point and floating-point numbers
MOHAN MOHAN
 
PPTX
Floating point arithmetic operations (1)
cs19club
 
PPTX
Quick tutorial on IEEE 754 FLOATING POINT representation
Ritu Ranjan Shrivastwa
 
PPTX
Bcd
Talha Fazal
 
Computer number systems
Revi Shahini
 
Number system conversion
Kawsar Hamid Sumon
 
Arithmetic Logic Unit (ALU)
Student
 
Number system
kashee99
 
Lecture 2 data structures and algorithms
Aakash deep Singhal
 
Complements
Sudheesh S Madhav
 
1’s and 2’s complements
arunachalamr16
 
Microprocessor - Intel Pentium Series
Laguna State Polytechnic University
 
Number System
itutor
 
Computer arithmetic
Balakrishna Chowdary
 
Data representation
Prof. Dr. K. Adisesha
 
Number system and its conversions
ShilpaKrishna6
 
Computer data representation (integers, floating-point numbers, text, images,...
ArtemKovera
 
Binary codes
GargiKhanna1
 
Complement
Sudheesh S Madhav
 
Fixed point and floating-point numbers
MOHAN MOHAN
 
Floating point arithmetic operations (1)
cs19club
 
Quick tutorial on IEEE 754 FLOATING POINT representation
Ritu Ranjan Shrivastwa
 
Ad

Viewers also liked (6)

DOCX
La cuarta generación
Gabriel Alonso
 
PDF
Bookmarking App
Megan Riley
 
PPTX
Лекц-7
Chinzorig Undarmaa
 
PPTX
Uppslag framtidsutredningens delrapport
Framtidsutredningen
 
PDF
John Tokarz- Psyc 494- Auditory Popout in Relation to Timbre
Jack Tokarz
 
PDF
vevcsvd
Sergii Perun
 
La cuarta generación
Gabriel Alonso
 
Bookmarking App
Megan Riley
 
Лекц-7
Chinzorig Undarmaa
 
Uppslag framtidsutredningens delrapport
Framtidsutredningen
 
John Tokarz- Psyc 494- Auditory Popout in Relation to Timbre
Jack Tokarz
 
vevcsvd
Sergii Perun
 
Ad

Similar to Unit 3 Data Representation (20)

PDF
3.4
Samimvez
 
PPTX
09 binary number systems
Lee Chadwick
 
PDF
As Level Computer Science Book -1
DIGDARSHAN KUNWAR
 
DOCX
HexaDecimal-Number-Syatem-Use.-from-computer-science-subject-code-2210.docx
Orin18
 
PPT
08. Numeral Systems
Intro C# Book
 
PPTX
ELECTRICAL 411 L1 Digital Electronics.pptx
mayorsamuel73
 
PPTX
Computer Oraganizaation.pptx
bmangesh
 
PPTX
Switching Theory and Logic Circuits-LEC.pptx
JonathanCasilla3
 
PPTX
Data Representation from knowledge center
rtech777r
 
PDF
Digital and Logic Design Chapter 1 binary_systems
Imran Waris
 
PPT
Lec 02 data representation part 1
Abdul Khan
 
PPT
Integer Representation
gavhays
 
PPT
IS 139 Lecture 4 - 2015
Aron Kondoro
 
PPT
IS 139 Lecture 4
wajanga
 
PPT
1. basic theories of information
'Cedrick SuperGreenilistic Expialidocious Antonino
 
PPT
Number Systems.ppt
zorogoh2
 
PPTX
data representation
Haroon_007
 
PPTX
Representation Of Numbers and Characters
Shaikh Kamrul Islam (Konok kamrul)
 
PPT
digitalelectronics.ppt
HarshalVaidya11
 
PDF
Chapter 1 digital systems and binary numbers
Mohammad Bashartullah
 
09 binary number systems
Lee Chadwick
 
As Level Computer Science Book -1
DIGDARSHAN KUNWAR
 
HexaDecimal-Number-Syatem-Use.-from-computer-science-subject-code-2210.docx
Orin18
 
08. Numeral Systems
Intro C# Book
 
ELECTRICAL 411 L1 Digital Electronics.pptx
mayorsamuel73
 
Computer Oraganizaation.pptx
bmangesh
 
Switching Theory and Logic Circuits-LEC.pptx
JonathanCasilla3
 
Data Representation from knowledge center
rtech777r
 
Digital and Logic Design Chapter 1 binary_systems
Imran Waris
 
Lec 02 data representation part 1
Abdul Khan
 
Integer Representation
gavhays
 
IS 139 Lecture 4 - 2015
Aron Kondoro
 
IS 139 Lecture 4
wajanga
 
1. basic theories of information
'Cedrick SuperGreenilistic Expialidocious Antonino
 
Number Systems.ppt
zorogoh2
 
data representation
Haroon_007
 
Representation Of Numbers and Characters
Shaikh Kamrul Islam (Konok kamrul)
 
digitalelectronics.ppt
HarshalVaidya11
 
Chapter 1 digital systems and binary numbers
Mohammad Bashartullah
 

More from Miss Short (12)

PPTX
Creative iMedia Outline
Miss Short
 
PPTX
GCSE Computer Science Outline
Miss Short
 
PPTX
CIDA Digital Applications Outline
Miss Short
 
PPTX
Creative iMedia
Miss Short
 
PPTX
GCSE Computer Science
Miss Short
 
PPTX
CIDA Digital Applications
Miss Short
 
PPTX
B.1
Miss Short
 
PPTX
A2 1
Miss Short
 
PPTX
A.2
Miss Short
 
PPTX
Lan
Miss Short
 
PPTX
Network topologies
Miss Short
 
PPTX
Databases
Miss Short
 
Creative iMedia Outline
Miss Short
 
GCSE Computer Science Outline
Miss Short
 
CIDA Digital Applications Outline
Miss Short
 
Creative iMedia
Miss Short
 
GCSE Computer Science
Miss Short
 
CIDA Digital Applications
Miss Short
 
Network topologies
Miss Short
 
Databases
Miss Short
 

Recently uploaded (20)

PPTX
Introduction to pediatric nursing in 5th Sem..pptx
AneetaSharma15
 
DOCX
Action Plan_ARAL PROGRAM_ STAND ALONE SHS.docx
Levenmartlacuna1
 
PPTX
Artificial-Intelligence-in-Drug-Discovery by R D Jawarkar.pptx
Rahul Jawarkar
 
PDF
2.Reshaping-Indias-Political-Map.ppt/pdf/8th class social science Exploring S...
Sandeep Swamy
 
PDF
Types of Literary Text: Poetry and Prose
kaelandreabibit
 
PPTX
FSSAI (Food Safety and Standards Authority of India) & FDA (Food and Drug Adm...
Dr. Paindla Jyothirmai
 
PPTX
Python-Application-in-Drug-Design by R D Jawarkar.pptx
Rahul Jawarkar
 
PPTX
CONCEPT OF CHILD CARE. pptx
AneetaSharma15
 
PPTX
Dakar Framework Education For All- 2000(Act)
santoshmohalik1
 
PDF
The Minister of Tourism, Culture and Creative Arts, Abla Dzifa Gomashie has e...
nservice241
 
PDF
BÀI TẬP TEST BỔ TRỢ THEO TỪNG CHỦ ĐỀ CỦA TỪNG UNIT KÈM BÀI TẬP NGHE - TIẾNG A...
Nguyen Thanh Tu Collection
 
PDF
The Picture of Dorian Gray summary and depiction
opaliyahemel
 
PPTX
An introduction to Dialogue writing.pptx
drsiddhantnagine
 
PDF
Review of Related Literature & Studies.pdf
Thelma Villaflores
 
PDF
The-Invisible-Living-World-Beyond-Our-Naked-Eye chapter 2.pdf/8th science cur...
Sandeep Swamy
 
PDF
Antianginal agents, Definition, Classification, MOA.pdf
Prerana Jadhav
 
PDF
RA 12028_ARAL_Orientation_Day-2-Sessions_v2.pdf
Seven De Los Reyes
 
PPT
Python Programming Unit II Control Statements.ppt
CUO VEERANAN VEERANAN
 
PDF
What is CFA?? Complete Guide to the Chartered Financial Analyst Program
sp4989653
 
PDF
Virat Kohli- the Pride of Indian cricket
kushpar147
 
Introduction to pediatric nursing in 5th Sem..pptx
AneetaSharma15
 
Action Plan_ARAL PROGRAM_ STAND ALONE SHS.docx
Levenmartlacuna1
 
Artificial-Intelligence-in-Drug-Discovery by R D Jawarkar.pptx
Rahul Jawarkar
 
2.Reshaping-Indias-Political-Map.ppt/pdf/8th class social science Exploring S...
Sandeep Swamy
 
Types of Literary Text: Poetry and Prose
kaelandreabibit
 
FSSAI (Food Safety and Standards Authority of India) & FDA (Food and Drug Adm...
Dr. Paindla Jyothirmai
 
Python-Application-in-Drug-Design by R D Jawarkar.pptx
Rahul Jawarkar
 
CONCEPT OF CHILD CARE. pptx
AneetaSharma15
 
Dakar Framework Education For All- 2000(Act)
santoshmohalik1
 
The Minister of Tourism, Culture and Creative Arts, Abla Dzifa Gomashie has e...
nservice241
 
BÀI TẬP TEST BỔ TRỢ THEO TỪNG CHỦ ĐỀ CỦA TỪNG UNIT KÈM BÀI TẬP NGHE - TIẾNG A...
Nguyen Thanh Tu Collection
 
The Picture of Dorian Gray summary and depiction
opaliyahemel
 
An introduction to Dialogue writing.pptx
drsiddhantnagine
 
Review of Related Literature & Studies.pdf
Thelma Villaflores
 
The-Invisible-Living-World-Beyond-Our-Naked-Eye chapter 2.pdf/8th science cur...
Sandeep Swamy
 
Antianginal agents, Definition, Classification, MOA.pdf
Prerana Jadhav
 
RA 12028_ARAL_Orientation_Day-2-Sessions_v2.pdf
Seven De Los Reyes
 
Python Programming Unit II Control Statements.ppt
CUO VEERANAN VEERANAN
 
What is CFA?? Complete Guide to the Chartered Financial Analyst Program
sp4989653
 
Virat Kohli- the Pride of Indian cricket
kushpar147
 

Unit 3 Data Representation

  • 1. Unit 3 – Data representation
  • 2. 65 Denary to Binary Start by writing out the place values. 1248163264128 Then write 1s underneath the place values that add up to the denary number. 0 1 0 0 0 0 0 1
  • 3. 64 16 1+ + = 81 Binary to Denary 0 1 0 1 0 0 0 1 Start by writing the place values above each bit. 1248163264128 Then write out the place values of the 1s. Finally add the numbers together.
  • 4. Binary Addition The process of performing addition in binary is very similar to addition in denary. 1 1 1 1 0 1 1 0 1 0 0 1 1 1 + 1 0 1 0 0 Rules: 0 + 0 = 0 0 + 1 = 1 1 + 1 = 0 carry 1 1 + 1 + 1 = 1 carry 1 0 1 1 0 0 1 0 1 1 1 + 1 1 1 0 0 1 0 1 0 1 +
  • 5. Overflow When there isn’t enough room for a result, this is called an overflow and it produces an overflow error. 1 1 1 1 1 1 1 0 1 1 1 0 1 1 1 + 1 1 0 1 0 0 No room for a carry, so it is lost and we get the wrong answer. Humans can easily work around this, but it isn’t so easy for a computer.
  • 6. Binary Subtraction The process of performing subtraction in binary is very similar to subtraction in denary. 1 1 0 0 0 1 0 0 - 1 0 0 0 Rule: 0 - 1 won’t go so borrow 10 (2) from the column to the left. 2 - 1 = 1. 10 10 1 1 0 1 0 1 1 1 - 0 1 1 0 1 1 1 0 0 1 0 1 -
  • 7. Sign and Magnitude This is the simplest method of representing negative numbers in binary. The most significant bit is the ‘sign bit’. Sign bit 128 64 32 16 8 4 2 1 0 0 0 0 1 1 0 1 1 +27 1 0 0 0 1 1 0 1 1 -27 1 = minus 0 = plus
  • 8. The Problem with Sign and Magnitude The problem with sign and magnitude is that addition doesn’t always work. 0 0 0 0 0 1 1 1 (+7) 1 0 0 0 0 1 0 1 (-5) + 1 0 0 0 1 1 0 0 (-12)
  • 9. Two’s Complement Two’s complement is an alternative method of representing negative numbers. This method works with binary addition. The most significant bit is a minus number. -128 64 32 16 8 4 2 1 1 0 0 0 1 1 0 1 -128 + 8 + 4 + 1 = -115
  • 10. Floating Point Numbers In binary floating point numbers are split into two parts; the Mantissa and the Exponent. Mantissa Exponent 0111 1000 0000 0011 0 . 1 1 1 1 0 0 0 The mantissa contains the actual number and the exponent defines the position of the binary point.
  • 11. Floating Point Numbers The numbers to the right of the binary point define the fraction. 0 1 1 1 . 1 0 0 0 In denary the number above is: 7 ½ 1/2 1/4 1/8 1/16 8/16 4/16 2/16 1/16
  • 12. Hexadecimal Programmers often use hexadecimal numbers as a shorthand for binary to save time. Hexadecimal (hex) numbers are based on the number 16. Each column has a value 16 times that of the one on its right. place value 256 16 1 There are 16 different values available in hex: Letters are used for values 10-15 to ensure that only single digits are used. 0 1 2 3 4 5 6 7 8 9 A B C D E F
  • 13. Hexadecimal to Binary Converting between hexadecimal and binary is particularly easy. You just take each character and convert it into the equivalent binary number. Hex D B Denary 13 11 Binary 1 1 0 1 1 0 1 1 In this example we will convert DB hex to binary.
  • 14. Binary to Hexadecimal You convert between binary and hexadecimal by doing the reverse. You just take each group of four binary digits, starting from the right and convert it into the equivalent hex number. Binary 1 1 1 1 0 0 1 1 Hex F 3 In this example we will convert 11110011 to hexadecimal: