Binary-Decimal System

decimal binary system
Share this post:

Decimal to Binary System

Conversion steps:

  1. Divide the number by 2.
  2. Get the integer quotient and remainder.
  3. Divide the quotient again by 2.
  4. Repeat the steps until the quotient is equal to 0.
  5. Remainder of each step will give the binary digits.
Division
by 2
QuotientRemainder
13/2 6 1
6/2 3 0
3/2 1 1
1/2 0 1


Example: Convert 1310 to binary

Therefore

1310 = 11012

Division
by 2
Quotient Remainder
174/2 87 0
87/2 43 1
43/2 21 1
21/2 10 1
10/2 5 0
5/2 2 1
2/2 1 0
1/2 0 1


Example: Convert 17410 to binary:

Therefore

17410 = 101011102

Fractional Decimal to Binary System

Conversion steps:

  1. Multiply the number by 2.
  2. Get the product and the integer part.
  3. Multiply the fractional part of the product by 2.
  4. Repeat the steps until the fractional part is equal to 0.
  5. Integer part of each step will give the binary digits.
Fraction Product
(Fraction x2)
Integer Part
0.125 0.250 0
0.250 0.500 0
0.500 1.0 1
0    

Example: Convert 0.125 into Binary

Therefore,

(0.125)10 = (0.001)2

Binary to Decimal System

Conversion steps:

N = bn qn… b3 q3 + b2 q2 + b1 q1 + b0 q0 +….

Where bx = Binary digits (bits: 0,1)              qx = 20,21,22

Example: 1012 = (1 * 22) + (0 * 21) + (1 * 20) = 5

1011001012 =1*28+0*27+1*26+1*25+0*24+0*23+1*22+0*21+1*20= 357

Fractional Binary to Decimal System

Above formula can be expanded into
N= b-1 q-1 + b-2 q-2 +….

Example:

0.1012 = (1*1/2) + (0*1/22) + (1*1/23)

0.1012 = 1*0.5 + 0*0.25 + 1*0.125

0.1012 = 0.625

Therefore 101.1012 =5.625


Author: admin