UNIHIVE

Study Hub UNIPORT CSC 382

CSC 382 · Computer Architecture 1

Logic gates and Boolean algebra

The basic gates, truth tables, Boolean laws, De Morgan's theorem and simplifying expressions with Karnaugh maps.

Our notes

2 min read

Gates

GateExpressionOutput is 1 when
NOTA'A is 0
ANDA·Bboth are 1
ORA + Bat least one is 1
NAND(A·B)'not both are 1
NOR(A + B)'both are 0
XORA ⊕ Bthe inputs differ
XNOR(A ⊕ B)'the inputs are equal

NAND and NOR are universal: any circuit can be built from either alone.

Boolean laws

  • Identity: A + 0 = A; A·1 = A.
  • Null: A + 1 = 1; A·0 = 0.
  • Idempotent: A + A = A; A·A = A.
  • Complement: A + A' = 1; A·A' = 0.
  • Absorption: A + A·B = A; A·(A + B) = A.
  • Distributive: A·(B + C) = A·B + A·C; A + B·C = (A + B)·(A + C).
  • De Morgan: (A·B)' = A' + B'; (A + B)' = A'·B'.

Worked example: simplification

F = A·B + A·B' + A'·B
= A·(B + B') + A'·B = A + A'·B = (A + A')·(A + B) = A + B.
Check with the truth table: F is 0 only when A = B = 0, exactly like OR ✓.

Sum of products and minterms

Write F as an OR of AND terms, one for each row where F = 1. For three inputs with F = 1 in rows 1, 3, 5, 7 (counting from 0): F = Σm(1, 3, 5, 7).

Karnaugh maps

A K-map arranges the truth table so neighbouring cells differ in one variable (Gray code order 00, 01, 11, 10). Group 1s in rectangles of 1, 2, 4 or 8; each group gives one simplified term.
Example: F(A, B, C) = Σm(1, 3, 5, 7): the four 1s are exactly the cells with C = 1, so F = C.
Example: F(A, B, C) = Σm(0, 2, 4, 6): all cells with C = 0, so F = C'.
Example: F(A, B, C) = Σm(3, 5, 6, 7): groups give F = A·B + A·C + B·C (the majority function).

Don't-care conditions

Inputs that never occur (BCD codes 1010 to 1111) can be treated as 0 or 1, whichever gives bigger groups.

Exams usually ask

  • Draw truth tables and give gate symbols and expressions.
  • Simplify expressions with Boolean laws and De Morgan.
  • Minimise functions of three or four variables with a K-map.

Common mistake

Applying De Morgan without changing the operator: (A·B)' is A' + B', not A'·B'.

Written by the UniHive team in our own words. Spotted a mistake? Tell us on WhatsApp.

No reading links here yet

Our team adds free books, videos and practice for each topic, and opens every link before it goes up.

All CSC 382 topics

Report

Sign in to report this. It is free.

Is this your work (a lecturer, author or publisher)? Ask us to take it down.