You are on page 1of 39

Number Systems

Rashmi Patil

© Copyright 2000 Indiana University Board of Trustees


Introduction to Numbering Systems

• We are all familiar with the decimal number


system (Base 10). Some other number
systems that we will work with are:

© Copyright 2000 Indiana University Board of Trustees


Radix Or Base
A number system has symbols starting from 0, and the
digits of the system are 0, 1, 2, ….. (r - 1) then the base
or radix is r.
1.For example, in the base10 number system, there is a
total of 10 digits used (zero to nine), therefore, its radix
is 10.
2.In the base2 number system, there are two numbers
used (zero and one), so its radix is two.
3.In the base8 number system, there are 8 numbers
used (zero to seven), so its radix is 8.

© Copyright 2000 Indiana University Board of Trustees


Decimal Number System

The decimal number system is a radix-10


number system and therefore has 10
different digits or symbols. These are 0,
1, 2, 3, 4, 5, 6, 7, 8 and 9.

© Copyright 2000 Indiana University Board of Trustees


Decimal Number System
• Thus the number
• dn-1 dn-2…..d 1 d0 means dn-1 10n-1 + dn-2 10n-2 + ……. +
d1 101 + d0 100
Base
10^4 10^3 10^2 10^1 10^0 10^-1 10^-2 10^-3

10000 1000 100 10 1 0.1 0.01 0.001

left of the decimal point Right of decimal point


5
© Copyright 2000 Indiana University Board of Trustees
Examples of Decimal Number System

Ex 1. the number 3528 has the magnitude


3528 = 3 × 103 + 5 × 102 + 2 × 101 + 8 × 100

Ex. 2 the number 26.57 has the magnitude

26.57 = 2 × 10 + 6 × 100 + 5 × 10-1 + 7 × 10-2

© Copyright 2000 Indiana University Board of Trustees


Binary Number System
• Also called the “Base 2 system”
• The binary number system is used to model the
series of electrical signals computers use to
represent information
• 0 represents the no voltage or an off state
• 1 represents the presence of voltage or an
on state

© Copyright 2000 Indiana University Board of Trustees


Binary Numbering Scale
Base 2 Base 10 Positional
Power
Number Equivalent Value

000 0 20 1
001 1 21 2
010 2 22 4
011 3 23 8
100 4 24 16
101 5 25 32
110 6 26 64
111 7 27 128

© Copyright 2000 Indiana University Board of Trustees


Decimal to Binary Conversion
• The easiest way to convert a decimal number to its
binary equivalent is to use the Division Algorithm
• This method repeatedly divides a decimal number by
2 and records the quotient and remainder 
– The remainder digits (a sequence of zeros and ones) form
the binary equivalent in least significant to most
significant digit sequence

© Copyright 2000 Indiana University Board of Trustees


Division Algorithm
Convert 67 to its binary equivalent:
6710 = x2
Step 1: 67 / 2 = 33 R 1 Divide 67 by 2. Record quotient in next row

Step 2: 33 / 2 = 16 R 1 Again divide by 2; record quotient in next row

Step 3: 16 / 2 = 8 R 0 Repeat again

Step 4: 8 / 2 = 4 R 0 Repeat again

Step 5: 4 / 2 = 2 R 0 Repeat again

Step 6: 2 / 2 = 1 R 0 Repeat again

Step 7: 1 / 2 = 0 R 1 STOP when quotient equals 0

© Copyright 2000 Indiana University Board of Trustees


Decimal to Binary Conversion for
Fractional Number

B) Convert the fractional part of decimal to


binary equivalent
1.Multiply the fractional decimal number by 2.
2.Integral part of resultant decimal number will
be first digit of fraction binary number.
3.Repeat step 1 using only fractional part of
decimal number and then step 2.

© Copyright 2000 Indiana University Board of Trustees


Conversion of .47 to binary
Ex 1.
Step 1: 0.47 X 2 = 0.94, Integral part: 0
Step 2: 0.94 X 2 = 1.88, Integral part: 1
Step 3: 0.88 X 2 = 1.76, Integral part: 1

So equivalent binary of fractional part of


decimal is 0.011

© Copyright 2000 Indiana University Board of Trustees


Binary to Decimal Conversion
• The easiest method for converting a binary
number to its decimal equivalent is to use the
Multiplication Algorithm
• Multiply the binary digits by increasing powers
of two, starting from the right
• Then, to find the decimal number equivalent,
sum those products

© Copyright 2000 Indiana University Board of Trustees


Multiplication Algorithm

© Copyright 2000 Indiana University Board of Trustees


Binary To Decimal Conversion

© Copyright 2000 Indiana University Board of Trustees


Octal Number System
• Also known as the Base 8 System
• Uses digits 0 - 7
• Readily converts to binary
• Groups of three (binary) digits can be used to
represent each octal digit
• Also uses multiplication and division
algorithms for conversion to and from base 10

© Copyright 2000 Indiana University Board of Trustees


Decimal ↔ Octal Conversion
The Process: Successive Division
• Divide the decimal number by 8; the remainder is the LSB of the
octal number .
• If the quotation is zero, the conversion is complete. Otherwise repeat
step (a) using the quotation as the decimal number. The new
remainder is the next most significant bit of the octal number.

Example:
Convert the decimal number 9410 into its octal equivalent.

 9410 = 1368

17
© Copyright 2000 Indiana University Board of Trustees
Example: Dec → Octal
Example:

Convert the decimal number 18910 into its octal equivalent.

Solution:

 18910 = 2758

18
© Copyright 2000 Indiana University Board of Trustees
Decimal To Octal Conversion

© Copyright 2000 Indiana University Board of Trustees


Octal ↔ Decimal Process
The Process: Weighted Multiplication
• Multiply each bit of the Octal Number by its corresponding bit-
weighting factor
• Sum up all of the products in step (a) to get the decimal number.

Example:
Convert the octal number 1368 into its decimal equivalent.

1 3 6
82 81 80
Bit-Weighting  136 8 = 9410
64 8 1 Factors
64 + 24 + 6 = 9410
20
© Copyright 2000 Indiana University Board of Trustees
Example: Octal → Dec
Example:

Convert the octal number 1348 into its decimal equivalent.

Solution:

1 3 4
82 81 80

64 8 1
 1348 = 9210

64 + 24 + 4 = 9210

21
© Copyright 2000 Indiana University Board of Trustees
Octal To Decimal Conversion

© Copyright 2000 Indiana University Board of Trustees


Hexadecimal Number System
• Base 16 system
• Uses digits 0-9 &
letters A,B,C,D,E,F
• Groups of four bits
represent each
base 16 digit

© Copyright 2000 Indiana University Board of Trustees


Decimal to Hexadecimal Conversion
Convert 83010 to its hexadecimal equivalent:

830 / 16 = 51 R14 = E in Hex


51 / 16 = 3 R3
3 / 16 = 0 R3

33E16

© Copyright 2000 Indiana University Board of Trustees


Decimal to Hexadecimal Conversion

© Copyright 2000 Indiana University Board of Trustees


Hexadecimal to Decimal Conversion
Convert (3B4F)16 to its decimal equivalent:

Hex Digits
3 B 4 F
x x x x
Positional Values
163 162 161 160
Products 12288 +2816 + 64 +15

15,18310

© Copyright 2000 Indiana University Board of Trustees


Hexadecimal to Decimal Conversion

© Copyright 2000 Indiana University Board of Trustees


Octal to Binary Conversion

© Copyright 2000 Indiana University Board of Trustees


Octal to Binary Conversion

© Copyright 2000 Indiana University Board of Trustees


Few more Examples

© Copyright 2000 Indiana University Board of Trustees


Hex to Binary Conversion

© Copyright 2000 Indiana University Board of Trustees


Hex to Binary Conversion

© Copyright 2000 Indiana University Board of Trustees


Binary to Hex Conversion

© Copyright 2000 Indiana University Board of Trustees


Few More Examples

© Copyright 2000 Indiana University Board of Trustees


Hex to Octal Conversion
For hexadecimal–octal conversion, the given hex number
is firstly converted into its binary equivalent which is
further converted into its octal equivalent.

© Copyright 2000 Indiana University Board of Trustees


Hex to Octal Conversion

© Copyright 2000 Indiana University Board of Trustees


Octal To Hex
• Firstly to convert the given octal number into
its binary equivalent and then convert the
binary number into an equivalent
Hexadecimal number

© Copyright 2000 Indiana University Board of Trustees


Octal To Hex
Ex. Convert (752)o to Hexadecimal.

© Copyright 2000 Indiana University Board of Trustees


Few more examples

© Copyright 2000 Indiana University Board of Trustees

You might also like