1.1.4 · HinglishHow Computers Work

Truth tables — all 16 binary operations

1,892 words9 min readRead in English

1.1.4 · Coding › How Computers Work


WHAT hai ek truth table?

HOW hum unhe naam dete hain: Output column ko rows ke liye upar-se-neeche ek 4-bit binary number ki tarah padho. E.g. AND output karta hai, isliye AND "function #1" hai.


WHY operations hote hain (scratch se derivation)


Sabhi 16 operations ki complete table

Inputs ordered . 4 output bits (upar→neeche) index banate hain.

# Name 00 01 10 11 Expression
0 FALSE (contradiction) 0 0 0 0
1 AND 0 0 0 1
2 A AND NOT B (inhibit) 0 0 1 0
3 A (left projection) 0 0 1 1
4 NOT A AND B 0 1 0 0
5 B (right projection) 0 1 0 1
6 XOR 0 1 1 0
7 OR 0 1 1 1
8 NOR 1 0 0 0
9 XNOR (equivalence) 1 0 0 1
10 NOT B 1 0 1 0
11 B → A (if B then A) 1 0 1 1
12 NOT A 1 1 0 0
13 A → B (implication) 1 1 0 1
14 NAND 1 1 1 0
15 TRUE (tautology) 1 1 1 1
Figure — Truth tables — all 16 binary operations

WHY NAND akela sab par raaj karta hai (functional completeness)


Worked examples


Common mistakes


Flashcards

Kitne distinct 2-input binary logic operations hote hain, aur kyun?
; 4-row output column mein possible fillings hoti hain.
-input Boolean functions ki sankhya ka general formula?
.
XOR aur OR ko kaun si row distinguish karti hai?
row: OR, XOR.
Rows 00,01,10,11 ke liye AND ka output column?
(function #1).
Ek single NAND gate se NOT kaise banate hain?
.
De Morgan use karke NAND se OR kaise banate hain?
.
Koi gate "functionally complete" kab hota hai?
Jab sirf usi gate se har Boolean function banaya ja sake (e.g. NAND, NOR).
Output column kaun sa function hai?
XNOR / equivalence (#9), tab true jab .
Function # aur # ka aapas mein kya rishta hai?
Yeh complements hain (saare output bits flip ho jaate hain).
Implication ki truth table — yeh 0 kab hoti hai?
Sirf jab .

Recall Feynman: 12-saal ke bache ko samjhao

Socho do light switches, aur , aur ek bulb hai. Bulb ya toh ON hai ya OFF. Switches set karne ke sirf 4 tarike hain: dono off, ek off ek on (do tarike), dono on. Un 4 settings mein se har ek ke liye tum bulb ke liye ON ya OFF decide karte ho. Kyunki 4 settings mein se har ek apna yes/no choice hai, bulb ke liye possible "rule books" hain. Har rule book ka ek naam hota hai jaise AND ("sirf tab on jab dono switches on hain") ya OR ("tab on jab kam se kam ek on hai"). Yahi hain saari 16 logic operations — kabhi 17vi nahi ho sakti.

Connections

  • Boolean algebra — symbolic rules (, , ) jo in tables ke peeche hain
  • Logic gates — physical components jo har function implement karte hain
  • De Morgan's laws — kyun , NAND/NOR universality ki key
  • Binary numbers — kyun aur counting
  • Functional completeness — NAND/NOR as universal gates
  • Adders and the ALU — XOR + AND milke binary addition karte hain

Concept Map

each is 0 or 1

listed with outputs

output column has 4 slots

2^4 fillings

read output column as 4-bit

examples

generalize

n=1

n=3

projections and constants

negations

Two input bits A and B

2^n input rows = 4

Truth table

Each slot independently 0 or 1

16 binary operations

Function number 0-15

AND OR XOR NAND NOR

2^2^n functions

4 functions

256 functions

A, B, FALSE, TRUE

NOT A, NOT B