Digital Systems of PPT Lecture 1
Digital Systems of PPT Lecture 1
Course Title
Digital electronics and PLC
Course Code - UG11T3402
Lecture 1
Lecture Title – Number System
Converters ( A-D and D-A ): Analog to digital and Digital to analog converter and
their use in data loggers
Case Studies: Motor drive logic, Fault annunciation logic, Flap gate operation
logic, sequence operation logic.
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 3)
Hexa-
Decimal Binary Octal decimal
0 0 0 0
1 1 1 1
2 10 2 2
3 11 3 3
4 100 4 4
5 101 5 5
6 110 6 6
7 111 7 7
Quantities/Counting (2 of 3)
Hexa-
Decimal Binary Octal decimal
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
Quantities/Counting (3 of 3)
Hexa-
Decimal Binary Octal decimal
16 10000 20 10
17 10001 21 11
18 10010 22 12
19 10011 23 13
20 10100 24 14
21 10101 25 15
22 10110 26 16
23 10111 27 17
Conversion Among Bases
The possibilities:
Decimal Octal
Binary Hexadecimal
Quick Example
Base
Decimal to other base system
• Step 1 - Divide the decimal number to be converted by the
value of the new base.
• Step 2 - Get the remainder from Step 1 as the rightmost digit
(least significant digit) of new base number.
• Step 3 - Divide the quotient of the previous divide by the new
base.
• Step 4 - Record the remainder from Step 3 as the next digit (to
the left) of the new base number.
Cont..
• Repeat Steps 3 and 4, getting remainders from right to left,
until the quotient becomes zero in Step 3.
• The last remainder thus obtained will be the most significant
digit (MSD) of the new base number.
Decimal to Binary
• Technique
– Etc.
Example
2 125
12510 = ?2 2 62 1
2 31 0
15 1
2
7 1
2
2 3 1
2 1 1
0 1
12510 = 11111012
Decimal to Octal
• Technique
– Divide by 8
123410 = ?8
8 1234
154 2
8
19 2
8
2 3
8
0 2
123410 = 23228
Decimal to Hexadecimal
• Technique
– Divide by 16
123410 = ?16
16 1234
16 77 2
16 4 13 = D
0 4
123410 = 4D216
Other to Decimal base system
• Step 1 – Determine the column(positional) value of each digit.
corresponding columns.
Bit “0”
1010112 => 1 x 20 = 1
1 x 21 = 2
0 x 22 = 0
1 x 23 = 8
0 x 24 = 0
1 x 25 = 32
4310
Octal to Decimal
• Technique
7248 => 4 x 80 = 4
2 x 81 = 16
7 x 82 = 448
46810
Hexadecimal to Decimal
• Technique
10110101112 = ?8
1 3 2
7
10110101112 = 13278
Octal to Binary
• Technique
– Convert each octal digit to a 3-bit equivalent
binary representation
Example
7058 = ?2
7 0 5
7058 = 1110001012
Binary to Hexadecimal
• Technique
2 B B
10101110112 = 2BB16
Hexadecimal to Binary
• Technique
10AF16 = ?2
1 0 A F
10AF16 = 00010000101011112
Octal to Hexadecimal
• Technique
– Use binary as an intermediary
Example
10768 = ?16
1 0 7 6
2 3 E
10768 = 23E16
Hexadecimal to Octal
• Technique
– Use binary as an intermediary
Example
1F0C16 = ?8
1 F 0 C
1 7 4 1 4
1F0C16 = 174148
Binary Addition
Example:
• Rules:
• Binary add of 1101 and
• 0+0=0 ; 1011 is
1101
• 0+1=1 ;
+ 1011
• 1+0=1; 11000
• 1+1=10,
Example:
• Rules:
• Binary Sub of 10001
• 0-0=0 ; and 01101 is
10001
• 1-1=0 ;
- 01101
• 1-0=1; 00100
• 0-1=1,
• 0x0=0 ;
1101.101
• 1x1=1 ; x 101.010
• 1x0=0; 1011101
0000000x
• 0x1=0, 1011101xx
0000000xxx
1011101xxxx
111101.00001
Binary Division
Divide 101101 by 110 is
110) 101101 (111.1
- 110
1010
- 110
1001
- 110
110
- 110
000
Octal Addition
Add 327.54 to 665.37
327.54
+ 665.37
1215.13
Octal Subtraction
Subtract 20.14 to 16.47
20.14
- 16.47
01.45
Octal Multiplication
Multiply 2763.5 to 6 (30)10=(36)8 (sum:6,Carry:3)
2763.5 (18)10=(22)8
x 6 (22)8+(3)8=(25)8 (sum:5,Carry:2)
21665.6 (36)10=(44)8
(44)8+(2)8=(46)8 (sum:6,Carry:4)
(42)10=(52)8
(52)8+(4)8=(56)8 (sum:6,Carry:5)
(12)10=(14)8
(14)8+(5)8=(21)8 (sum:1,Carry:2)
Octal Division
Divide 4570.32 by 6 6 cannot go in 4, so consider (45)8
6 ) 4570.32 (624.042 (45)8=(37)10 (36)10=(44)8 (times:6, R:1)
44 (17)8=(15)10 (12)10=(14)8 (times:2, R:3)
17 (30)8=(24)10 (24)10=(30)8 (times:4, R:0)
14 (03)8=(03)10 (times:0,
R:3)
30
(32)8=(26)10 (26)10=(30)8 (times:4, R:2)
30
(20)8=(16)10 (16)10=(14)8 (times:2,
032 R:4)
30
20
14 The Quotient is 624.0428 and remainder is 48
4
Complements
• Conventional addition (using carry) is easily implemented
in digital computers.
• Subtraction by borrowing is difficult and inefficient for
digital computers.
• It is much more efficient to implement subtraction using
ADDITION OF the COMPLEMENTS of numbers.
r’s Complement
• Given a number N in base r having n digits,