Numbersystems DE slt1

You might also like

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 35

U18EI309 Digital Electronics

Introduction to Number Systems

Self learning topic- 1(SLT-1)

R.Nirmaladevi

KAKATIYA INSTITUTE OF TECHNOLOGY AND SCIENCE ::WARANGAL


Objective of the Lecture
This class will develop students’ knowledge on

• representation of Number Systems with


different bases

• conversions from one base to another

U18EI309 Digital Electronics R.NirmalaDevi ,KITSW W1-SLT1-Number Systems


INTRODUCTION TO NUMBER SYSTEMS
Number system is the way to represent a
quantity in different forms using distinct
symbols. It provides the basis for all operations
in information processing systems.

Any number system has ordered set of symbols


called DIGITS.
In conventional arithmetic, a number system
based on ten symbols (0 to 9) is used (Decimal
Number system).
U18EI309 Digital Electronics R.NirmalaDevi,KITSW W1-SLT1-Number Systems
INTRODUCTION TO NUMBER SYSTEMS

Arithmetic and logic circuits used in computers


and other digital systems operate with only 0's
and 1's (Number system with two symbols)

U18EI309 Digital Electronics R.NirmalaDevi ,KITSW W1-SLT1-Number Systems


Base or Radix of a Number System :
The number of symbols used in a number system
is called the Base or Radix of the number system.

A number base or radix indicates how many


different symbols are available when using a
particular numbering system.

The largest digit is one less than the base.

U18EI309 Digital Electronics R.NirmalaDevi ,KITSW W1-SLT1-Number Systems


Base or Radix of a Number System :
Example, decimal is number system has base 10,
which means it uses ten symbols

0, 1, 2, 3, 4, 5, 6, 7, 8 and 9.

Binary number system base is 2 and uses 2


symbols
0 and 1
The number base also determines how many
digits are needed to represent a number
U18EI309 Digital Electronics R.NirmalaDevi ,KITSW W1-SLT1-Number Systems
Base or Radix of a Number System:
How many digits does the number 78 in
decimal (base 10) requires
two digits.
The binary (base 2) equivalent is 1001110 which
requires seven digits.
When very long binary numbers are needed,
other number bases with fewer digits to
represent the numbers are ----base 4, octal,
hexadecimal)
U18EI309 Digital Electronics R.NirmalaDevi ,KITSW W1-SLT1-Number Systems
U18EI309 Digital Electronics R.NirmalaDevi,KITSW W1-SLT1-Number Systems
Formulation of the Number system :

Decimal is number system has base 10, and


uses ten symbols :
0, 1, 2, 3, 4, 5, 6, 7, 8 and 9.

Any quantity between 0 and 9 can be


represented uniquely using these symbols
(digits)

How do we represent a quantity greater than 9 ??

U18EI309 Digital Electronics R.NirmalaDevi ,KITSW W1-SLT1-Number Systems


Number Representation
Each digit of a number represented using a
particular base (b) has a positional value or place
value obtained by multiplying the digit by the base
raised to an appropriate power depending on the
position.

U18EI309 Digital Electronics R.Nirmalaevi ,KITSW W1-SLT1-Number Systems


Number Representation

U18EI309 Digital Electronics R.NirmalaDevi ,KITSW W1-SLT1-Number Systems


Number Representation

The leftmost digit in any number representation


which has the greatest positional weight is called
the Most Significant Digit (MSD)
and the rightmost which have least positional
weight are called the Least Significant Digit (LSD).

U18EI309 Digital Electronics R.NirmalaDevi ,KITSW W1-SLT1-Number Systems


Number Representation

Thus the Position Value of each Digit is base raised to


the position value

4 3 2 1 0 Position value
4
N4 N3 N2 N1 N0 Digits of decimal
number(b=10)
10 4 10 3 10 2 10 1 0 Weight of each position
10
(positional weights)

U18EI309 Digital Electronics R.NirmalaDevi ,KITSW W1-SLT1-Number Systems


Number Representation

U18EI309 Digital Electronics R.NirmalaDevi ,KITSW W1-SLT1-Number Systems


PLYNOMIAL REPRESENTATION OF A NUMBER:
In a number system whose base or radix is 'b', a
positive number N is represented by the
polynomial.
q 1 o 1 p
N  aq 1b  ......  aob  a1b  .....  a pb
q 1

 ab N 
where the base ‘b’ is an integer greater than 1
i  p
i
i

and the a’s are integers in the range 0 to b-1

U18EI309 Digital Electronics R.Nirmaladevi ,KITSW W1-SLT1-Number Systems


PLYNOMIAL REPRESENTATION OF A NUMBER:
q 1 o 1 p
N  aq 1b  ......  ao b  a1b  .....  a p b

The sequence of digits aq-1 to a0 constitutes the


integer part of N and the sequence a1 to ap
constitutes the fractional part of N.

The integer and fractional parts are separated


by radix point.

U18EI309 Digital Electronics R.NirmalaDevi,KITSW W1-SLT1-Number Systems


PLYNOMIAL REPRESENTATION OF A NUMBER:
A number in the base b is usually denoted as
(N)b.
Whenever the base is not mentioned it is
implied that the number is a decimal number.

Example: 3721.65 =
3*103 + 7*102 + 2*101 + 1*100 + 6*10-1 + 5*10-2
= 3000 +700 +20 +1 +0.6 +0.05

U18EI309 Digital Electronics R.NirmalaDevi ,KITSW W1-SLT1-Number Systems


Number Systems
Decimal Binary Octal Hexadecimal
examples: Base=10 Base=2 Base=8 Base=16
0 0 0 0
Decimal
1 1 1 1
(8342.10)10 or 8342.10 2 10 2 2
Binary 3 11 3 3
4 100 4 4
(1011101.101)2 5 101 5 5
Octal 6 110 6 6
7 111 7 7
(2346)8 8 1000 10 8
Hexadecimal 9 1001 11 9
10 1010 12 A
(23AB.3C)16 11 1011 13 B
Number with base 6 12 1100 14 C
13 1101 15 D
(235.45)6
14 1110 16 E
Number with base 7 15 1111 17 F
(156.34)7 16 10000 20 10

U18EI309 Digital Electronics R.NirmalaDevi ,KITSW W1-SLT1-Number Systems


NUMBER SYSTEM CONVERSIONS
(i)Any base to decimal:

Step 1 − Determine the weight ( positional value) of


each digit (this depends on the position of the digit
and the base of the number system).

Step 2 − multiply each digit by its respective weight.


Step 3 − Sum the products calculated in Step 2. The
total is the equivalent value in decimal.
 n1
a r n 1
 .....  a1r 1
 a0 r 0
  decimal value
where a=digit/bit value and r=base/radix
U18EI309 Digital Electronics R.nirmalaDevi ,KITSW W1-SLT1-Number Systems
Any base to decimal: Example:

Consider the binary number 11101 to be converted


to decimal
11 1 0 1
(MSB) LSB)

Binary Bit 1(MSB) 1 1 0 1(LSB)


Positional weight 2 4
23 22 21 20

Calculating Decimal Equivalent − ((1 × 24) + (1 × 23) + (1 × 22) + (0 × 21) + (1 × 20))10

=(16 + 8 + 4 + 0 + 1)10=2910

U18EI309 Digital Electronics R.NirmalaDevi,KITSW W1-SLT1-Number Systems


Any base to decimal: Example:
Example: Convert 2348 to decimal.

2348=2×82 + 3× 81 + 4×80 =2×64+3 × 8+4×1

=128+24+4=15610

Convert 0.2348 to decimal.

0.2348=2×8–1+ 3×8–2+4×8–3

=0.25+0.046875+0.0078125=0.304687510

Convert 4AB.2A16 to decimal number


4AB.2A=4*162+A*161+B*160+2*16–1+A*16–2
=4 *256+10*16+11*1+2*16–1+10*16–2
=1024+160+11+0.125+0.0390625=1195.164062510
U18EI309 Digital Electronics R.NirmalaDevi,KITSW W1-SLT1-Number Systems
Conversion of a decimal number to number with base b
When a decimal number is converted to a number
with base b, a method called double dabble is used
where the integer and fractional parts are separately
converted to base b
Step 1 − Divide the decimal number to be converted
by the value of the new base.
Step 2−Get the remainder from Step 1 as the rightmost

digit (least significant Digit ) of new base


Step 3 − Divide the quotient of the previous by the
new base number.
U18EI309 Digital Electronics R.NirmalaDevi ,KITSW W1-SLT1-Number Systems
Conversion of a decimal number to number with base b
When a decimal number is converted to a number with base b, a method called double
dabble is used where the integer and fractional parts are separately converted to base b

Step 1 − Divide the decimal number to be converted by the value of the new base.
Step 2 − Get the remainder from Step 1 as the rightmost digit (least significant Digit ) of
new base
Step 3 − Divide the quotient of the previous by the new base number.
Step 4 − Record the remainder from Step 3 as the next digit (to the left) of the new base
number.
Repeat Steps 3 and 4, getting remainders from right to left, until the quotient becomes zero in
Step 3.The last remainder thus obtained will be the Most Significant Digit (MSD) of the new
base number.

U18EI309 Digital Electronics R.NirmalaDevi ,KITSW W1-SLT1-Number Systems


Compute binary equivalent of Decimal Number: 2910

Step Operation quotient Remainder

Step 1 29 / 2 14 1 LSB

Step 2 14 / 2 7 0
( 11101)2
Step 3 7/2 3 1

Step 4 3/2 1 1

Step 5 1/2 0 1 MSB

U18EI309 Digital Electronics R.NirmalaDevi ,KITSW W1-SLT1-Number Systems


. The simplest way to convert a decimal number into binary is to express the
given decimal number as a sum of powers of base 2 as shown below.
124=64+32+16+8+4 =26+25+24+23+22
Obtain the equivalent binary number by writing 1s in the places whose
positional weight are found in the sum.

26 25 24 23 22 21 20
124 = 1 1 1 1 1 0 0

Example: Convert (327)10 to binary.


327=256+64+4+2+1
=28+26+22+21+20
28 27 26 25 24 23 22 21 20
327= 1 0 1 0 0 0 1 1 1

 (327)10  (101000111) 2

U18EI309 Digital Electronics R.NirmalaDevi ,KITSW W1-SLT1-Number Systems


Example: Convert (101.235)10 to binary.

Integer part=101 and fractional part 0. 235 are converted separately

2 101

2 50 1 LSB

2 25 0

2 12 1

2 6 0

2 3 0

2 1 1

0 1 MSB

Integer part= (1100101)2


Repeatedly divide the quotients with the base 2 until we get 0 as quotient. Write the
remainders in a sequence from bottom to top as shown

U18EI309 Digital Electronics R.NirmalaDevi ,KITSW W1-SLT1-Number Systems


Fractional Part=0.235

fractional part
0.235×2= 0.470 0
0.470×2= 0.940 0
0.940×2= 1.880 1
0.880×2= 1.760 1
0.760×2= 1.520 1

For fractional part, repeatedly multiply the fractional part with the base 2 and write the integer parts
in a sequence from top to bottom as shown

0.235= (0.00111)2

101.235= (1100101.00111)2

U18EI309 Digital Electronics R.NirmalaDevi,KITSW W1-SLT1-Number Systems


Convert decimal
Example: number
Convert the 23.476
23.47610totooctal
octal.
8 23 2310 =278 Integer Part
8 2 7 0.476  8=3.808 3 MSB
0 2 0.808  8=6.464 6
0.464  8=3.712 3
0.712  8=5.696 5
0.696  8=5.568 5 LSB
 0.47610  0.363558
 23.47610  27.363558

For integer part, repeatedly divide the quotients with the base 8 until we get 0 as quotient.
Write the remainders in a sequence from bottom to top .
For fractional part Repeatedly multiply the fractional part with the base 8 and write the
integer parts in a sequence from top to bottom as shown

U18EI309 Digital Electronics R.NirmalaDevi ,KITSW W1-SLT1-Number Systems


Convert 696.565 to hexadecimal
Step Operation quotient Remainder

Step 1 696/16 43 8 LSD

Step 2 43/16 2 11(=B) (2B8)16

Step 3 2/16 0 2 MSD

Multiplication Fraction part of Product Integer part of Product


(digits of the new base )
0.565×16=9.04 .04 9 (0.90A3D)16
.04×16=0.64 .64 0 (for 05
.64×16=10.24 .24 10(=A) significant

.24×16=3.84 .84 3 digits)

.84×16=13.44 .44 13(=D)

2B8.90A3D

U18EI309 Digital Electronics R.NirmalaDevi,KITSW W1-SLT1-Number Systems


Conversion from any base b which is power of 2 (b=2n) to binary
[Conversion of octal number and hexadecimal numbers to binary]

Any digit in base b (b=2^n) requires n binary bits to be represented in Binary.


For example any octal digit corresponds to three binary digits and Hex digit corresponds to 4
binary bits.
Therefore represent each digit of base b number with corresponding number of binary bits.

U18EI309 Digital Electronics R.NirmalaDevi,KITSW W1-SLT1-Number Systems


Example: Convert 23AB16 to binary.
23AB16 = 0010 0011 1010 1011

Example: Convert 1B2A. 01216 to binary


1B2A. 01216 = 0001 1011 0010 1010 . 0000 0001 0010

Example: Convert 173. 0128 to binary


173. 0128 = 001 111 011 . 000 001 010

U18EI309 Digital Electronics R.NirmalaDevi,KITSW W1-SLT1-Number Systems


Conversion From Binary To Any Base B which is power of 2 (B=2^n)

The binary digits are grouped as ‘n’ bits together from LSB to MSB for integer part of

number, if groupings of ‘n’ are not possible then zeroes are padded before the MSB

for fractional part the groupings are done towards right of binary point and zeroes

are padded towards right at the end of the number to make groupings of ‘ n ‘. Each

group of n bits is now represented by the equivalent new base digit

U18EI309 Digital Electronics R.NirmalaDevi,KITSW W1-SLT1-Number Systems


start from the binary point and proceed towards the left and right segmenting the integer and
fractional parts into groups of 4 bits as follows. If the last segments fall short of bits append
zeros so to make groups of 4 bits.
Convert 1011011.0110112 to hexadecimal
0101 1011.0110 1100 =5 B. 6C

Convert 1011011.0110112 to octal


001 011 011 . 011 011 = 133.33

Convert 101101011.010112 to hexadecimal


0001 0110 1011 . 0101 1000 = 15 B. 58

Example: Convert 101101011.010112 to octal


101 101 011 . 010 110 = 553.26

U18EI309 Digital Electronics R.NirmalaDevi ,KITSW W1-SLT1-Number Systems


Outcome of the Lecture
Having listened to this lecture you should be able to

• represent numbers using polynomial expansion

• convert Number System of one base to another

U18EI309 Digital Electronics R.NirmalaDevi ,KITSW W1-SLT1-Number Systems


Thank you

U18EI309 Digital Electronics Prof.M.Sreelatha ,KITSW W1-SLT1-Number Systems

You might also like