Derivation from scratch (decimal first, so the idea is familiar):
Why does "253" equal two-hundred-fifty-three? Because we agreed each slot is worth ten times the slot to its right:
253=2⋅102+5⋅101+3⋅100=200+50+3Why this step? The leftmost digit is "further from the units" by two positions, so it's scaled by 102.
Now swap base 10 → base 2. The only thing that changes is the weights become powers of 2, and allowed digits shrink to {0,1}:
What base does the binary system use, and why is it natural for computers?
Base 2; computer switches have exactly two stable states (off=0, on=1), which are cheap and noise-resistant.
Binary→decimal: what is the weight of the bit at position i (rightmost = 0)?
2i.
Convert 10112 to decimal.
8+0+2+1=11.
Convert 1101002 to decimal.
32+16+4=52.
What algorithm converts decimal to binary?
Repeated division by 2; record remainders; read them bottom-to-top.
Convert 1310 to binary.
1101.
Convert 2010 to binary.
10100.
In repeated division, which remainder is the most significant bit?
The LAST remainder (when quotient reaches 0).
How many distinct values can n bits represent, and what is the largest?
2n values, from 0 to 2n−1.
Largest value in 8 bits?
111111112=255.
In counting, how often does each bit flip relative to the bit on its right?
Half as often (its weight is double).
Why does the remainder of N÷2 give the last binary bit?
It's 1 iff N is odd; 20 is the only odd-weighted column.
Recall Feynman: explain to a 12-year-old
Imagine a row of light switches. Each switch is OFF or ON — that's all it can do. We say OFF means 0 and ON means 1. To count, the rightmost switch flips on every step. When it can't go higher (it's already ON), it turns OFF and "pokes" the switch to its left to flip — just like a car's mileage counter where 9 rolls over to 0 and bumps the next digit. To find what a row of switches means as a normal number, give each switch a value: the right one is worth 1, then 2, 4, 8, 16… (doubling each time). Add up the values of only the switches that are ON. That's the number!
Dekho, computer ke andar sirf switches hote hain — ya toh OFF (0) ya ON (1). Bas do hi states. Isiliye computer ka apna number system base 2 yaani binary hai. Decimal (base 10) hum isliye use karte hain kyunki humare paas 10 ungliyaan hain, warna usme bhi koi magic nahi hai. Dono mein same "place-value" ka funda chalta hai: har position ka ek weight hota hai. Decimal mein weights hote hain 1, 10, 100… (das se multiply); binary mein weights hote hain 1, 2, 4, 8, 16… (do se multiply, har baar double).
Binary se decimal nikalna sabse easy hai: bit ke upar uska weight likho (20,21,22… right se left), aur jahan-jahan bit 1 hai sirf wahi weights jod do. Jaise 1011 → 8+0+2+1=11. Bas itna hi!
Decimal se binary ke liye "repeated division by 2" karo: number ko 2 se divide karte raho, har baar remainder (0 ya 1) note karo, aur quotient ko aage le jao jab tak 0 na aa jaye. Phir remainders ko neeche se upar padho — kyunki pehla remainder units wala bit hai (sabse chhota), aur aakhri remainder sabse bada (leftmost) bit. 13 ko karo toh 1101 aata hai, check: 8+4+1=13.
Counting toh bilkul gaadi ke meter jaisa hai — rightmost digit har step pe flip hota hai, jab woh ON se aage nahi ja sakta toh 0 ho ke left wale ko carry deta hai. Aur ek important baat: n bits se aap 2n alag values bana sakte ho, lekin sabse bada number 2n−1 hota hai (kyunki ginti 0 se shuru hoti hai). 8 bits = 256 values, max = 255. Yeh off-by-one wali galti exam mein bahut log karte hain, isse bach ke rehna!