Siksha Sarovar

Siksha Sarovar (sikshasarovar.com) is a free educational web application that helps students in India learn programming and prepare for academic and competitive exams. The platform offers structured coding courses (C, C++, Python, Java, HTML, CSS, PHP, Power BI, AI, Machine Learning, Data Science), complete university curriculum notes for BCA/MCA students with previous year question papers, Class 10 and Class 12 CBSE/HBSE school notes, and dedicated preparation material for SSC, UPSC, Banking, Railway and other government exams. Browsing the site is completely free and requires no account. Users may optionally sign in with Google solely to save their learning progress, quiz scores and personal preferences across devices.

Privacy Policy | Terms of Service | Contact Siksha Sarovar | About Siksha Sarovar

v4.0.9 · PWA
Siksha Sarovar logo
Siksha Sarovar
Your Learning Universe

Siksha Sarovar is a free e-learning platform for coding courses, BCA university notes and competitive exam preparation. Optional Google sign-in saves your learning progress across devices.

Initializing knowledge base…
Compiling modules 0%

Unit 1 — Logic Gates: Symbols, Truth Tables and Universal Gates

Lesson 6 of 49 in the free Computer Organization and Architecture notes on Siksha Sarovar, written by Rohit Jangra.

Logic Gates

A logic gate is the physical circuit that implements a Boolean operation. Gates are the atoms of every digital system in this course.

1. The Seven Gates — Complete Reference

GateExpressionSymbol shape00011011Remember it as
ANDY = A·BD-shape0001"all inputs 1"
ORY = A+Bcurved shield0111"any input 1"
NOTY = A'triangle + bubble10inverter
NANDY = (A·B)'AND + bubble1110"not all 1"
NORY = (A+B)'OR + bubble1000"none is 1"
XORY = A⊕BOR + extra curve0110"inputs differ"
XNORY = (A⊕B)'XOR + bubble1001"inputs are equal"

2. XOR and XNOR — the two that appear in every adder

   A XOR B  = A'B + AB'          (1 when inputs are DIFFERENT)
   A XNOR B = A'B' + AB = (A XOR B)'   (1 when inputs are SAME)

Useful XOR properties (memorise these — they shorten many problems):

   A ⊕ 0 = A                    A ⊕ 1 = A'
   A ⊕ A = 0                    A ⊕ A' = 1
   A ⊕ B = B ⊕ A                (commutative)
   (A ⊕ B) ⊕ C = A ⊕ (B ⊕ C)    (associative)
   If A ⊕ B = C  then  A ⊕ C = B  and  B ⊕ C = A   (self-inverse)

Multi-input XOR outputs 1 when the number of 1s is odd — this is exactly a parity generator.

   3-input XOR:  A⊕B⊕C
   000 -> 0   001 -> 1   010 -> 1   011 -> 0
   100 -> 1   101 -> 0   110 -> 0   111 -> 1     (odd number of 1s -> 1)

3. Positive vs Negative Logic

ConventionHIGH voltage meansLOW voltage means
Positive logiclogic 1logic 0
Negative logiclogic 0logic 1
A gate that is an AND in positive logic behaves as an OR in negative logic. The physical circuit never changes — only our naming convention does. This is De Morgan expressed in hardware.

4. Universal Gates — NAND and NOR

A gate is universal if every Boolean function can be realised using only that gate. NAND and NOR are both universal.

All basic gates from NAND

   NOT A   =  NAND(A, A)                       1 gate
   A AND B =  NAND( NAND(A,B), NAND(A,B) )      2 gates  (NAND then invert)
   A OR  B =  NAND( NAND(A,A), NAND(B,B) )      3 gates  (invert inputs, then NAND)
   A NOR B =  NOT( A OR B )                     4 gates
   A XOR B =  NAND( NAND(A, NAND(A,B)),
                    NAND(NAND(A,B), B) )        4 gates

   Count: NOT = 1, AND = 2, OR = 3, XOR = 4, NOR = 4 NAND gates

All basic gates from NOR

   NOT:  1 NOR gate      OR: 2 NOR gates      AND: 3 NOR gates
   XNOR: 4 NOR gates     NAND: 4 NOR gates

XOR built from 4 NAND gates

   Let  X = (AB)'
   Then Y = (A.X)'  = (A(AB)')'
        Z = (X.B)'  = ((AB)'B)'
        F = (Y.Z)'  = A ⊕ B

   Verify with A=1, B=0:
   X = (1.0)' = 1;  Y = (1.1)' = 0;  Z = (1.0)' = 1;  F = (0.1)' = 1  ✓

5. Gate Count Comparison

FunctionUsing AND/OR/NOTUsing NAND onlyUsing NOR only
NOT111
AND123
OR132
NAND214
NOR241
XOR5 (3 gates min)45

6. Real ICs (the 74-series you use in the lab)

ICContents
7400Quad 2-input NAND
7402Quad 2-input NOR
7404Hex inverter
7408Quad 2-input AND
7432Quad 2-input OR
7486Quad 2-input XOR
74834-bit binary full adder

7. Gate Parameters You May Be Asked to Define

ParameterMeaning
Propagation delayTime from an input change to the corresponding output change (t_pLH, t_pHL)
Fan-inNumber of inputs a gate can accept
Fan-outNumber of similar gate inputs one output can drive
Noise marginMaximum noise voltage tolerated without a false logic change
Power dissipationPower consumed by the gate, typically in mW
Figure of meritSpeed–power product = propagation delay × power dissipation (lower is better)

8. Implementing an Expression Gate by Gate

   F = A.B + C'.D

   Level 1: inverter for C
   Level 2: AND(A, B)  and  AND(C', D)
   Level 3: OR of the two AND outputs

   Gate count: 1 NOT + 2 AND + 1 OR = 4 gates, 3 levels
   Propagation delay = 3 x t(pd)

Any SOP expression is a two-level AND-OR circuit; any POS expression is a two-level OR-AND circuit. Getting to the minimum two-level form is the job of the next two lessons.