1
Lahore Garrison University
CSC332 Digital Logic Design
Week-2 Lecture-4
Semester-# fall 2020
Prepared by:
Areej Fatima
2
Preamble (Past Lesson Brief)
Introduction to Number systems
Number system Conversion
Binary to Decimal
Binary to Octal
Binary to Hexadecimal
Decimal to Binary
Decimal to Octal
Decimal to Hexadecimal
Lahore Garrison University
3
Learning Outcomes
Octal to Binary
Octal to Decimal
Octal to Hexadecimal
Hexadecimal to Binary
Hexadecimal to Decimal
Hexadecimal to Octal
Lahore Garrison University
Octal to Binary
Technique
Convert each octal digit to a 3-bit equivalent binary representation
Octal to Binary Conversion
Each octal number converts to 3 binary digits
To convert 6538 to binary, just substitute code:
6 5 3
110 101 011
Example
7058 = ?2 7 0 5
111 000 101
7058 = 1110001012
Octal to Decimal
Technique
n
Multiply each bit by 8 , where n is the “weight” of the bit
The weight is the position of the bit, starting from 0 on the right
Add the results
Octal to Decimal Conversion
Convert 6538 to its decimal equivalent:
Octal Digits
6 5 3
x x x
Positional Values
82 81 80
Products
384 + 40 + 3
42710
Example
7248 => 4 x 80 = 4
2 x 81 = 16
7 x 82 = 448
46810
Octal to Hexadecimal
Technique
Use binary as an intermediary
Example 1F0C16 = ?8
1 F 0 C
0001 1111 0000 1100
1 7 4 1 4
1F0C16 = 174148
Hexadecimal Binary
Example:
Example:convert 1001100011100110122
convert10011000111001101 hexadecimal
hexadecimal
Group
Groupbyby4s,
4s,starting
startingatatthe right
theright expand
expandintointo44bit
bitgroups
groups
110011
00110001
00011100 110122
11001101 113311CCDD1616
Hex
Hex Binary
Binary Decimal
Decimal
00 0000
0000 00
Memorize 11 0001
0001 11
this table!!! 22 0010
0010 22
It makes 33 0011
0011 33
44 0100
0100 44
conversions 55 0101 55
0101
between 66 0110
0110 66
hexadecimal 77 0111
0111 77
and binary 88 1000
1000 88
99 1001
1001 99
trivial AA 1010 10
1010 10
BB 1011
1011 11
11
CC 1100
1100 12
12
DD 1101
1101 13
13
EE 1110
1110 14
14
FF 1111
1111 15
15
Hexadecimal to Decimal
Technique
n
Multiply each bit by 16 , where n is the “weight” of the bit
The weight is the position of the bit, starting from 0 on the right
Add the results
Hexadecimal to Decimal Conversion
Convert 3B4F16 to its decimal equivalent:
3 B 4 F
x x x x
Positional Values
Hex Digits
163 162 161 160
Products 12288 +2816 + 64 +15
15,18310
Example
ABC16 => C x 160 = 12 x 1 = 12
B x 161 = 11 x 16 = 176
A x 162 = 10 x 256 = 2560
274810
Example: Hexadecimal to octal
1 F 0 C
1F0C16 = ?8 0001 1111 0000 1100
1 7 4 1 4
1F0C16 = 174148
17
References
These lecture notes were taken from following source:
Digital Fundamentals FLOYD Edition 11
Digital logic design Moris Mano
Lahore Garrison University
18
Q &A
Lahore Garrison University