1.number System
1.number System
Venkatarathnam
DELD Kohavi
D:Digital Morris Mano
A.P. Godse
D.A. Godse
E:Electronics
L:Logic
D:Design
Digital Electronics & Logic Design
Introduction to the Subject &Need of the Subject.
Subject contains
Unit-1: Number System & Boolean Algebra.
Decimal 10 0, 1, … 9 Yes No
Binary 2 0, 1 No Yes
Octal 8 0, 1, … 7 No No
Hexa- 16 0, 1, … 9, No No
decimal A, B, … F
Quantities/Counting (1 of 2)
Hexa-
Decimal Binary Octal decimal
(8421)
0 0000 0 0
1 0001 1 1
2 0010 2 2
3 0011 3 3
4 0100 4 4
5 0101 5 5
6 0110 6 6
7 0111 7 7
Quantities/Counting (2 of 2)
Hexa-
Decimal Binary Octal decimal
(8421)
8 1000 10 8
9 1001 11 9
10 1010 12 A
11 1011 13 B
12 1100 14 C
13 1101 15 D
14 1110 16 E
15 1111 17 F
Conversion Among Bases
• The possibilities:
Decimal Octal
Binary Hexadecimal
Quick Example
Decimal Octal
Binary Hexadecimal
Binary to Decimal
• Technique
Multiply each bit by 2n, 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
Bit “0”
Example
1010112 => 1 x 20
= 1
1 x 2 1
= 2
0 x 2 2
= 0
1 x 23 = 8
0 x 2 4
= 0
1 x 25 = 32
4310
Example
1000102to Base 10
1000102 => 0 x 20 = 0
1 x
21 = 2
0 x
22 = 0
0 x
23 = 0
Example
• Binary to decimal
1) 11102to Base 10
2) 110012to Base 10
3) 11011.12to Base 10
Octal to Decimal
Decimal Octal
Binary Hexadecimal
Octal to Decimal
• Technique
– Multiply each bit by 8n, 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
Example
7248 => 4 x 80 = 4
2 x 8 = 16
1
7 x 82 = 448
46810
Example
4328 To Base 10
2 x 8 =
0
2
3 x 81 = 24
4 x 8 =
2
256
28210
Assignment problems
4) 4057.068to Base 10
Hexadecimal to Decimal
Decimal Octal
Binary
Hexadecimal
Hexadecimal to Decimal
• Technique
–Multiply each bit by 16n, 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
Example
A5D16 to Base 10
D x 160 =13 x1 = 13
5 x 161 = 5x16 = 80
A x 162=10x256 = 2560
265310
Assignment problems
5) A0F9.0EB16to Base 10
Decimal to Binary
Decimal Octal
Binary Hexadecimal
Conversion of Decimal number to any Radix number.
• Technique
–Divide by two, keep track of the
remainder
–First remainder is bit 0 (LSB, least-
significant bit)
–Second remainder is bit 1
–Etc.
Example
12510 = ?2 2 125
2 62 1
2 31 0
15 1
2
7 1
2
2 3 1
2 1 1
0 1
12510 = 11111012
Example
• Decimal to binary .14579
x 2
3.14579 0.29158
x 2
0.58316
x 2
1.16632
x 2
0.33264
x 2
0.66528
x 2
1.33056
11.001001... etc.
Assignment problems
6) 12.12510to Base 2
Decimal to Octal
Decimal Octal
Binary Hexadecimal
Decimal to Octal
• Technique
–Divide by 8
–Keep track of the remainder
Example
123410 = ?8
8 1234
154 2
8
19 2
8
2 3
8
0 2
123410 = 23228
Assignment Problem
7) Convert 658.82510 = ?8
Decimal to Hexadecimal
Decimal Octal
Binary Hexadecimal
Decimal to Hexadecimal
• Technique
– Divide by 16
– Keep track of the remainder
Example
123410 = ?16
16 1234
16 77 2
16 4 13 = D
0 4
123410 = 4D216
Assignment problem
8) 5386.34510 = ?16
Octal to Binary
Decimal Octal
Binary Hexadecimal
Octal to Binary
• Technique
7058 = ?2
7 0 5
7058 = 1110001012
Example
2148 = ?2
2 1 4
2148 = 0100011002
Example
125.628 = ?2
1 2 5 . 6 2
125.628 = 001010101.1100102
Assignment problem
9) 367.528 = ?2
Hexadecimal to Binary
Decimal Octal
Binary Hexadecimal
Hexadecimal to Binary
• Technique
10AF16 = ?2
1 0 A F
10AF16 = 00010000101011112
Example
3A9E.B0D16 = ?2
3 A 9 E . B 0 D
3A9E.B0D16 =
0011101010011110.1011000011012
Assignment problem
10) 4BAC16 = ?2
Binary to Octal
Decimal Octal
Binary Hexadecimal
Binary to Octal
• Technique
– Group bits in threes, starting on right
– Convert to octal digits
Example
10110101112 = ?8
1 011 010 111
1 3 2 7
10110101112 = 13278
Assignment problem
11) 110101.1010102 = ?8
12) 10101111001.01112 = ?8
Binary to Hexadecimal
Decimal Octal
Binary Hexadecimal
Binary to Hexadecimal
• Technique
– Group bits in fours, starting on right
– Convert to hexadecimal digits
Example
10101110112 = ?16
10 1011 1011
2 B B
10101110112 = 2BB16
Assignment problem
13) 01011111011.0111112 =?16
Octal to Hexadecimal
Decimal Octal
Binary Hexadecimal
Octal to Hexadecimal
• Technique
– Use binary as an intermediary
Example
10768 = ?16
1 0 7 6
2 3 E
10768 = 23E16
Example
10768 = ?16
1 0 7 6
2 3 E
10768 = 23E16
Assignment problem
Decimal Octal
Binary Hexadecimal
Hexadecimal to Octal
• Technique
– Use binary as an intermediary
Example
1F0C16 = ?8
1 F 0 C
1 7 4 1 4
1F0C16 = 174148
Assignment problem
15) BC66.AF16 = ?8