Skip to content
Binary Number System

Binary Number System

The Number system used in computers which only uses 0 and 1.

Binary DigitEquivalent Decimal Values
00
11

Binary Number uses 2x2^x as base value instead of 10x10^x like we use in decimal number.

Decimal to Binary Conversion

A software engineer is writing a program that will convert decimal numbers to binary. The engineer needs to test the program with a few different numbers. What are the binary equivalents of the decimal numbers 45?

452    \frac{45}{2} \implies Q1 = 22 & R1 = 1

222    \frac{22}{2} \implies Q2 = 11 & R2 = 0

112    \frac{11}{2} \implies Q3 = 5 & R3 = 1

52    \frac{5}{2} \implies Q4 = 2 & R4 = 1

22    \frac{2}{2} \implies Q5 = 1 & R5 = 0

12    \frac{1}{2} \implies Q6 = 0 & R6 = 1

02    \frac{0}{2} \implies Q7 = 0 & R7 = 0

4510=0101101245_{10} = 0101101_2

Binary to Decimal Conversion

Your grandfather gifted you a chocolate bar & your mother gave you a challenge to figure out, how much it costs ? Otherwise you can't play with that car. Your mother gave you this hint: Price amount is 111021110_2 in binary. How much rupees did it cost?

As we know the value of the car is 111021110_2 in binary, we have to convert it in decimal.

    (1×23)+(1×22)+(1×21)+(0×20)\implies (1 \times 2^3) + (1 \times 2^2) + (1 \times 2^1) + (0 \times 2^0)

    (1×8)+(1×4)+(1×2)+(0×1)\implies (1 \times 8) + (1 \times 4) + (1 \times 2) + (0 \times 1)

    8+4+2+0\implies 8 + 4 + 2 + 0

    14\implies 14

Now surprise your mother by shouting 14 Rupees. Then, snatch the chocolate bar & eat it!