2. Objective
1. Understand the concept of number systems.
2. Distinguish between non-positional and positional
number systems.
3. Describe the decimal, binary, OCTAL and HEXADECIMAL
system.
4. Convert a number in binary, octal or hexadecimal to a
number in the decimal system.
5. Convert a number in the decimal system to a number in
binary, octal and hexadecimal.
6. Convert a number in binary to octal and vice versa.
7. Convert a number in binary to hexadecimal and vice versa.
3. Introduction
A Number System (or system of numeration) is a writing
system for expressing numbers, that is a mathematical
notation for representing numbers of a given set,
using digits or other symbols in a consistent manner.
Ideally, a numeral system will Represent a useful set of
numbers (e.g. all integers, or rational numbers) Give
every number represented a unique representation (or at
least a standard representation)
Reflect the algebraic and arithmetic structure of the
numbers.
4.
5. Types of Number System
I. Positional Number
II. Non-Positional Number
Positional Number-
In a Positional Number System there are only a few symbols called
represent different values, depending on the position they occupy in a
number. The value of each digit in such a number is determined by three
considerations
a. The digit itself
b. The position of the digit in the number
c. The base of the number system(where
base is defined as the total number of
digits available in the number system)
Non-positional Number-
In This system we have symbols such as I for 1,II for 2,III for 3 etc.
Each symbols represents the same value regardless of its position in a
number and to find the value of a number.
7. The Binary System(base 2)
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 ={1,0}
The symbols in this system are often
referred to as binary digits or bits (binary
digit).
8. The Decimal System(base 10)
The word decimal is derived from the Latin
root decem (ten). In this system the base b =
10 and we use ten symbols
s={0,1,2,3,4,5,6,7,8,9}
Example:-
9. The Octal System(base 8)
The word octal is derived from the Latin root octo
(eight). In this system the base b = 8 and we use
eight symbols to represent a number. The set of
symbols is
S={0,1,2,3,4,5,6,7}
The base of the octal number system is eight,
so each position of the octal number
represents a successive power of eight. From
right to left
10. The Hexadecimal System(base 16)
The word hexadecimal is derived from the Greek
root hex (six) and the Latin root decem (ten). In
this system the base b = 16 and we use sixteen
symbols to represent a number. The set of
symbols is
S={0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F}
Note that the symbols A, B, C, D, E, F are
equivalent to 10, 11, 12, 13, 14, and 15 respectively.
The symbols in this system are often referred to as
hexadecimal digits.
11. Common Number Systems
System Base Symbols
Used by
humans?
Used in
computer
s?
Decimal 10 0, 1, … 9 Yes No
Binary 2 0, 1 No Yes
Octal 8 0, 1, … 7 No No
Hexa-
decimal
16 0, 1, … 9,
A, B, …
F
No No
16. Binary to Decimal
Technique
Multiply each bit by 2n, 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
17. Example
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
4310
18. 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
20. 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
21. Example
ABC16=>
C x 160 = 12x1 = 12
B x 161 = 11x16 = 176
A x 162 = 10x256= 2560
274810
22. Decimal to Binary
Technique
Divide by two, keep track of the remainder
First remainder is bit 0 (LSB, least-significant bit)
Second remainder is bit 1
Etc.