SlideShare a Scribd company logo
4
Most read
7
Most read
8
Most read
Number Systems
Lecture 2
Binary,
Decimal &
Hexadecimal
Introduction to Number systems
Modern day computers use electricity to work. Inside the microchip electricity
is turned either ON or OFF which is represented by 0’s and 1’s. This is called
binary.
Before we understand how a binary system works, You first need to know how
our age-old numeric system work, i.e, the decimal system or the base 10
numeral system.
Decimal Number system
There are 10 symbols that we
use for counting our numbers
they are 0,1,2,3,4,5,6,7,8,9.
We then use this same
symbol over and over again
in a very clever system called
the positional notation.
As soon as we reach 10 or an
exponent of 10 , we add
another digit to the left of our
current digit.
Base 10 representation of a number
Binary Number System
What if we have only 2 numbers
instead of 10 to work with?
Binary works exact the same way as
Base 10 numeral system.
Base 10 Greater than 9 = New Digit
Base 2 Greater than 1 = New Digit
So, It goes like this
1
10
11
100
101
110
111
1000
1001
1010
1011
1100
1101
1110
1111
Since in Binary
system each digit
can have only 2
values. Each
additional digit
represents an
increasing power of
2 rather than
increasing power of
10
Base 2 representation of a number
Easy way of Converting
decimal to binary
A half byte is called a Nibble. i.e 4
Bits. With 4 bits we can use 16
different combinations of 0’s and 1’s.
Since the decimal numbers are from 0-
9, 10 symbols in total , all of them can
be represented in 4 bits. Write the
value of exponent form of 2 from 2^0
- 2^3 in one row.For 1, in the column
that has 2^0. Determine the power of 2
which sum upto the given digit, add
1’s to the one you have used and 0’s to
the ones which you have not used. For
example for 5, 4+1 makes 5, so write a
1 under 2^2 and 2^0 and 0 under 2^1
and 2^3, this make 0101.
8 4 2 1
0 0 0 0 0
1 0 0 0 1
2 0 0 1 0
3 0 0 1 1
4 0 1 0 0
5 0 1 0 1
6 0 1 1 0
7 0 1 1 1
8 1 0 0 0
9 1 0 0 1
2^3 2^2 2^1 2^0
Why Hexadecimal?
In microprocessors and microcontrollers we deal with hexadecimal system. Everyone might
wonder why we are ditching the good-old decimal system.
There is a lot of explanation to it. By now, You are pretty clear about the decimal system and
the conversion of decimal to binary.
In the previous slide we found that with 4 bits, we can make upto 16 combinations of 0’s and
1’s. But with Base 10 system , we are restricted to 10 combinations and 6 more are going for a
toss and then the concept of Base 16 system was created.
6 combinations , they don’t have an equivalent representation in binary. These 6 combinations
from 10-15 are represented in hexadecimal as A-F.
Hexadecimal Advantage Every possible binary combination has now
representation.On a single digit you are getting 16
values. That’s more information in less space.
There came a need for a new system which represents 16
symbols, that is why base 16 system was created where
0-9 is represented as it is and from 10-15, is represented
A-F.
You may wonder why not just decimal, why
hexadecimal. The highest four digit number if 9999, byt
in hexa it if FFFF which is close to 50,000 more
representation in form of data.
Both are using the same space but more information is
given only in hexadecimal system
Hexadecimal in Microcontrollers
1. In computers, we do not use the decimal system, It's only for the real world.
2. Inside the computer everything is in the form of binary, but it is not the binary form
of decimal numbers but the binary form of hexadecimal numbers. So, that you can
represent the combination of every 4 bits.
So, let’s take some examples for easy conversion of Hexadecimal to binary
1. 35H
8 4 2 1 8 4 2 1
0 0 1 1 0 1 0 1
3 5
Try these.. For every digit you represent four bits. In microprocessor
everything is represented in Hexadecimal, so each digit
has to be converted to binary with 4 bits allocated for
each digit.
So, the numbers on the left require totally 8its. In uC we
come across 8bit and 16bit numbers every time. So, what
the range of an 8 bit number in hexadecimal 00 H -FF H.
Which in decimal is -0-255 . Likewise for a 16 bit
number is 0000 H - FFFF H , i.e. 0-65535
74 H
93 H
FF H
Find 8-bit or 16-Bit number
25 H
5140 H
809 H
245 H
30 H
5136 H
Powers of 2
Bits, Bytes and
More
2^0 1
2^1 2
2^2 4
2^3 8
2^4 16
2^5 32
2^6 64
2^7 128
2^8 256
2^9 512
2^10 1024
2^10 is 1024 and also called as 1KBytes.
2^20 = 2^10 * 2^10 = 1Kb * 1Kb = 1Mb
2^30 = 2^10 * 2^20 = 1Kb * 1Mb = 1Gb
2^40 = 2^20 * 2^20 = 1Mb * 1Mb = 1Tb
So, when i say 4 Gb , what it means
2^2 * 2^30 = 2^32 Gb
When said 2^36 it means 2^6 *2^30 = 64Gb
256Gb = 2^8*2^30 = 2^38
2^11 2Kb
2^12 4Kb
2^13 8Kb
2^14 16Kb
2^15 32Kb
2^16 64Kb
2^17 128Kb
2^18 256Kb
2^19 512Kb
2^20 1Mb
2^21 2Mb
Thank You

More Related Content

What's hot (20)

PPT
BINARY NUMBER SYSTEM
Zaheer Abbasi
 
PPTX
Number System & Data Representation
Phillip Glenn Libay
 
PPTX
Generation of computers
Priya Soni
 
PPT
Binary ppt tr
tomrussso
 
PPTX
Digital literacy types of computers
mrspetty19
 
PPT
Using Information Technology Ch 1
Mazhar Masood
 
PPT
W 9 numbering system
Institute of Management Studies UOP
 
PPTX
11 octal number system
Lee Chadwick
 
PPT
Introduction to Microsoft Excel for beginners
Blogger Mumma
 
PPTX
Number system
Palash Sachan
 
PPTX
Computer Science Class 11 India PPT
Rat Devil
 
PPT
Keyboarding skills
joy grace bagui
 
PPTX
Conversion binary to decimal
Marizza Dizon Magallanes Jimenez
 
PPTX
Number System in CoMpUtEr
vishal bansal
 
PPTX
Data representation in computers
Hazel Anne Quirao
 
PPT
Binary code - Beginning
Debbie Eitner
 
PPSX
Basic of number system
Akhilesh Maithani
 
PDF
Microsoft word exercises
Subeesh Up
 
PPT
Application software
Zaid Hameed
 
PPT
Number System
Web Designer
 
BINARY NUMBER SYSTEM
Zaheer Abbasi
 
Number System & Data Representation
Phillip Glenn Libay
 
Generation of computers
Priya Soni
 
Binary ppt tr
tomrussso
 
Digital literacy types of computers
mrspetty19
 
Using Information Technology Ch 1
Mazhar Masood
 
11 octal number system
Lee Chadwick
 
Introduction to Microsoft Excel for beginners
Blogger Mumma
 
Number system
Palash Sachan
 
Computer Science Class 11 India PPT
Rat Devil
 
Keyboarding skills
joy grace bagui
 
Conversion binary to decimal
Marizza Dizon Magallanes Jimenez
 
Number System in CoMpUtEr
vishal bansal
 
Data representation in computers
Hazel Anne Quirao
 
Binary code - Beginning
Debbie Eitner
 
Basic of number system
Akhilesh Maithani
 
Microsoft word exercises
Subeesh Up
 
Application software
Zaid Hameed
 
Number System
Web Designer
 

Similar to Binary, Decimal and Hexadecimal (20)

PPT
Cit 1101 lec 02
sohag sikder
 
PPT
ENG241-Week1-NumberSystemsaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
bao201875
 
PPT
08. Numeral Systems
Intro C# Book
 
PPT
2. Computer_Organization_unit_ 1_win.ppt
hfaymsgya9
 
PPTX
Digital Logic Design.pptx
AminaZahid16
 
PDF
Number system
JohnasDalusong1
 
PDF
Digital electronics number system notes
PRASHANTDUBEY114
 
PPTX
Number-Systems presentation of the mathematics
shivas379526
 
DOC
Chapter 4--Data representation Method.doc
fikadumeuedu
 
DOCX
HexaDecimal-Number-Syatem-Use.-from-computer-science-subject-code-2210.docx
Orin18
 
PPT
IS 139 Lecture 4 - 2015
Aron Kondoro
 
PPT
IS 139 Lecture 4
wajanga
 
PPT
Digital Logic Design lec 2 slide.ppt DLD Lec 1.ppt
humairafatima22
 
PDF
Number Systems
Infinity Tech Solutions
 
PPT
1. basic theories of information
'Cedrick SuperGreenilistic Expialidocious Antonino
 
PPTX
Number_systems_for _o_& _A_levels by fari
Fari84
 
PPTX
Psychology presentation for students basic and easy
mbazil2005
 
PPTX
Number system by ammar nawab
Ammar_n
 
Cit 1101 lec 02
sohag sikder
 
ENG241-Week1-NumberSystemsaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
bao201875
 
08. Numeral Systems
Intro C# Book
 
2. Computer_Organization_unit_ 1_win.ppt
hfaymsgya9
 
Digital Logic Design.pptx
AminaZahid16
 
Number system
JohnasDalusong1
 
Digital electronics number system notes
PRASHANTDUBEY114
 
Number-Systems presentation of the mathematics
shivas379526
 
Chapter 4--Data representation Method.doc
fikadumeuedu
 
HexaDecimal-Number-Syatem-Use.-from-computer-science-subject-code-2210.docx
Orin18
 
IS 139 Lecture 4 - 2015
Aron Kondoro
 
IS 139 Lecture 4
wajanga
 
Digital Logic Design lec 2 slide.ppt DLD Lec 1.ppt
humairafatima22
 
Number Systems
Infinity Tech Solutions
 
1. basic theories of information
'Cedrick SuperGreenilistic Expialidocious Antonino
 
Number_systems_for _o_& _A_levels by fari
Fari84
 
Psychology presentation for students basic and easy
mbazil2005
 
Number system by ammar nawab
Ammar_n
 
Ad

Recently uploaded (20)

PDF
MAD Unit - 2 Activity and Fragment Management in Android (Diploma IT)
JappanMavani
 
PPTX
Lecture 1 Shell and Tube Heat exchanger-1.pptx
mailforillegalwork
 
PDF
Water Industry Process Automation & Control Monthly July 2025
Water Industry Process Automation & Control
 
PDF
smart lot access control system with eye
rasabzahra
 
PDF
AI TECHNIQUES FOR IDENTIFYING ALTERATIONS IN THE HUMAN GUT MICROBIOME IN MULT...
vidyalalltv1
 
PPTX
Knowledge Representation : Semantic Networks
Amity University, Patna
 
PPTX
The Role of Information Technology in Environmental Protectio....pptx
nallamillisriram
 
PDF
Viol_Alessandro_Presentazione_prelaurea.pdf
dsecqyvhbowrzxshhf
 
PPT
PPT2_Metal formingMECHANICALENGINEEIRNG .ppt
Praveen Kumar
 
PDF
Basic_Concepts_in_Clinical_Biochemistry_2018كيمياء_عملي.pdf
AdelLoin
 
PPTX
2025 CGI Congres - Surviving agile v05.pptx
Derk-Jan de Grood
 
PPTX
DATA BASE MANAGEMENT AND RELATIONAL DATA
gomathisankariv2
 
PPTX
MATLAB : Introduction , Features , Display Windows, Syntax, Operators, Graph...
Amity University, Patna
 
PDF
Zilliz Cloud Demo for performance and scale
Zilliz
 
PPTX
Solar Thermal Energy System Seminar.pptx
Gpc Purapuza
 
PPTX
265587293-NFPA 101 Life safety code-PPT-1.pptx
chandermwason
 
PPT
Electrical Safety Presentation for Basics Learning
AliJaved79382
 
PDF
Electrical Engineer operation Supervisor
ssaruntatapower143
 
PDF
Introduction to Productivity and Quality
মোঃ ফুরকান উদ্দিন জুয়েল
 
PDF
PORTFOLIO Golam Kibria Khan — architect with a passion for thoughtful design...
MasumKhan59
 
MAD Unit - 2 Activity and Fragment Management in Android (Diploma IT)
JappanMavani
 
Lecture 1 Shell and Tube Heat exchanger-1.pptx
mailforillegalwork
 
Water Industry Process Automation & Control Monthly July 2025
Water Industry Process Automation & Control
 
smart lot access control system with eye
rasabzahra
 
AI TECHNIQUES FOR IDENTIFYING ALTERATIONS IN THE HUMAN GUT MICROBIOME IN MULT...
vidyalalltv1
 
Knowledge Representation : Semantic Networks
Amity University, Patna
 
The Role of Information Technology in Environmental Protectio....pptx
nallamillisriram
 
Viol_Alessandro_Presentazione_prelaurea.pdf
dsecqyvhbowrzxshhf
 
PPT2_Metal formingMECHANICALENGINEEIRNG .ppt
Praveen Kumar
 
Basic_Concepts_in_Clinical_Biochemistry_2018كيمياء_عملي.pdf
AdelLoin
 
2025 CGI Congres - Surviving agile v05.pptx
Derk-Jan de Grood
 
DATA BASE MANAGEMENT AND RELATIONAL DATA
gomathisankariv2
 
MATLAB : Introduction , Features , Display Windows, Syntax, Operators, Graph...
Amity University, Patna
 
Zilliz Cloud Demo for performance and scale
Zilliz
 
Solar Thermal Energy System Seminar.pptx
Gpc Purapuza
 
265587293-NFPA 101 Life safety code-PPT-1.pptx
chandermwason
 
Electrical Safety Presentation for Basics Learning
AliJaved79382
 
Electrical Engineer operation Supervisor
ssaruntatapower143
 
Introduction to Productivity and Quality
মোঃ ফুরকান উদ্দিন জুয়েল
 
PORTFOLIO Golam Kibria Khan — architect with a passion for thoughtful design...
MasumKhan59
 
Ad

Binary, Decimal and Hexadecimal

  • 3. Introduction to Number systems Modern day computers use electricity to work. Inside the microchip electricity is turned either ON or OFF which is represented by 0’s and 1’s. This is called binary. Before we understand how a binary system works, You first need to know how our age-old numeric system work, i.e, the decimal system or the base 10 numeral system.
  • 4. Decimal Number system There are 10 symbols that we use for counting our numbers they are 0,1,2,3,4,5,6,7,8,9. We then use this same symbol over and over again in a very clever system called the positional notation. As soon as we reach 10 or an exponent of 10 , we add another digit to the left of our current digit.
  • 6. Binary Number System What if we have only 2 numbers instead of 10 to work with? Binary works exact the same way as Base 10 numeral system. Base 10 Greater than 9 = New Digit Base 2 Greater than 1 = New Digit So, It goes like this 1 10 11 100 101 110 111 1000 1001 1010 1011 1100 1101 1110 1111 Since in Binary system each digit can have only 2 values. Each additional digit represents an increasing power of 2 rather than increasing power of 10
  • 7. Base 2 representation of a number
  • 8. Easy way of Converting decimal to binary A half byte is called a Nibble. i.e 4 Bits. With 4 bits we can use 16 different combinations of 0’s and 1’s. Since the decimal numbers are from 0- 9, 10 symbols in total , all of them can be represented in 4 bits. Write the value of exponent form of 2 from 2^0 - 2^3 in one row.For 1, in the column that has 2^0. Determine the power of 2 which sum upto the given digit, add 1’s to the one you have used and 0’s to the ones which you have not used. For example for 5, 4+1 makes 5, so write a 1 under 2^2 and 2^0 and 0 under 2^1 and 2^3, this make 0101. 8 4 2 1 0 0 0 0 0 1 0 0 0 1 2 0 0 1 0 3 0 0 1 1 4 0 1 0 0 5 0 1 0 1 6 0 1 1 0 7 0 1 1 1 8 1 0 0 0 9 1 0 0 1 2^3 2^2 2^1 2^0
  • 9. Why Hexadecimal? In microprocessors and microcontrollers we deal with hexadecimal system. Everyone might wonder why we are ditching the good-old decimal system. There is a lot of explanation to it. By now, You are pretty clear about the decimal system and the conversion of decimal to binary. In the previous slide we found that with 4 bits, we can make upto 16 combinations of 0’s and 1’s. But with Base 10 system , we are restricted to 10 combinations and 6 more are going for a toss and then the concept of Base 16 system was created. 6 combinations , they don’t have an equivalent representation in binary. These 6 combinations from 10-15 are represented in hexadecimal as A-F.
  • 10. Hexadecimal Advantage Every possible binary combination has now representation.On a single digit you are getting 16 values. That’s more information in less space. There came a need for a new system which represents 16 symbols, that is why base 16 system was created where 0-9 is represented as it is and from 10-15, is represented A-F. You may wonder why not just decimal, why hexadecimal. The highest four digit number if 9999, byt in hexa it if FFFF which is close to 50,000 more representation in form of data. Both are using the same space but more information is given only in hexadecimal system
  • 11. Hexadecimal in Microcontrollers 1. In computers, we do not use the decimal system, It's only for the real world. 2. Inside the computer everything is in the form of binary, but it is not the binary form of decimal numbers but the binary form of hexadecimal numbers. So, that you can represent the combination of every 4 bits. So, let’s take some examples for easy conversion of Hexadecimal to binary 1. 35H 8 4 2 1 8 4 2 1 0 0 1 1 0 1 0 1 3 5
  • 12. Try these.. For every digit you represent four bits. In microprocessor everything is represented in Hexadecimal, so each digit has to be converted to binary with 4 bits allocated for each digit. So, the numbers on the left require totally 8its. In uC we come across 8bit and 16bit numbers every time. So, what the range of an 8 bit number in hexadecimal 00 H -FF H. Which in decimal is -0-255 . Likewise for a 16 bit number is 0000 H - FFFF H , i.e. 0-65535 74 H 93 H FF H Find 8-bit or 16-Bit number 25 H 5140 H 809 H 245 H 30 H 5136 H
  • 13. Powers of 2 Bits, Bytes and More 2^0 1 2^1 2 2^2 4 2^3 8 2^4 16 2^5 32 2^6 64 2^7 128 2^8 256 2^9 512 2^10 1024
  • 14. 2^10 is 1024 and also called as 1KBytes. 2^20 = 2^10 * 2^10 = 1Kb * 1Kb = 1Mb 2^30 = 2^10 * 2^20 = 1Kb * 1Mb = 1Gb 2^40 = 2^20 * 2^20 = 1Mb * 1Mb = 1Tb So, when i say 4 Gb , what it means 2^2 * 2^30 = 2^32 Gb When said 2^36 it means 2^6 *2^30 = 64Gb 256Gb = 2^8*2^30 = 2^38 2^11 2Kb 2^12 4Kb 2^13 8Kb 2^14 16Kb 2^15 32Kb 2^16 64Kb 2^17 128Kb 2^18 256Kb 2^19 512Kb 2^20 1Mb 2^21 2Mb