Number Systems: Binary
Number Systems: Binary
Binary
1
Binary
Binary numbers have proved to
be a natural system to use in
Digital electronics and Switching.
There are only two symbols i.e..
0 and 1.
The place values are powers of 2
The base is 2
2
Binary System
Example 1.1
Binary number:
Binary 1 1 0 1 . 1 0 1
Number
Or 8 4 2 1 . ½ ¼ 1/8
3
Binary System
So 1 1 0 1 . 1 0 1
that
= 1x8 1x4 0x 1x1 . 1x1/2 0x1/4 1x1/
2 8
= +8 +4 +0 +1 . +1/2 +0 +1/
8
= 13,5 = 13.62 In denary
/8 5
4
Octal System [base8]
Thissystem uses the following
symbols 1,2,3,4,5,6,7,
The place values are powers of 8.
3 5 7 . 3 2 1
8^2 8^1 8^0 . 8^-1 8^-2 8^-3
64 8 1 . 1/8 1/64 1/512
1 1 0 1 1 . 1 0 1 1
1x2=2 2+ 6+0 12+1 26+1= . 1x2= 2+0 4+1 10+
1= x2 13 27 2 =22x =5 1=
3x2 =12 x2=2 2=4 5x2= 11
=6 6 10
11x2^ = 0.68
-4 75 10
4 C 5 . 2 B 8
The place value for 696 is
16^-3, therefore we have
696/4096 = 0.16992 10
4C5.2B816 = 1221.1699210
9
Converting Numbers from one
base to base 10
4C5.2B8 16 = 1226.16992 10
10
Expressing base ten to other
bases
Express a denary number 245 in binary form:
2 245
2 122 1
2 61 0
2 30 1
2 15 0
2 7 1
2 3 1
2 1 1
0 We can then
write: 24510 =
111101012 11
Expressing base ten to other
bases
Express 52410 in octal form:
8 524
8 65 4
8 8 1
8 1 0
0 1
12
Convert from denary to
hexadecimal
Convert the denary number 348.654 to
hexadecimal form:
We use octal as an intermediate step.
[a] First we change 348.654 into octal
i.e. 534.517.
[b] We write the binary equivalent of
each digit in groups of three binary
digits as:
101 011 100 . 101 001 111
Therefore 534.5178 =
101011100.101001111
13
Convert from denary to
hexadecimal
[c] Starting from the decimal point working
in each direction, re-group the same binary
digits in groups of four i.e.
0001 0101 1100 . 1010
0111 1000
[d] Now, we write the hexadecimal
equivalent of each group of four binary
digits so that we have: 1 5 12 10 7
8
Such that 348.65410 =
10101100.1010011112
= 15C.A7816
14
Complements
One’s complement:
Example:
[a] 1710 = 000100012
= 111011102 = -1710
[b] 11910 = 011101112
= 100010002 =-11910
[c] 010 = 000000002 [positive
zero]
= 111111112
= 010 [negative zero]
15
Complements
Two’s Complement:
1710 = 000100012 = 11101110 +1
• = 111011112 = -1710
• = 000000002 =
11111111 +1
• = 100000002 = 010
• Notice that if a carry out of the MSB
position occurs this bit is ignored
only the low-order n bits of the result
are used.
16
Complements
Two’s complements Continued:
-9910 = 100111012
= 0110010+ 1
= 011000112
= 99
Two’s complement numbers can be added by
ordinary addition, ignoring any caries beyond the
MSB
Perform one’s complement by ordinary addition
but add an extra 1 whenever you count pass
1111.
If there is a carry out of the sign position add 1 to
the result. This rule is called end –around carry.
17
Number Systems
Assignment 1: Express the
following in denary form:
1. 314.2658
2. 3C4.21F16
3. 111.01012
18
Number Systems
End of Lecture
19