1.1.1 · HinglishHow Computers Work

Binary number system — conversions from - to decimal, counting in binary

1,824 words8 min readRead in English

1.1.1 · Coding › How Computers Work


WHY binary at all?


WHAT is place-value (har base ke peeche ka engine)

Scratch se derivation (pehle decimal, taaki idea familiar lage): "253" do-sau-tirpan kyun hai? Kyunki humne agree kiya hai ki har slot apne right wale slot se das guna zyada worth hai: Ye step kyun? Sabse baayi digit "units se" do positions door hai, isliye wo se scale hoti hai.

Ab base 10 → base 2 karo. Sirf itna badlega ki weights powers of 2 ban jaate hain, aur allowed digits sirf reh jaate hain:


HOW to convert Binary → Decimal


HOW to convert Decimal → Binary (repeated division)


Counting in binary

Figure — Binary number system — conversions from - to decimal, counting in binary

Forecast-then-Verify

Recall Forecast:

likhne ke liye kitne bits chahiye? Phir verify karo. Forecast: , . Kyunki , humein 7 bits chahiye. Verify (repeated division): r0, r0, r1, r0, r0, r1, r1 → bottom-up . Ye 7 digits hai ✓ aur ✓.


Common mistakes


Flashcards

Binary system kaunsa base use karta hai, aur ye computers ke liye natural kyun hai?
Base 2; computer switches ke paas exactly do stable states hote hain (off=0, on=1), jo saste aur noise-resistant hain.
Binary→decimal: position (rightmost = 0) par bit ka weight kya hota hai?
.
ko decimal mein convert karo.
.
ko decimal mein convert karo.
.
Decimal ko binary mein convert karne ka algorithm kya hai?
2 se repeated division; remainders record karo; unhe bottom-to-top padhna.
ko binary mein convert karo.
.
ko binary mein convert karo.
.
Repeated division mein most significant bit kaunsa remainder hota hai?
AAKHRI remainder (jab quotient 0 ho jaata hai).
bits kitni distinct values represent kar sakta hai, aur sabse badi value kya hai?
values, se tak.
8 bits mein sabse badi value?
.
Counting mein har bit apne right wale bit ke relative kitni baar flip karta hai?
Aadha baar (uska weight double hai).
ka remainder aakhri binary bit kyun deta hai?
Ye 1 hai iff odd hai; ek maatra odd-weighted column hai.

Recall Feynman: ek 12-saal ke bachche ko explain karo

Socho light switches ki ek row hai. Har switch sirf OFF ya ON ho sakta hai — bas itna hi kar sakta hai. Hum kehte hain OFF matlab 0 aur ON matlab 1. Count karne ke liye, sabse right wala switch har step mein flip karta hai. Jab wo aur upar nahi ja sakta (already ON hai), to OFF ho jaata hai aur left wale switch ko flip karne ke liye "dhakka" deta hai — bilkul car ke mileage counter ki tarah jahan 9 roll over ho kar 0 ho jaata hai aur agla digit bump ho jaata hai. Switches ki ek row ka normal number mein matlab nikaalney ke liye, har switch ko ek value do: right wala 1 worth hai, phir 2, 4, 8, 16… (har baar double). Sirf jo switches ON hain unki values add karo. Bas, wahi number hai!


Connections

  • Place-value and number bases — general idea (binary ka case hai).
  • Hexadecimal and Octal — lambi binary strings likhne ke shortcuts (base 16, base 8).
  • Bits and Bytes — ek byte = 8 bits = values 0–255.
  • Logic gates and switches — hardware two-state kyun hai.
  • Binary addition and overflow — counting/carry ko arithmetic tak generalize karna.
  • Two's complement — negative numbers in bits ko reuse kaise karte hain.

Concept Map

two states means

10 levels too fragile

favors 2 states

generalizes any base

weights are powers of b

weights become

sum on-columns

example

repeated division

remainder gives

read remainders

Switches OFF or ON

Base 2 binary

Why not decimal hardware

Positional place-value

Weight equals b to the i

Powers of 2: 1,2,4,8...

Binary to Decimal

1011 equals 11

Decimal to Binary

Last bit d0 odd or even

Bottom-to-top order