Professional Documents
Culture Documents
Chapter 1-Number System
Chapter 1-Number System
EE008-3-2-DE / VE2
Number System
TOPIC & STRUCTURE OF THE
LESSON
• Number Bases
• Gray Code
• Representation of negative numbers
• Addition and Subtraction of Base 2, 16
and 8
Example 1.1
Convert the binary whole number 1101101 to decimal
Weight 26 25 24 23 22 21 20
Binary Number 1 1 0 1 1 0 1
Example 1.2
Convert the fractional binary number 110.1011 to decimal
Exercise 1.1
• 100112
• 11100112
• 101010.1112
• 1110010.1112
• 0101112
• 00011100.10112
• 1000001.0112
• 010101.12
Exercise 1.1
• 100112
• 11100112
• 101010.1112
• 1110010.1112
• 0101112
• 00011100.10112
• 1000001.0112
• 010101.12
• INTEGER DIGIT:
– Repeated division by the radix & record the remainder
• FRACTIONAL DECIMAL:
– Multiply the number by the radix until the answer is in integer
Example 1.4
Convert the decimal fraction 25.3125 to binary
2 5 = 12 + 1
2
12 = 6 + 0
2
6 = 3 + 0
2
3 = 1 + 1
2
1 = 0 + 1
2 MSB LSB
2510 = 1 1 0 0 1 2
EE008-3-2-Digital Electronics Ch1-Number Systems Slide 16
DECIMAL TO BINARY CONVERSION
Carry .0 1 0 1
0.3125 x 2 = 0.625 0
0.625 x 2 = 1.25 1
0.25 x 2 = 0.50 0
0.5 x 2 = 1.00 1
Exercise 1.2
1. 1010
2. 101.5937510
3. 49. 32510
4. 21.510
5. 21610
6. 14510
7. 98.07510
8. 12710
Exercise 1.2
1. 1010
2. 101.5937510
3. 49. 32510
4. 21.510
5. 21610
6. 14510
7. 98.07510
8. 12710
Example 1.5
Convert the following binary numbers to hex:
a) 1100101001010111
b) 111111000101101001
Solution
• Convert, each 4-bit group to the equivalent hex, starting
at the most right bit
(a) 11001010 01010111 (b) 0011111100 0101101001 = 3F169
C A 5 7 = CA57 3 F 1 6 9
Example 1.6
Determine the binary number for the following hex numbers
a) 10A4
b) CF8E
c) 23.A3
Solution
• Reverse the process. Convert each hex digit to a 4 digit
binary number
Exercise 1.3
Convert the following binary numbers to their hexadecimal
equivalent (vice versa).
a) 10000.12
b) 1F.C16
Solution:
a) 10.816
b) 00011111.11002
Example 1.7
Determine the decimal number for the following hex numbers
a) BE = B 16 + E 16 = 1116 + 14 1 = 190
1 0
Example 1.8
Determine the hex number for the following decimal numbers:
a) 84 = 5416
b) 190 = BE16
Example 1.9
Convert the following binary numbers to octal:
a) 1100101001010110
b) 1111.0001011011
Solution
• Convert, each 3-bit group to the equivalent octal,
starting at the most right bit
a) 1451268
b) 17.05548
Example 1.10
Determine the binary number for the following octal
numbers
a) 124
b) 276
Solution
• Reverse the process. Convert each octal digit to a 3digit
binary number
Exercise 1.4
Convert the following binary numbers to their octal
equivalent (vice versa).
a) 1001.11112
b) 47.38
c) 1010011.110112
Solution:
a) 11.748
b) 100111.0112
c) 123.668
EE008-3-2-Digital Electronics Ch1-Number Systems Slide 29
OCTAL-TO-DECIMAL CONVERSION
Example 1.11
Determine the decimal number for the following octal numbers
a) 1248 = 1 82 + 2 81 + 4 80 = 64 + 16 + 4 = 8410
Example 1.12
Determine the octal number for the following decimal numbers:
a) 84 = 1248
b) 276 = 4248
• IF the number contains two decimal digits, then it’s equivalent BCD
will be the respective eight binary of the given decimal number.
• Four for the first decimal digit and next four for the second decimal
digit.
• Forms the easy interface between man machine- e.g keypad inputs
and digital readouts
Example 1.13
Find the equivalent BCD for the following decimal numbers
a) 1210
Solution
a) Decimal to BCD
1210 = 00010010BCD
Example 1.14
Find the equivalent BCD for the following decimal numbers
a) 10000110BCD
b) 001101010001BCD
Solution
13710 = 000100110111BCD
The BCD code is 0001 0011 0111 The straight binary code is 100010012
EE008-3-2-Digital Electronics Ch1-Number Systems Slide 35
BINARY CODED DECIMAL
• The MSB in the Gray code is same as the corresponding MSB in the
binary number
• From left to right, add each adjacent pair of binary code to get the
next Gray code bit.
• Discard Carries
• Example , the conversion of the binary number 10110 to gray code
• The MSB in the Binary number is same as the corresponding MSB in the
Gray code
• From left to right, add each binary code bit generated to the gray
code bit in the next adjacent position
• Discard Carries
• Example , the conversion of the gray code 11011 to binary number
• Binary 10010
EE008-3-2-Digital Electronics Ch1-Number Systems Slide 39
GRAY TO BINARY CONVERSION
Exercise 1.5
Solution
Example 1.7
Express the decimal +19 and -19 as an 8-bit number in the:
a) sign magnitude
b) 1’s complement
c) 2’s complement
Solution
Solution
Q&A