You are on page 1of 12

Chapter 2

Data Representation &


Numbering Systems

Compile by Abrham Y. 1
Numbering Systems
• The Binary Number System
– Use two digits 0 and 1’s
• Decimal number system
– Has base 10 as it use 10 digits from 0 to 9
• Octal number system
– Base or radix 8 number system 0 1 2 3 4 5 6 7
• Hexadecimal number system
– Also called base 16 number system
– Use 10 digit 0 1 2 3 4 5 6 7 8 9
– Use 6 letters A BCompile
C DbyEAbrham Y.
F 2
Cont…
• Converting decimal to binary
• Converting binary to decimal
• Converting hex-decimal to decimal
• Converting decimal to hex-decimal
• Converting binary to hex-decimal
• Converting hex-decimal to binary

Compile by Abrham Y. 3
Converting decimal to binary

• It involves using successive division by two


until the dividend reach 0
• Convert (37)10 to (_____)2

Compile by Abrham Y. 4
Converting binary to decimal

• Is required to find the decimal value of each


binary digit position contain a 1 and add
them up
• Convert (100101) 2 to (_____)10

Compile by Abrham Y. 5
Converting hex-decimal to
decimal

• Is required to find the decimal value of each


hex-decimal digit position contain a 1 and
add them up
• Convert (F4C) 16 to (_____)10

Compile by Abrham Y. 6
Converting decimal to hex-
decimal

• It involves using successive division by 16


until the dividend reach 0
• Convert (4768) 10 to (_____)16

Compile by Abrham Y. 7
Converting binary to hex-decimal

• Four binary bits can have minimum and


maximum values of 00002 up to 11112.
• This means that any group of four bits can
be translated directly into a single hex digit
• Convert (100000010101011) 2 to
(_____)16

Compile by Abrham Y. 8
Converting hex-decimal to binary

• This is just the reverse of the last process.


Simply take each hex number and express it
as a four bit binary number
• Convert (2F6CH) 16 to (_____)2

Compile by Abrham Y. 9
Hexadecimal
• the way we communicate with micros
• The only problem with binary is that we find it
so difficult and make too many errors.
• Programmers commonly used a suitable
method to handle large binary number in 4 bits
grouping
• It is easy to manipulate large binary numbers if
we group it into small grouping consisting of 4
bit per group
Compile by Abrham Y. 10
Cont..
• E.g
• Consider you are dealing with the binary
number 001011110110110 0 if we group
the number to 4 bit cluster like
0010 1111 0110 1100
By writing the corresponding signal digit
decimal value
2F6CH
Processing becomeCompile
easy by Abrham Y. 11
The advantages of hex

• It is very compact. Using a base of 16


means that the number of digits used to
represent a given number is usually fewer
than in binary or decimal.
• It is easy to convert between hex and
binary and fairly easy to go between hex
and decimal. Remember that the
microprocessor only works in binary.

Compile by Abrham Y. 12

You might also like