Wednesday, December 3, 2025

✅ UNIT 2 — Logic Gates, Boolean Algebra, K-Maps, Codes

🌟 2.1 LOGIC GATES

Logic gates are electronic circuits that perform logical operations on binary inputs (0 or 1).

1️⃣ Basic Gates

AND Gate

ABOutput = A • B
000
010
100
111

OR Gate

ABA + B
000
011
101
111

NOT Gate

AA'
01
10

2️⃣ Universal Gates (NAND, NOR)

Any circuit can be built using only NAND or only NOR.

NAND Gate

Output = (A • B)’
Truth Table → Only 1 when both inputs are NOT 1.

NOR Gate

Output = (A + B)’
Truth Table → Only 1 when both inputs are 0.


3️⃣ Exclusive Gates

XOR Gate

Output = 1 when inputs are different.
Equation: A ⊕ B = A’B + AB’

XNOR Gate

Output = 1 when inputs are same.


🌟 2.2 BOOLEAN ALGEBRA

Important Laws

1. Identity Laws

A + 0 = A
A • 1 = A

2. Null Laws

A + 1 = 1
A • 0 = 0

3. Idempotent Laws

A + A = A
A • A = A

4. Complement Laws

A + A’ = 1
A • A’ = 0

5. De Morgan’s Laws

(AB)’ = A’ + B’
(A + B)’ = A’B’


🌟 2.3 Minterms & Maxterms

Minterm (SOP Form)

Each minterm = product term (AND)
Example for 2 variables:
m0 = A’B’
m1 = A’B
m2 = AB’
m3 = AB

Sum of Minterms = SOP

Maxterm (POS Form)

Each maxterm = sum term (OR)
M0 = A + B
M1 = A + B’ etc.


🌟 2.4 Simplification Using Karnaugh Map (K-MAP)

Example:

Simplify F(A, B, C) = Σ(1, 3, 5, 7)

K-MAP:

Fill 1’s in cells 1,3,5,7.

Groups formed:

  • Group of four (1,3,5,7)

Final simplified function:
👉 F = B

K-map makes long Boolean expressions very small.


🌟 2.5 NUMBER CODES

1. Weighted Codes

Each digit has a weight.
Examples:

  • 8421 (BCD)

  • 2421

  • 5211

2. Non-Weighted Codes

Weights do NOT apply.
Examples:


Gray Code

Only one bit changes between consecutive numbers (used in error-free encoding).

Binary to Gray:

G1 = B1
G2 = B1 ⊕ B2
G3 = B2 ⊕ B3

Example:
Binary 101 → Gray = 111


Excess-3 Code

Add 3 to each BCD digit.

Example:
BCD 0101 (5)
Excess-3 = 0101 + 0011 = 1000


Code Conversions Covered

✔ Binary ↔ Gray
✔ Binary ↔ BCD
✔ BCD ↔ Excess-3
✔ Hex ↔ Binary
✔ Decimal ↔ Binary

No comments:

Post a Comment

✅ UNIT 4 — POSET, LATTICES & BOOLEAN ALGEBRA (DISCRETE MATHEMATICS)

  ✅ UNIT 4 — POSET, LATTICES & BOOLEAN ALGEBRA 1. Poset Partially Ordered Set A pair (A, ≤) where relation is: Reflexive Anti-...