Module 7 - Number System
Module 7 - Number System
Module 7:
Number System
NUMBER SYSTEM
• Several number systems have been used in the past and can
be categorized into two groups: positional and non-positional
systems.
5
The decimal system (base 10)
S = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
The word binary is derived from the Latin root bini (or
two by two). In this system the base b = 2 and we use
only two symbols,
S = {0, 1,}
S = {0, 1, 2, 3, 4, 5, 6, 7}
9
Summary of the four positional systems
10
Common Number Systems
Used by Used in
System Base Symbols humans? computers?
Decimal 10 0, 1, … 9 Yes No
Binary 2 0, 1 No Yes
Octal 8 0, 1, … 7 No No
Hexa- 16 0, 1, … 9, No No
decimal A, B, … F
11
Comparison of numbers in the four systems
27 26 25 24 23 22 21 20
128 64 32 16 8 4 2 1
Lets place the above calculations into a chart that will make it easy to
convert a binary number to a decimal number.
12
Decimal Binary Octal Hexa- decimal
0 0000 0 0
1 0001 1 1
2 0010 2 2
3 0011 3 3
4 0100 4 4
5 0101 5 5
6 0110 6 6
7 0111 7 7
• The possibilities:
Decimal Octal
Binary Hexadecimal
16
CONVERSION
METHODS
Decimal Octal
Binary Hexadecimal
18
Weight
Base
19
DECIMAL – BINARY
1. Divide by two, keep Example #1.
track of the remainder
2 125
2. First remainder is bit 0 2 62 1
(LSB, least-significant bit)
2 31 0
3. Second remainder is 2 15 1
bit 1 2 7 1
4. Etc. 2 3 1
. 2 1 1 12510 = 11111012
0 1
20
2nd Method
Example #2.
12510 = 11111012
1 1 1 1 1 0 1
64 32 16 8 4 2 1
Example #3:
24310 = _____ 2
1 1 1 1 0 0 1 1
512 256 128 64 32 16 8 4 2 1
24310 = 111100112
22
DECIMAL – OCTAL
123410 = 23228
23
DECIMAL – HEXADECIMAL
Example #1.
1. Divide by 16
16 1234
2. Keep track of
16 77 2
the remainder 16 4 13 = D
0 4
123410 = 4D216
24
BINARY- DECIMAL
1010112 = 4310
1 0 1 0 1 1
64 32 16 8 4 2 1
40 + 3
43
26
Example #3:
111112 = _____ 10
1 1 1 1 1
512 256 128 64 32 16 8 4 2 1
111112 = 3110
27
BINARY- OCTAL
Example #1.
1. Group bits in threes,
10110101112 = ?8
starting on right
2. Convert to octal digits 1 011 010 111
.
1 3 2 7
10110101112 = 13278
28
BINARY- HEXADECIMAL
Example #1.
1. Group bits in fours,
10101110112 = ?16
starting on right
2. Convert to hexadecimal 10 1011 1011
digits
.
2 B B
10101110112 = 2BB16
29
OCTAL – DECIMAL
OCTAL – BINARY
7058 = 1110001012
31
OCTAL – HEXADECIMAL
Example #1.
1. Use binary
10768 = ?16
as an
1 0 7 6
intermediary
HEXADEMICAL – DECIMAL
Example #1.
ABC16 => C x 160 = 12 x 1 = 12
B x 161 = 11 x 16 = 176
A x 162 = 10 x 256 = 2560
274810
33
2nd Method
Example #2.
A B C
ABC= 274810
HEXADECIMAL – BINARY
Example #1.
1. Convert each
10AF16 = ?2
hexadecimal
digit to a 4-bit 1 0 A F
equivalent
binary
representation 0001 0000 1010 1111
10AF16 = 00010000101011112
35
HEXADECIMAL – OCTAL
Example #1. 1 F 0 C
1F0C16 = ?8
0001 1111 0000 1100
1 7 4 1 4
1F0C16 = 174148
Exercise – Conversion
Hexa-
Decimal Binary Octal decimal
33
1110101
703
1AF
/ 230
=
EXAMPLE
41 IT 111: Introduction to Computing
Thank you!