Numbering System
Numbering System
Numbering System
Department of mgt (management)
1.5 Number System
Fundamental to understand how computers work is understanding the
number system.
Computer use the number system to store data and communicate with
each other.
Within any computer, all numbers must be expressed in binary form.
A number system is a set of symbols used for counting.
The number systems which are of a particular interest in information
technology are Decimal, binary, octal and hexadecimal number system.
Number systems are basically of two types: non positional and
positional
Definition:
Non-positional number system is a number system in which case each
symbol represents the same value regardless of its position in the number
and the symbols are added to find out the value of particular number.
Example: Counting of fingers, stones, sticks etc.
Positional number system is a number system in which a
value of a number depends on the position of the digits.
The number 123 has a different value than the number 321,
although the same digits are used in both numbers.
The value of each digit in such a number is determined by
three considerations:
The digit itself
The position of the number
The base of the number system
Decimal Number System
The number system that we use in our day-to-day life is called
decimal number system.
In this system the base is equal to 10 because there are
altogether ten symbols or digits (0,1,2,3,4,5,6,7,8,9) used in the
system.
The successive positions to the left of the decimal point
represent units, tens, hundreds, thousands, etc.
Binary Number System
The binary numeral system (base 2 numerals) represents
numeric values using two symbols, typically 0 and 1.
More specifically, binary is a positional notation with a radix
of two. Owing to its relatively straightforward implementation
in electronic circuitry, the binary system is used internally by
virtually all modern computers
Each position in a binary number represents a power of
the base (2).
As such in this system the right most position is the units
(20) the second position to the right is the 2`s (21) position
proceeding in this way we have 4`s (22), 8`s (23) etc.
Example
The decimal equivalent of the binary number 10101 (written
as 10101 2) is
= 1*24+ 0*23 +1*22+0*21+1*20
=16+0+4+0+1
=21
Octal Number System
In octal number system the base is 8. so, in this system
there are only eight symbols or digits(0,1,2,3,4,5,6,7).
Hexadecimal Number System
The hexadecimal system uses base 16.
Thus, it has 16 possible digit symbols.
It uses the digits 0 through 9 plus the letters A, B, C, D, E,
and F as the 16 digit symbols.
Numbers in base 16 need 16 symbols. The letters A-F are
used to give 16 symbols.
Decimal 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Hexadecimal 0 1 2 3 4 5 6 7 8 9 A B C D E F
Bit “0”
1010112 => 1 x 20 = 1
1 x 21 =
2
0 x 22 =
0
1 x 23 =
8
0 x 24 =
0
1 x 25 =
32
Number System Conversions
II. Decimal-To-Binary Conversion
Technique
Divide by two, keep track of the
remainder
First remainder is bit 0 (LSB, least-
significant bit)
Second remainder is bit 1
Etc.
Example
2 125
2 62 1
2 31 0
15 1 12510 = 11111012
2
7 1
12510 = ?2 2
2 3 1
2 1 1
0 1
Number System Conversions
III. Octal to Decimal
Technique
Multiply each bit by 8n, where n is the
“weight” of the bit
The weight is the position of the bit,
starting from 0 on the right
Add the results
Example
7248 => 4 x 80 = 4
2 x 81 = 16
7 x 82 = 448
(468)10
Octal Digit 0 1 2 3 4 5 6 7
Binary Equivalent 000 001 010 011 100 101 110 111
1 3 2 7
10110101112 = 13278
Number System Conversions
V. Octal to Binary
Technique
Convert each octal digit to a 3-bit equivalent binary
representation
Example
7058 = ?2 7 0 5
7058 = 1110001012
Number System Conversions
VI. Decimal to Octal
Technique
Divide by 8
Keep track of the remainder
Example
8 1234
123410 = ?8 154 2
8
8 19 2
2 3
8 123410 = 23228
0 2
Number System Conversions
VI. Hexadecimal to Decimal
Technique
Multiply each bit by 16n, where n is the “weight” of the
bit
The weight is the position of the bit, starting from 0 on
the right
Add the results
Example
16 1234
16 77 2
16 4 13 = D
123410 = ?16 0 4
123410 = 4D216
Number System Conversions
VIII. Binary-To-Hexadecimal
Technique
1. divide the binary digit into group of four (starting from
the right)
2. convert each group of four binary digit to one
hexadecimal digit.
Example
1011 0010 11112 = (1011) (0010) (1111) 2 = B
2 F16
Number System Conversions
VIIII. Hexadecimal-To-Binary
Technique
1: Convert the decimal equivalent of each hexadecimal
digit to four binary digits.
2: combine all the resulting binary groups in to a single
digit
Hexadecimal Digit 0 1 2 3 4 5 6 7
Binary Equivalent 0000 0001 0010 0011 0100 0101 0110 0111
Hexadecimal Digit 8 9 A B C D E F
Binary Equivalent 1000 1001 1010 1011 1100 1101 1110 1111
Example
Convert 5A816 to Octal.
5A816= 0101 1010 1000 (Binary)
= 2 6 5 0 (Octal)
End of this Chapter
Let me go practical