You are on page 1of 17

Universiti Teknologi MARA

CHAPTER 2(PART 1B)


OCTAL AND HEXADECIMAL CONVERSION

SALEHAH HAMZAH
FACULTY OF COMPUTER AND MATHEMMATICAL SCIENCES
UITM MELAKA KAMPUS JASIN
Introduce unit in data representation

Conversion decimal to octal

Number
Conversion octal to decimal
conversion
Conversion of decimal to hexadecimal

Conversion of hexadecimal to octal


number
DECIMAL TO OCTAL CONVERSION
• How to read decimal number as octal number?
• Assume a decimal to be converted is 60. What is the
octal number representation?
• Method : divide the number by 8; because largest
number of octal is 8.
• 60/8 = 7 remainder 4, continue divide
• 7/8 = 0 remainder 7
• Ans : take the remainder number ;
• = 74
DECIMAL TO OCTAL CONVERSION

a) Assume a decimal to be converted is 92. What


is the octal number representation?
•Method : divide the number by 8;
• 92/8 =11 remainder 4
•11/8 = 1 remainder 3
•1/8 = 0 remainder 1
•Ans : take the remainder number;
•= 134
DECIMAL TO OCTAL CONVERSION

b) Assume a decimal to be converted is 131.


What is the octal number representation?
•Method : divide the number by 8;
• 131/8 =16 remainder 3
•16/8 = 2 remainder 0
•2/8 = 0 remainder 2
•Ans : 203
OCTAL TO DECIMAL CONVERSION
•How to read octal number as decimal number?
•Method : use octal base representation table;
• Assume a octal number to be converted is 54.
•What is a decimal number representation?
•Simply put the octal number into table.Then sum up
the number
64 8 1 Ans : (5 x 8) + (4 x 1)
0 5 4 = 44 (decimal)
OCTAL TO DECIMAL CONVERSION
a) Assume a octal number to be converted is 142.
•What is a decimal number representation?

•Method : Simply put the octal number into table.Then


sum up the number
64 8 1 Ans : (1 x 64 ) +(4 x 8) + (2 x 1)
1 4 2 = 98 (decimal)
OCTAL TO DECIMAL CONVERSION

b) Assume a octal number to be converted is 225.


•What is a decimal number representation?
•Put in octal base table representation
64 8 1
2 2 5

•Ans : (2 x 64 ) +(2 x 8) + (5 x 1)
= 149 (decimal)
OCTAL DECIMAL CONVERSION SUMMARY
Decimal Octal Decimal Octal
0 0 8 10
1 1 9 11
2 2 10 12
3 3 11 13
4 4 12 14
5 5 13 15
6 6 14 16
7 7 15 17
8 10 16 20
DECIMAL TO HEXADECIMAL CONVERSION

• How to read decimal number as hexadecimal


number?
• Assume a decimal to be converted is 50. What is the
hexadecimal number representation?
• Method : divide the number by 16; because largest
number of hexa is 16.
• 50/16 = 3 remainder 2, continue divide
• 3/16 = 0 remainder 3
Ans : take the remainder number ; = 32 (hexa)
DECIMAL TO HEXADECIMAL CONVERSION

a) Assume a decimal number to be converted is


104. What is a hexa number representation?

•104/16 = 6 remainder 8, continue divide


•6/16 = 0 remainder 6
Ans = 68 (hexa)
DECIMAL TO HEXADECIMAL CONVERSION

b) Assume a decimal number to be converted is


200. What is a hexa number representation?

•200/16 = 12 remainder 8, continue divide


•12/16 = 0 remainder 12
Ans = C8 (hexa); C is 12
DECIMAL TO HEXADECIMAL CONVERSION

c) Assume a decimal number to be converted is


300. What is a hexa number representation?

•300/16 = 18 remainder C, continue divide


•18/16 = 1 remainder 2
•1/16 = 0 remainder 1
Ans = 12C
HEXADECIMAL DECIMAL CONVERSION SUMMARY

Decimal Hexa Decimal Hexa


0 0 10 A
1 1 11 B
2 2 12 C
3 3 13 D
4 4 14 E
5 5 15 F
6 6 16 10
7 7 17 11
8 8 18 12
HEXADECIMAL TO DECIMAL CONVERSION
•How to read hexa number as decimal number?
•Method : use hexa base representation table;
• Assume a hexa number to be converted is 77.
•What is a decimal number representation?
•Simply put the hexa number into table.Then sum up
the number
256 16 1 Ans : (7 x 16) + (7 x 1)
0 7 7 = 119 (decimal)
HEXADECIMAL TO DECIMAL CONVERSION

a) Assume a hexa number to be converted is 144.


What is a decimal number representation?
Simply put the hexa number into table.Then sum up
the number
256 16 1
1 4 4
Ans : (1 x 256) + (4 x 16) + (4 x 1) = 324 (decimal)
HEXADECIMAL TO DECIMAL CONVERSION

b) Assume a hexa number to be converted is 1EA.


What is a decimal number representation?

256 16 1
1 E A

Ans : (1 x 256) + (14 x 16) + (10 x 1) = 490 (decimal)

You might also like