Professional Documents
Culture Documents
Ee202chapter1numberandcodesystembaia 131112193950 Phpapp02
Ee202chapter1numberandcodesystembaia 131112193950 Phpapp02
NUMBER AND
CODE SYSTEMS
EE202
DIGITAL ELECTRONICS
sabariah@psa.edu.my www.sabariahsalihin.com
CHAPTER 1:
NUMBER AND
CODE SYSTEMS
Programme Learning Outcomes, PLO
Upon completion of the programme, graduates should be able to:
2 7 4 5 . 2 1 4
3 2 1 0 -1 -2 -3
= (2x 10 )+(7x 10 )+(4x 10 )+(5x 10 )+(2x 10 )+(1x 10 )+(4x 10 )
1 0 1 1 . 1 0 1
MSB MSB
Binary Point
� Example:
What is the largest number that can be represented using
8 bits?
� Solution :
N 8
2 - 1 =2
= 255 10
= 111111112
� Review Questions:
� Example :
Convert the Fractional Binary Number 101.102 to its
Decimal equivalent.
� Solution:
Binary Number = 1 0 1 . 1 0
2 1 0 -1 -2
Power of 2 position = 2 2 2 . 2 2
= (22 x 1)+(21 x 0)+(20 x 1) . (2-1 x 1)+(2-2 x 0 )
Decimal Value = 4 + 0 + 1 . 0.5 + 0
= 5.5 10
� Example :
Convert Decimal 2010 to its Binary equivalent.
Solution:
2 20 remainder of 0
2 10 remainder of 0
2 5 remainder of 1
2 2 remainder of 0
2 1 remainder 0f 1
0
1 0 1 0 02
� Example :
Convert Decimal 0.62510 to its binary equivalent.
Solution:
0.25 x 2 = 0.50
0. 5 x 2 = 1. 00 LSB
carried MSB 1 0 1
= 0.62510 = . 1012
Example:
Perform Binary Addition for 1012 + 0102
Solution:
1 0 12
0 1 02 +
1 1 1
Exercise:
Perform Binary Addition for 10112 + 01112
Answer: 10 01 02
B4 B3 B2 B1 B0
1 1 1 0 1
= - 13
Example:
� Express the Decimal number -46 in 8 bit Signed
magnitude system
Solution:
True Binary number for +46
= 00101110
Change the sign bit to 1 and remain unchanged
magnitude nits
= 10101110 = -46
5 4 3 2 1 0 -1 -2 -3 -4 -5
8 8 8 8 8 8 . 8 8 8 8 8
Decrease with negative power of 8
� Exercise:
Convert 54.78 to its Binary equivalent.
Solution :
5 4 . 78
4 5 3 = 4 5 38
EE202 DIGITAL ELECTRONICS
1.2.1 Binary to Octal Conversion
3 2 68 =3268
NOTE that a 0 was placed to the left of the MSB to produce even groups of 3 Bits.
� Exercise :
Convert the Octal number 17.78 to its Decimal
equivalent
Solution:
1 -1
17.78 = (1 x 8 ) + (7 x 8 ) + (7 x 8 )
0
= (1 x 8) + (7 x 1) + (7 x .125)
= 64.87510
Exercise:
Convert the Hexadecimal 9F216 to its Binary
equivalent.
Solution:
9 F 2
� Example:
Convert the Binary 1011011011111010 2 to its equivalent
Hexadecimal number.
Solution:
1011 0110 1111 1010
B 6 F A = B6FA16
� Exercise:
Convert the Binary 1110100110 2 to its
equivalent Hexadecimal number.
Solution:
0011 1010 01102
3 A 6 = 3A616
Example :
Convert the Hexadecimal number 2AF16 to its
Decimal Equivalent.
Solution:
2AF16 = (2 x 162)+(10 x 161 )+(15 x 160 )
= (512) + (160) + (15)
= 68710
� Exercise :
Convert the Hexadecimal number 1BC216 to its
Decimal Equivalent.
Solution:
2 2 2 2
= (1 x 16 )+(11 x 16 )+(12 x 16 )+(2 x 16 )
= 710610
Example:
Express the Decimal number -25 in the 2's complement
system using 8-bits.
Solution:
Represent the +25 in Binary for
0 0 0 1 1 0 0 1
1 1 1 0 0 1 1 0 ( 1's complement)
+1
1 1 1 0 0 1 1 1 ( 2's complement)
0 1000 ( + 8, augend)
0 0100 ( + 4, addend)
0 1 1 0 0 ( sum = + 12)
signed bit
0 1 0 0 1 0 1 1 (+75)
1 1 0 1 0 1 1 1 (-41)
100 1 0 0 0 1 0 (+34)
discard
� CASE 3 :
Both numbers are opposite sign
Example:
Subtract -20 from + 24 in byte.
Solution:
In this case (+24) - (-20) = (+24)+(20)
0 0 0 1 1 0 0 0(+24)
0 0 0 1 0 1 0 0 (+20)
0 0 1 0 1 1 0 0 (+44)
Example:
Convert 0110100000111001 (BCD) to its decimal
equivalent.
Solution:
Divide the BCD number into 4-bit groups and convert
each to decimal.
0110 1000 0011 1001
6 8 3 9
Exercise:
Convert the BCD number 011111000001 to its Decimal
equivalent.
Solution:
0111 1100 0001
7 1
Example:
The following is a message encoded in ASCII code.
What is the message?
1001000 1000101 1001100 1010000
Solution:
Convert each 7-bit code to its Hexadecimal equivalent.
The results are : 48 45 4C 50
Now, locate these Hexadecimal values in table ASCII and
determine the character represented by each. The results are:
H E L P
� Do Review Questions
� Quiz 1 for Chapter 1- be prepared!!