SlideShare uma empresa Scribd logo
1 de 14
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:

Mais conteúdo relacionado

Mais procurados

Number system in Digital Electronics
Number system in Digital ElectronicsNumber system in Digital Electronics
Number system in Digital ElectronicsJanki Shah
 
BINARY NUMBER SYSTEM
BINARY NUMBER SYSTEMBINARY NUMBER SYSTEM
BINARY NUMBER SYSTEMZaheer Abbasi
 
Binaty Arithmetic and Binary coding schemes
Binaty Arithmetic and Binary coding schemesBinaty Arithmetic and Binary coding schemes
Binaty Arithmetic and Binary coding schemesDr. Anita Goel
 
binary number system
 binary number system binary number system
binary number systemvishal gupta
 
Working With Binary Numbers
Working With Binary NumbersWorking With Binary Numbers
Working With Binary Numbersadil raja
 
Floating point presentation
Floating point presentationFloating point presentation
Floating point presentationSnehalataAgasti
 
The binary number system
The binary number systemThe binary number system
The binary number systemShowmmo
 
Number system
Number systemNumber system
Number systemkashee99
 
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 systemISMT College
 
Number system utm notes
Number system utm notesNumber system utm notes
Number system utm notesKurenai Ryu
 
Binary number system
Binary number systemBinary number system
Binary number systemNadeem Uddin
 
Binary octal
Binary octalBinary octal
Binary octaldrdipo4
 
Introduction of number system
Introduction of number systemIntroduction of number system
Introduction of number systemAswiniT3
 

Mais procurados (20)

Number system in Digital Electronics
Number system in Digital ElectronicsNumber system in Digital Electronics
Number system in Digital Electronics
 
BINARY NUMBER SYSTEM
BINARY NUMBER SYSTEMBINARY NUMBER SYSTEM
BINARY NUMBER SYSTEM
 
Data Representation
Data RepresentationData Representation
Data Representation
 
Binaty Arithmetic and Binary coding schemes
Binaty Arithmetic and Binary coding schemesBinaty Arithmetic and Binary coding schemes
Binaty Arithmetic and Binary coding schemes
 
Binary Arithmetic
Binary ArithmeticBinary Arithmetic
Binary Arithmetic
 
binary number system
 binary number system binary number system
binary number system
 
Working With Binary Numbers
Working With Binary NumbersWorking With Binary Numbers
Working With Binary Numbers
 
Floating point presentation
Floating point presentationFloating point presentation
Floating point presentation
 
Signed Binary Numbers
Signed Binary NumbersSigned Binary Numbers
Signed Binary Numbers
 
The binary number system
The binary number systemThe binary number system
The binary number system
 
Binary addition
Binary additionBinary addition
Binary addition
 
Slide03 Number System and Operations Part 1
Slide03 Number System and Operations Part 1Slide03 Number System and Operations Part 1
Slide03 Number System and Operations Part 1
 
Number system
Number systemNumber system
Number system
 
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
 
Pp02
Pp02Pp02
Pp02
 
Number system utm notes
Number system utm notesNumber system utm notes
Number system utm notes
 
Binary number system
Binary number systemBinary number system
Binary number system
 
Binary octal
Binary octalBinary octal
Binary octal
 
Isin securities
Isin securitiesIsin securities
Isin securities
 
Introduction of number system
Introduction of number systemIntroduction of number system
Introduction of number system
 

Destaque

Uppslag framtidsutredningens delrapport
Uppslag framtidsutredningens delrapportUppslag framtidsutredningens delrapport
Uppslag framtidsutredningens delrapportFramtidsutredningen
 
John Tokarz- Psyc 494- Auditory Popout in Relation to Timbre
John Tokarz- Psyc 494- Auditory Popout in Relation to TimbreJohn Tokarz- Psyc 494- Auditory Popout in Relation to Timbre
John Tokarz- Psyc 494- Auditory Popout in Relation to TimbreJack Tokarz
 

Destaque (6)

La cuarta generación
La cuarta generaciónLa cuarta generación
La cuarta generación
 
Bookmarking App
Bookmarking AppBookmarking App
Bookmarking App
 
Лекц-7
Лекц-7Лекц-7
Лекц-7
 
Uppslag framtidsutredningens delrapport
Uppslag framtidsutredningens delrapportUppslag framtidsutredningens delrapport
Uppslag framtidsutredningens delrapport
 
John Tokarz- Psyc 494- Auditory Popout in Relation to Timbre
John Tokarz- Psyc 494- Auditory Popout in Relation to TimbreJohn Tokarz- Psyc 494- Auditory Popout in Relation to Timbre
John Tokarz- Psyc 494- Auditory Popout in Relation to Timbre
 
vevcsvd
vevcsvdvevcsvd
vevcsvd
 

Semelhante a Unit 3 Data Representation

Semelhante a Unit 3 Data Representation (20)

As Level Computer Science Book -1
As Level Computer Science  Book -1As Level Computer Science  Book -1
As Level Computer Science Book -1
 
Number bases
Number basesNumber bases
Number bases
 
Introduction to binary
Introduction to binaryIntroduction to binary
Introduction to binary
 
ch2.pdf
ch2.pdfch2.pdf
ch2.pdf
 
Lec 02 data representation part 1
Lec 02 data representation part 1Lec 02 data representation part 1
Lec 02 data representation part 1
 
Number system
Number systemNumber system
Number system
 
Data Representation
Data RepresentationData Representation
Data Representation
 
Representation of Negative Numbers
Representation of Negative NumbersRepresentation of Negative Numbers
Representation of Negative Numbers
 
3.Fixed-Floating Point.ppt
3.Fixed-Floating Point.ppt3.Fixed-Floating Point.ppt
3.Fixed-Floating Point.ppt
 
data representation
 data representation data representation
data representation
 
Number Systems
Number SystemsNumber Systems
Number Systems
 
unit-2_DL.pdf
unit-2_DL.pdfunit-2_DL.pdf
unit-2_DL.pdf
 
Number system by ammar nawab
Number system by ammar nawabNumber system by ammar nawab
Number system by ammar nawab
 
CDS Fundamentals of digital communication system UNIT 1 AND 2.pdf
CDS Fundamentals of digital communication system UNIT 1 AND 2.pdfCDS Fundamentals of digital communication system UNIT 1 AND 2.pdf
CDS Fundamentals of digital communication system UNIT 1 AND 2.pdf
 
Digital electronics
Digital electronicsDigital electronics
Digital electronics
 
Alu1
Alu1Alu1
Alu1
 
Cse 112 number system-[id_142-15-3472]
Cse 112 number system-[id_142-15-3472]Cse 112 number system-[id_142-15-3472]
Cse 112 number system-[id_142-15-3472]
 
DATA REPRESENTATION.pptx
DATA REPRESENTATION.pptxDATA REPRESENTATION.pptx
DATA REPRESENTATION.pptx
 
Number Systems.ppt
Number Systems.pptNumber Systems.ppt
Number Systems.ppt
 
number system
number systemnumber system
number system
 

Mais de Miss Short

Creative iMedia Outline
Creative iMedia OutlineCreative iMedia Outline
Creative iMedia OutlineMiss Short
 
GCSE Computer Science Outline
GCSE Computer Science OutlineGCSE Computer Science Outline
GCSE Computer Science OutlineMiss Short
 
CIDA Digital Applications Outline
CIDA Digital Applications OutlineCIDA Digital Applications Outline
CIDA Digital Applications OutlineMiss Short
 
Creative iMedia
Creative iMediaCreative iMedia
Creative iMediaMiss Short
 
GCSE Computer Science
GCSE Computer ScienceGCSE Computer Science
GCSE Computer ScienceMiss Short
 
CIDA Digital Applications
CIDA Digital ApplicationsCIDA Digital Applications
CIDA Digital ApplicationsMiss Short
 
Network topologies
Network topologiesNetwork topologies
Network topologiesMiss Short
 

Mais de Miss Short (12)

Creative iMedia Outline
Creative iMedia OutlineCreative iMedia Outline
Creative iMedia Outline
 
GCSE Computer Science Outline
GCSE Computer Science OutlineGCSE Computer Science Outline
GCSE Computer Science Outline
 
CIDA Digital Applications Outline
CIDA Digital Applications OutlineCIDA Digital Applications Outline
CIDA Digital Applications Outline
 
Creative iMedia
Creative iMediaCreative iMedia
Creative iMedia
 
GCSE Computer Science
GCSE Computer ScienceGCSE Computer Science
GCSE Computer Science
 
CIDA Digital Applications
CIDA Digital ApplicationsCIDA Digital Applications
CIDA Digital Applications
 
B.1
B.1B.1
B.1
 
A2 1
A2 1A2 1
A2 1
 
A.2
A.2A.2
A.2
 
Lan
LanLan
Lan
 
Network topologies
Network topologiesNetwork topologies
Network topologies
 
Databases
DatabasesDatabases
Databases
 

Último

Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Pooja Bhuva
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxmarlenawright1
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structuredhanjurrannsibayan2
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxDr. Ravikiran H M Gowda
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxPooja Bhuva
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxUmeshTimilsina1
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 

Último (20)

Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 

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: