Numbering System

Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

Numbering System

1
What is Base?
A value of each digit in a number can be determined using
• The digit
• The position of the digit in the number
• The base of the number system (where base is defined as the
total number of digits available in the number system).
Numberb= [dn,…,d2,d1,d0] = anbn + an-1bn-1 + … + a1b1 + a0b0
Where,
d: digits
a: digits e.g. 0,1,2,3,4,….
b: Base of the number
2
Different Numbering System
• Base-10 or Decimal
• Binary(Base-2)
• Octal(Base-8)
• Hexadecimal(Base-16)

3
Conversion
• Decimal to Any
• Any to Decimal
• Binary and Octal
• Binary and Hexadecimal

4
Decimal to Any
• Divide the decimal number by Base and take its
remainder
• The process is repeated until it produces the result of 0
• The resulting number is obtained by taking the
remainder from the bottom to the top
For fractions
• Multiply the decimal number by Base and take whatever
is left before decimal point
• The process is repeated until it produces the result of 0
• The resulting number is obtained by taking the values
from top to bottom 5
Any to Decimal
• Use the formual
N = anbn + an-1bn-1 + … + a1b1 + a0b0
Where:
N: Decimal Equivalent
b: base
ai: i-th digit

6
Binary and Octal
Theorem: If base R1 is the integer power of other
base, R2, i.e. R1 = R2d e.g. 8 = 23. Every group of d
digits in R2 (e.g. 3 digits) is equivalent to 1 digit in
the R1 base.

From the theorem, assume that R1 = 8 (base-8)


octal and R2 = 2 (base-2) binary from the theorem
above, R1 = R2d as 8 = 23. So, 3 digits in base-2
(binary) is equivalent to 1 digit in base-8 (octal).
7
Binary and Octal
Binary Octal

000 0

001 1

010 2

011 3

100 4

101 5

110 6

8
111 7
Binary and Octal
Binary to Octal
• At first make group of three digits starting from the right. If in
last the digits can’t be rounded up to three add 0 to the left.
• Replace each group accordingly with the help of the table
• Sequence the numbers as the groups are created

Octal to Binary
• Replace each digit with its equivalent three digits
• After joining the numbers if any 0s are left at the leftmost
erase them
9
Binary and Hexadecimal
• Theorem: If base R1 is the integer power of other base,
R2, i.e. R1 = R2d e.g. 8 = 24. Every group of d digits in R2
(e.g. 4 digits) is equivalent to 1 digit in the R1 base.

• From the theorem, assume that R1 = 16 (base-16) octal


and R2 = 2 (base-2) binary from the theorem above, R1 =
R2d as 8 = 24. So, 4 digits in base-2 (binary) is equivalent
to 1 digit in base-16 (hexadecimal).
10
Binary to Hexadecimal
Binary Hexadecimal

0000 0

0001 1
0010 2

0011 3

0100 4

0101 5
0110 6
0111 7

1000 8

1001 9

1010 A

1011 B

1100 C
1101 D
11
1110 E

1111 F
Binary to Hexadecimal
Binary to Hexadecimal
• At first make group of four digits starting from the right. If in
last the digits can’t be rounded up to three add 0 to the left.
• Replace each group accordingly with the help of the table
• Sequence the numbers as the groups are created

Hexadecimal to Binary
• Replace each digit with its equivalent three digits
• After joining the numbers if any 0s are left at the leftmost
erase them
12

You might also like