You are on page 1of 27

Number Systems

Number Systems
Computers only understand the numbers.
How Number system works?
when we enter data, the data is converted into
electronic pulse.
Each pulse is identified as code and the code is
converted into numeric format by ASCII. It gives
each number, character and symbol a numeric
value (number) that a computer understands.
Number Systems - Types
• Binary number system
• Octal number system
• Decimal number system
• Hexadecimal number system
Binary number system
It has only two digits '0' and '1'
so its base is 2.
Each digit is called a bit.
A group of four bits (1101) is called a nibble A
group of eight bits (11001010) is called a byte.
Number Systems
• The digit value in the number system is calculated
using
– The digit
– The index, where the digit is present in the number.
– Finally, the base numbers, the total number of digits
available in the number system
When the number system represents a digit from 0 - 9,
the base of the number will be 10.
Number Systems -Binary
a binary number system is used in the digital computers.
In this number system, it carries only two digits, either 0
or 1.
There are two types of electronic pulses present in a
binary number system.
The first one is the absence of an electronic pulse
representing '0‘
The second one is the presence of electronic pulse
representing '1'.
Each digit is known as a bit.
The location of a digit in a binary number represents a
specific power of the base (2) of the number system.
Number Systems -Characteristics
• It holds only two values, i.e., either 0 or 1. • It is also
known as the base 2 number system. • The position of
a digit represents the 0 power of the base(2).
Example: 20
• The position of the last digit represents the x power
x
of the base(2). Example: 2 , where x represents the
last position, i.e., 1
• Each successive digit represents a power of 2.
Examples:
(10100)2, (11011)2, (11001)2, (000101)2,
(011010)2.
Number Systems
-BinaryEach successive digit represents a
power of 2. For example,
1) 10011
= (1 X 24) + (0 X 23) + (0 X 22) + (1 X 21) + (1 X 20),
= 16 + 0 + 0 + 2 + 1 = 19
2) 1001
3 2 1 0
=(1 X 2 ) + (0 X 2 ) + (0 X 2 ) + (1 X 2 ),
= 1x 8 + 0x 4 + 0 x2 + 1 x 1
= 8 + 0+ 0+ 1
=9
Number Systems - Decimal
The decimal number system contains ten digits from 0 to
9(base 10).
The successive place value or position, left to the
decimal point holds units, tens, hundreds, thousands,
and so on
The position in the decimal number system specifies the
power of the base (10).
2541 consist of the digit
1 in the unit position,
4 in the tens position,
5 in the hundreds position,
and 2 in the thousand positions

Number Systems - Decimal


Example: 2541

(2×1000) + (5×100) + (4×10) + (1×1)


(2×103) + (5×102) + (4×101) + (1×100)
2000 + 500 + 40 + 1 2541
Number Systems - Octal
The octal number system has base 8
it has only eight digits from 0 to 7
There are only eight possible digit values to represent a
number.
With the help of only three bits, an octal number is
represented.
Each set of bits has a distinct value between 0 and 7.
Number Systems - Octal
Characteristics:
• An octal number system carries eight digits
starting from 0, 1, 2, 3, 4, 5, 6, and 7.
• It is also known as the base 8 number system. •
The position of a digit represents the 0 power of
the base(8). Example: 80
• The position of the last digit represents the x
x
power of the base(8). Example: 8 , where x
represents the last position, i.e., 1
• any number with base 8 is an octal number like
248, 1098, 558, etc.
Number Systems - Octal
Octal Digital Value Binary Equivalent 0 000

1 001

2 010

3 011
4 100

5 101

6 110

7 111

Number Systems - Octal


Convert (100010)2to octal number
100010
100→4
and 010→2
Therefore,(100010)2 = 428
decimal number to octal
19
19/8 = 2, Remainder = 3
2/8 = 0, Remainder = 2
Therefore, 1910 = 238
For octal number 138to binary
1 → 001
3 → 011
138 = 0010112
Number Systems -Octal
Binary number 1111 equivalent to in octal number
system 001111 → 001 111 → 17
(1111)2 → (17)8
Convert (100010)2 to octal number.
100→4
and 010→2
(100010)2 = 42
Octal to Decimal Number
1) 2158
2158 = 2 × 82 + 1 × 81 + 5 × 80
= 2 × 64+ 1 × 8 + 5 × 1 = 128 + 8 + 5
= 141
2) 1258 =1× 82 + 2 × 81 + 5 × 80
= 1 × 64 + 2 × 8 + 5 × 1 = 64+16+5
= 85
Number Systems -
HexadecimalNumber Representation
techniques
base is 16
there are only 16 symbols or possible digit values, there
are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.
Where A, B, C, D, E and F are single bit representations
of decimal value 10, 11, 12, 13, 14 and 15 respectively.
It requires only 4 bits to represent value of any digit.
Applications Hexadecimal Number System is
commonly used in Computer programming and
Microprocessors.
Hexadecimal Number System is commonly used in
Computer programming and Microprocessors.
Number Systems - Hexadecimal
The equivalent binary number of Hexadecimal number
are as given below.
Hex digit 1 0 2 3 4 5 6 7
Binary 0000 0001 0010 0011 0100 0101 0110 0111

Hex digit 8 9 A = 10 B = 11 C = 12 D = 13 E = 14 F = 15
Binary 1000 1001 1010 1011 1100 1101 1110 1111

Number Systems - Hexadecimal


The decimal value of any hexadecimal number can be determined using sum of
product of each digit with its positional value.
1) Hexa Decimal to Decimal
(200)16
= 2x162+ 0x161+ 0x160
= 2*256 + 0+ 0
=(512)10
2) Hexa Decimal number- (15)16
= 1x161+5x160
16 + 5 =(21)10
3) (A0)16
= A x 161 + 0 x 10
= 10 x 16 + 0x 1
=160
CONVERTING DECIMAL TO HEXADECIMAL
1) 1128
Start by dividing the number by 16, that is
(1128/16) = Result = 70 Remainder =8
(70/16) = Result = 4 Remainder = 6
4 / 16 = Result = 0 Remainder = 4
= (468)16
2) 256
Start by dividing the number by 16, that is
256 / 16 = Result = 16 Remainder =0
16 / 16 = Result = 1 Remainder =0
1 / 16 = Result = 0 Remainder =1
= (100)16
CONVERTING DECIMAL TO

HEXADECIMAL1) 188
Start by dividing the number by 16, that is
(188 / 16) = Result = 11 Remainder = 12
(C) 11 / 16 = Result = 0 Remainder = 11(B)
= (BC)16
2) 590
Start by dividing the number by 16, that
is 590 / 16= Result = 36 Remainder =
14(E) 36 / 16 = Result = 2 Remainder =4 2
/ 16 = Result = 0 Remainder =2 = (24E)16
Convert Hexadecimal number to Binary
(F8)16
F = 1111
8 = 1000
= (11111000)2
2) (1A) 16
1 = 0001
A = 1010
= (00011010)2
Hexadecimal to Octal Number System Conversion
Hexa 0 1 2 3 4 5 6 7 8 9 A B C D E F
deci
m al
Octal 0 1 2 3 4 5 6 7 10 11 12 13 14 15 16 17

Octal to Hexadecimal Number System Conversion


we have to first convert octal number to decimal and
then decimal to hexadecimal.
Convert (121)8into hexadecimal.
Solution: First convert 121 into decimal
2 1 0
number. ⇒ 1 × 8 + 2 × 8 + 1 × 8
⇒ 1 × 64 + 2 × 8 + 1 × 1
⇒ 64 + 16 + 1
⇒ 81 => (121)8 = 8110
81/16 = Result = 5 Remainder = 1
5/16 = Result = 0 Remainder = 5
= (51)16
Convert Hexadecimal number to Binary
HEX DECIMAL BINARY

0 0 = 0+0+0+0 0000
1 1 = 0+0+0+1 0001
2 2 = 0+0+2+0 0010
3 3 = 0+0+2+1 0011
4 4 = 0+4+0+0 0100
5 5 = 0+4+0+1 0101
6 6 = 0+4+2+0 0110
7 7 = 0+4+2+1 0111
8 8 = 8+0+0+0 1000
9 9 = 8+0+0+1 1001
A 10 = 8+0+2+0 1010
B 11 = 8+0+2+1 1011
C 12 = 8+4+0+0 1100
D 13 = 8+4+0+1 1101
E 14 = 8+4+2+0 1110
F 15 = 8+4+2+1 1111

Convert Decimal number to


Binary1) Convert 174 10 to binary

Division Quotient(Result) Remainder Bit #


by 2

174/2 87 0 0
87/2 43 1 1
43/2 21 1 2
21/2 10 1 3
10/2 5 0 4
5/2 2 1 5
2/2 1 0 6
1/2 0 1 7
17410 = 101011102
Convert Decimal number to
Binary2) Convert 13 10 to binary:

Division Quotient(Result) Remainder Bit #


by 2
13/2 6 1 0
6/2 3 0 1
3/2 1 1 2
1/2 0 1 3

1310 = 11012
Convert Decimal number to Binary
3)
3.1
125 into octal number.
First convert it into octal or hexadecimal number
(125)10
= 125/8 Result : 15 Reminder : 5
=15/8 Result: 1 Reminder :7
= 1/8 Result : 0 Reminder :1
= (175)8
Then convert it into binary number by converting each digit.
(001 111 101)2
3.2
= 125/16 Result : 7 Reminder : 13 – (D)
[13 equivalent hexa value is D)
= 7/16 Result : 0 Reminder : 7
= 7D
= 0111 1101

You might also like