Professional Documents
Culture Documents
DIGITAL ELECTRONICS
Hexadecimal: 1D63A7A
2 3
2X10 + 3X1
20 + 3
23
Decimal point
Solution:
47 = (4 X 101) + (7 X 100)
= (4 X 10) + (7 X 1)
= 40 + 7
= 47
dee Copyright 2000 Indiana University Board of Trustees
2034 12
Example 2
Express the decimal number 568.25 as a sum of the
values of each digit.
Solution:
568.25 = (5 X 102) + (6 X 101) + (8 X 100)
+ (2 X 10-1) + (5 X 10-2)
= (5 X 100) + (6 X 10) + (8 X 1)
+ (2 X 0.1) + (5 X 0.01)
= 500 + 60 + 8 + 0.2 + 0.05
= 568.25
000 0 20 1
001 1 21 2
010 2 22 4
011 3 23 8
100 4 24 16
101 5 25 32
110 6 26 64
111 7 27 128
MSB LSB
dee Copyright 2000 Indiana University Board of Trustees
2034 17
Example 4
Convert the following decimal numbers to binary:
0.312510 .(N2 N10 )
Solution: MSB LSB
. 0 1 0 1
CARRY
0.3125 X 2 = 0.625 0
0.625 X 2 = 1.25 1
0.25 X 2 = 0.50 0
0.50 X 2 = 1.00 1
Solution:
Weight: 26 25 24 23 22 21 20
Binary number : 1 1 0 1 1 0 1
1101101 = 26 + 25 + 23 + 22 + 20
= 64 + 32 + 8 + 4 + 1
= 109
Solution:
Weight: 2-1 2-2 2-3 2-4
Binary number : 0. 1 0 1 1
6 5 3
6 5 3
8 44 = 5.5 0.5 X 8 = 4
8 5 = 0.625 0.625 X 8 = 5
359 = 5478
dee Copyright 2000 Indiana University Board of Trustees
2034 26
Octal to Decimal Conversion
(N8 N10 )
Determine the decimal value of the octal whole number 23748.
(N8 N10 )
Solution:
Weight: 83 82 81 80
Binary number : 2 3 7 4
23748 = ( 2 X 83 ) + ( 3 X 82 ) + ( 7 X 81 ) + ( 4 X 80 )
= ( 2 X 512 ) + ( 3 X 64 ) + ( 7 X 8 ) + ( 4 X 1 )
= 1024 + 192 + 56 + 4
= 127610
16 40 = 2.5 0.5 X 16 = 8
16 2 = 0.125 0.125 X 16 = 2
650 = 28A16
dee Copyright 2000 Indiana University Board of Trustees
2034 29
Hexadecimal to Decimal Conversion
(N16 N10 )
Determine the decimal value of the hexadecimal whole
number E516.
+0 +1
01 10
Binary # 10110011
1s complement 01001100
+18 = 00010010
-18 = 10010010
- 3 = 00000011
Boolean complement gives 11111100
Add 1 to LSB +1
11111101
0= 00000000
Bitwise not 11111111
Add 1 to LSB +1
Result 1 00000000
0011 1100
+ 0100 + 1111
0111 = 7 11011 = -5
(c) (+3) + (+4) (d) (-4) + (-1)
Subtraction rules:
8 7 4 (decimal)
C FF FS , < L \ l |
D CR GS - = M ] m }
E SO RS . > N ^ n ~
F SI US / ? O _ o DEL
54 Copyright
dee 2034 2000 Indiana University Board of Trustees
SUMMARY
N2
N10
N8 N16
55 Copyright
dee 2034 2000 Indiana University Board of Trustees
EXERCISE 1
Convert to its DECIMAL equivalent:-
56 Copyright
dee 2034 2000 Indiana University Board of Trustees
EXERCISE 2
Convert to its HEXDECIMAL, BCD 8421
AND ASCII equivalent:-
57 Copyright
dee 2034 2000 Indiana University Board of Trustees
EXERCISE 3
Use the 2's- complement to solve problem
58 Copyright
dee 2034 2000 Indiana University Board of Trustees
QUIZ 1
Question 1: -2 Marks
Convert 1000110110112 to its DECIMAL equivalent.
Question 2: -6 Marks
Write the next four numbers in this HEX counting
sequence:
i . 38, 39, 3A, 3B, 3C, 3D, 3E, _______, _______,
_______, ______(1M)
ii. E8A, E8B, E8C, E8D, ______, _______, _______,
_______(1M)
iii. Convert 42310 to HEX (4)
59 Copyright
dee 2034 2000 Indiana University Board of Trustees
QUIZ 1
Question 3(6 marks)
Assume the 2's- complement system for both questions
3.i and 3.ii:
i. Consider the Addition of +7 and -7. Express the
sum as a signed binary number and as a decimal
number -3 Marks
ii. Perform the Subtraction on the following pairs of
signed numbers using the 2's complement system.
Express the results as signed binary numbers and as
decimal values.
01001 - 11010 = ? -3 Marks
60 Copyright
dee 2034 2000 Indiana University Board of Trustees
QUIZ 1
Question 4 :- 6 Marks
i. Convert 0110100000111001 (BCD Code 8421) to
its decimal equivalent -2 Marks
ii. Comparison of BCD and Binary.
Represent the Decimal Value of 17810 by its
straight Binary equivalent and BCD codes
Equivalent.
61 Copyright
dee 2034 2000 Indiana University Board of Trustees