3.3.4 · HinglishCombinational Circuits

Subtractors

1,915 words9 min readRead in English

3.3.4 · Hardware › Combinational Circuits


KYA hai ek subtractor?

Do prakar ke hote hain:

  • Half Subtractor (HS) — 2 bits subtract karta hai, incoming borrow ko ignore karta hai.
  • Full Subtractor (FS) — 2 bits subtract karta hai saath mein ek incoming borrow-in bhi.

KYUN borrow (carry nahi)?


Half Subtractor — scratch se derive karo

Hum single bits ke liye compute karte hain. Sab cases enumerate karo (yeh Feynman-level imandaari hai — kabhi truth table guess mat karo, usse banao):

(diff) (borrow)
0 0 0 0 0
0 1 → borrow, result 1 1
1 0 1 1 0
1 1 0 0 0

Row 2 kyun? unsigned column mein nahi ho sakta, isliye hum borrow karte hain: se milta hai, aur hum mark karte hain kyunki humne upar se liya.

Ab columns ko boolean functions ki tarah padho:

  • jab exactly ek input 1 ho → woh hai XOR.
  • sirf us row mein jahan → woh hai .

Full Subtractor — scratch se derive karo

Ab ek borrow andar aata hai pichle (neeche wale) column se, . Hum compute karte hain.

0 0 0 0 0 0
0 0 1 1 1
0 1 0 1 1
0 1 1 0 1
1 0 0 1 1 0
1 0 1 0 0 0
1 1 0 0 0 0
1 1 1 1 1

column teen ka XOR kyun hai? Difference bit 1 hota hai jab teeno inputs mein se odd number inputs 1 hon (check karo: rows jahan 1,1,1 ya sirf ek 1 ho wahan aata hai). Teen bits ka odd-parity hi teen-input XOR hota hai.

algebraically derive karna (yeh full-adder carry derivation ko mirror karta hai). wali rows ko two-stage idea se group karo. Subtraction ko do half-subtracts ke roop mein karo:

  1. Pehle : intermediate diff aur borrow deta hai.
  2. Phir : final aur borrow deta hai.
  3. Overall borrow tab chahiye hoga jab koi bhi subtract ne borrow kiya ho: .

simplify karo, toh:

Ek neater standard SOP form (truth table se verify karo) hai:

Figure — Subtractors

80/20 shortcut: subtraction = 2's complement ka addition

KYUN kaam karta hai: ka 2's complement hai, isliye . Woh sirf carry-out hai jise tum discard karte ho, aur bachta hai.


Worked examples


Common mistakes


Forecast-then-Verify

Recall Dekhne se pehle predict karo

Q: FS ke liye mein aur kya honge? Forecast: , koi borrow nahi. Verify: ✓, ✓.


Recall Feynman: ek 12-saal ke bacche ko samjhao

Socho tumhare paas ek ke upar ek rakhay huay jars mein candies hain. Upar wale jar mein kuch hain, neeche wale mein kuch hain, aur tumhe neeche wali quantity upar se hatani hai. Agar upar wale jar mein enough na ho, tum seedha upar jao aur agle jar se ek bada bundle borrow lo (binary mein 2 candies worth) — lekin ab us upar wale jar pe ek wापas dena hai, aur wahi "ek dena hai" note borrow-out hai. Difference bit bas wohi candies hain jo us jar mein bachi hain. Subtractor bas itna karta hai: bachi hui candies (difference) aur "main upar ka dena hun" wala note (borrow).


Connections

  • Adders — subtractor mein Sum XOR shared hai; borrow, carry ko inverted ke saath mirror karta hai.
  • Twos-Complement-Representation ki basis.
  • Adder-Subtractor-Circuit — ek XOR-controlled unit dono kaam karta hai.
  • XOR-Gate — difference bit ke peeche parity behaviour.
  • Ripple-Carry-Chains — multi-bit subtraction ke liye FS cascade karna.

Flashcards

Half subtractor difference expression
Half subtractor borrow expression
Half-subtractor borrow kyun hai nahi?
Tum tab borrow karte ho jab upar wala bit ho aur neeche wala bit ho.
Full subtractor difference expression
Full subtractor borrow expression
(equivalently )
Adder-Sum aur subtractor-Difference logic mein farq
Koi nahi — dono inputs ka XOR hain.
Full-subtractor borrow full-adder carry se kaise alag hai?
ki jagah rakh do: vs .
Adder use karke kaise compute karein?
(B invert karo, carry-in ko 1 set karo).
2's-complement subtraction kyun kaam karta hai?
, isliye ; carry discard kar do.
Multi-bit subtraction mein final borrow-out ka kya matlab hai?
Agar 1 hai, result negative hai (); agar 0 hai, .
FS row ke liye batao.
, ( subtract kar rahe hain).
Full subtractor mein teen-input XOR kyun hai?
Difference tab 1 hota hai jab teeno inputs mein se exactly odd number inputs 1 hon (odd parity).

Concept Map

computes

computes

mirror of

uses carry vs

two kinds

two kinds

ignores

includes

diff is

borrow is

diff is

from

truth table

truth table

Subtractor

Difference D

Borrow Bout

Adder

Half Subtractor

Full Subtractor

Borrow-in Bin

D equals A XOR B

Bout equals notA and B

D equals A XOR B XOR Bin

Odd parity of 3 bits

Enumerated cases