Conversion of Decimal to Binary and Binary to Decimal

Decimal to binary: divide by 2 repeatedly and read the remainders upward; binary to decimal: multiply each bit by its power of 2 and add.

10 min read · 10 cards · 2 checks

Read in: English · हिन्दी · ગુજરાતી


Theory

Write 25 the computer's way

Chirag scribbles 25 on the shop's whiteboard and hands you the marker: "That is how humans write it. Show me how the machine stores it."

Inside the machine there are only switches: on, off, on... so 25 must become a row of 1s and 0s.

Two mechanical recipes convert in each direction, and between them they are the most guaranteed marks in this entire subject: pure method, zero theory to forget.

Follow along

Decimal → binary: divide down, read up

  1. Divide the number by 2 Write the quotient below, the remainder (0 or 1) beside it.
  2. Keep dividing each quotient by 2 Every step leaves remainder 0 or 1. Continue until the quotient is 0.
  3. Read the remainders BOTTOM to TOP The last remainder is the leftmost bit. This direction is where all the marks are lost.
  4. Verify by converting back Thirty seconds of positional sum catches every slip.

Theory

Worked: 25 → binary

25 ÷ 2 = 12 remainder 1

12 ÷ 2 = 6 remainder 0

6 ÷ 2 = 3 remainder 0

3 ÷ 2 = 1 remainder 1

1 ÷ 2 = 0 remainder 1

Read the remainder column bottom to top: 11001.

So 25 = 11001₂. Why bottom-up? The first remainder tells you whether the number is odd or even, which is the LAST (rightmost) bit. Each later division works on bigger chunks, producing more significant bits.

Theory

Binary → decimal: the power ladder

The reverse direction is last topic's positional rule. Write the powers of 2 over the bits, right to left: 1, 2, 4, 8, 16, 32, 64, 128...

bits: 1 1 0 0 1

power: 16 8 4 2 1

Add the powers under the 1s, ignore the 0s:

16 + 8 + 1 = 25 ✓

Same number returns, which is exactly the verification habit from the steps: every conversion answer in an exam should make this round trip.

Think first

Your turn: 13

Convert 13 to binary on paper with the division method. Then convert your answer back with the power ladder. Do both before revealing.

Show the answer

13 ÷ 2 = 6 r 1; 6 ÷ 2 = 3 r 0; 3 ÷ 2 = 1 r 1; 1 ÷ 2 = 0 r 1

Bottom to top: 1101.

Check: 8 + 4 + 0 + 1 = 13 ✓

If you got 1011, you read the remainders top-down, the single most common conversion error. Divide down, read UP.

Quiz

What is 1010₂ in decimal?

  1. 10
  2. 5
  3. 20
  4. 101
Show the answer

10

Powers under the bits: 8, 4, 2, 1. Ones sit on 8 and 2, so 8 + 2 = 10. If you chose 5 you read the bits reversed (0101), and 101 means you treated the binary as if it were already decimal. Lay the power ladder over the bits every single time.

Watch out

The two mark-eaters

Reading remainders top-down: gives a perfectly wrong mirror answer; the method is divide DOWN, read UP. Slipping on the ladder: memorise 1, 2, 4, 8, 16, 32, 64, 128 until it recites itself; one wrong power poisons the whole sum. Show the division table in exams, method marks survive even a final arithmetic slip.

Formula

Exam recipe

For "convert X to binary": write the division table with a remainder column, box the remainders read bottom-up, then add one verification line converting back. For "convert bits to decimal": write the power ladder above the bits, sum the powers under the 1s. Both formats are exactly what examiners award full method marks to.

Theory

Where you will use this constantly

Next topic adds and subtracts these bit-strings, the ALU's daily work. The address-bus 2ⁿ rule, ASCII codes, subnet masks in networking (Sem 5), even the colour #FF5733: all become readable once conversions are reflex. Practise until 0 to 31 feel like old friends.

Summary

Key takeaways

  • Decimal → binary: divide by 2 repeatedly, read remainders bottom to top.
  • Binary → decimal: power ladder (1,2,4,8,16,...), sum the powers under the 1s.
  • Always verify with the reverse conversion, it costs 30 seconds.
  • The first remainder is the rightmost bit (odd/even test).
  • Show the division table: method marks survive arithmetic slips.
  • Memory hook: divide down, read up.

Study this properly

This page is the lesson to read. In Gri-Learn the same topic is a graded deck: the self-checks are scored and your weak topics are tracked. Free to start.

Start this topic

Already have an account? Sign in

More from Basic Computer Architecture

Gri-Learn · syllabus-mapped B.C.A. lessons in English, Hindi and Gujarati

Conversion of Decimal to Binary and Binary to Decimal · Introduction to Computers · Gri-Learn