0% found this document useful (0 votes)
11 views

Number Systems: Binary

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Number Systems: Binary

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 19

NUMBER SYSTEMS

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

Place value 2^3 2^2 2^1 2^ . 2^- 2^- 2^-3


0 1 2

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

Therefore 1101.1012 = 13.62510

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

So that 3x64 + 5x8+ 7x1. 3x1/8+


2x1/64+ 1x1/512 = 239.4082 10
Therefore 357.3218 =
239.408210 5
Hexadecimal System

[base 16]
The importance of this system is
in computer applications, as you
will see in other studies.
The symbols of hexadecimal are:
0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F
The place values are powers of
16. 2 A 7 . 3 E 2
16^2 16^1 16^0 . 16^- 16^- 16^-
Example 1.3: 1 2 3
256 16 1 . 1/16 1/25 1/40
6 96
Therefore 2 A7.3E2 16 = 679.247 10
6
Converting Numbers from one base
to base 10
The method we have been using
until now is called converting
from first principles.
We now consider other methods
Example: Express the octal
357.1218 in denary form.
3 5 7
3x8 = 24 5+24 = 29 x 7+232=239 Therefore
8 = 232 3578=23910
For 0.121
1x8=8 8+2 =10x8 = 80+1 = 81
80
0.121 = = 0.1582 10
81x8^-3 IEng. E. Mabunda 7
Converting Numbers from one base
to base 10
Express a binary number in denary
i.e. 11011.10112

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

Collecting partial results we have 11011.1011=


27.687510
8
Converting Numbers from one
base to base 10
Express
4C5.2B816 in denary form.
Remembering that C=12 and B = 11

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

Collecting results we have :

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

Therefore 52410 = 10148

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

You might also like