K-Map in Circuit Design & Logic Simplification

K-Map in Circuit Design

Learn how K-Maps (Karnaugh Maps) are used in circuit design to simplify complex Boolean expressions into minimal logic gate implementations.

Logic Gates Summary

1. Basic Gates

These gates are the fundamental building blocks of digital circuits:

  • AND: Y = A * B (or Y = AB)
  • OR: Y = A + B.
  • NOT: Y = A’

2. Universal Gates

These gates can be used to construct any of the other logic gates:

  • NAND: Y = (A * B)’
  • NOR: Y = (A + B)’

3. Arithmetic Gates

These gates are often used in arithmetic and comparison circuits:

  • XOR (Exclusive-OR): Y = A B’ + A’ B (or A⊕B)
  • X-NOR (Exclusive-NOR) Y = A B + A’ B’ (or A⊙B)
Logic Gates Summary

For More. Digital Logic Design (DLD) Foundation of Computing & AI

Sum of Products (SOP)

What Is SOP?

Sum of Products (SOP) is a standard way of expressing a Boolean function.
It means you write the logic expression as a sum (OR) of several product (AND) terms.

Each product term represents a condition where the output is 1 in the truth table.

So in simple words:

SOP = OR-ing of multiple AND terms.

F = AB’C+ABC’+ABC

Each term AB’C is called a minterm a combination of variables that make the output equal to 1.

How to Derive SOP from a Truth Table

Step 1: Write the truth table

Example for a function of three variables (A, B, C):

ABCOutput (F)
0000
0011
0100
0111
1001
1010
1101
1111

For More. Boolean Algebra and Logic Gates in Digital Logic Design 2025

Step 2: Identify rows where F = 1

→ Rows: 2, 4, 5, 7, 8 (in decimal form).

Step 3: Write corresponding minterms

For each row where output = 1, write an AND term:

  • Row 2: A′B′C
  • Row 4: A′BC
  • Row 5: AB′C′
  • Row 7: ABC’
  • Row 8: ABC

Step 4: OR all minterms together

F= A′B′C + A′BC + AB′C′ + ABC’ + ABC

This is the canonical SOP expression.

Definition of Canonical Form

In Boolean algebra, a canonical form (also called standard form) is a way of writing a Boolean expression where each term includes all the variables in the system, either in complemented (0) or uncomplemented (1) form.

Canonical form = every term has all input variables once.

Karnaugh Map (K-Map) From Truth Table to Simplified Logic

Why is K-Map Required?

When we write a Boolean function directly from a truth table, we usually get a long Sum of Products (SOP) expression.

Simplifying this manually using Boolean algebra can be:

  • Time-consuming
  • Prone to human error
  • Hard to visualize for many variables

K-Map (Karnaugh Map) solves this problem by providing a visual method to simplify Boolean expressions quickly and accurately.

It lets you group together adjacent 1’s in the truth table to eliminate unnecessary variables and get the minimum SOP or POS form.

Explaining Gray Code

Gray Code (Reflected Binary Code) is the special ordering used for labeling the rows and columns of a K-map.

  • Definition: Gray code is a sequence of binary numbers where only one bit changes between any two successive values.
  • Purpose in K-Maps: This rule is crucial because the core principle of K-map grouping is combining adjacent terms that differ by only one variable. By using Gray code to label the map, any physically adjacent cells (including wrap-around cells) are logically adjacent (differ by one bit), which ensures valid simplification groups.
DecimalStandard BinaryGray Code
00000
10101
21011
31110
Notice the change between 01 and 11 is only the first bit, and between 11 and 10 is only the last bit.

K-Map Structures by Variable Count

The K-map must have $2^n$ cells, where $n$ is the number of variables.

2-Variable K-Map

This map is structured as 2 X 2. Gray code is applied to both A and B.

A\B01
0F(0,0)F(0,1)
1F(1,0)F(1,1)

Example

ABF
000
011
101
111

Plot K-Map:

A\B01
001
111

Grouping: combine adjacent 1’s
Minimal SOP: F=A+B

3-Variable K-Map (A, B, C)

A∖BC00 (B′C′)01 (B′C)11 (BC)10 (BC′)
0 (A′)m₀m₁m₃m₂
1 (A)m₄m₅m₇m₆

Notice the column order: 00, 01, 11, 10 (Gray code: m3 and m2 are swapped from standard binary order).

How to Read This Table

Each cell corresponds to a minterm (m)Example Function

Let’s take: F(A,B,C)=∑m(1,2,3,5,7)

That means the function equals 1 for minterms m₁, m₂, m₃, m₅, m₇. a unique combination of A, B, and C values that produce one product term in Boolean logic.

For example:

  • m₀ = A′B′C′ → A=0, B=0, C=0
  • m₁ = A′B′C → A=0, B=0, C=1
  • m₂ = A′BC′ → A=0, B=1, C=0
  • m₃ = A′BC → A=0, B=1, C=1
  • m₄ = AB′C′ → A=1, B=0, C=0
  • m₅ = AB′C → A=1, B=0, C=1
  • m₆ = ABC′ → A=1, B=1, C=0
  • m₇ = ABC → A=1, B=1, C=1

Example Function

Let’s take: F(A,B,C)=∑m(1,2,3,5,7)

That means the function equals 1 for minterms m₁, m₂, m₃, m₅, m₇.

Plot in K-Map

A∖BC00011110
0 (A′)0111
1 (A)0110

let’s simplify

F= A′B′C + A′BC + AB′C + ABC + A′BC′

Boolean-algebra simplification

Group the four terms that share C:

F​=(A′B′C+A′BC+AB′C+ABC)+A′BC′

=[(A′B′+A′B+AB′+AB)]C+A′BC′

=[A′(B′+B)+A(B′+B)]C+A′BC′

=(A′+A)C+A′BC′

=C+A′BC′.​

Grouping:

  • A 4-cell group covering m1,m3,m5,m7 (the entire C=1) → term C.
  • A 2-cell group covering m2​ with adjacent m3​ → term A′B.

Result: F=C+A′B

4-Variable K-Map (A, B, C, D)

AB\CD00011110
00m0m1m3m2
01m4m5m7m6
11m12m13m15m14
10m8m9m11m10

Example:

F(A,B,C,D)=∑m(0,2,5,7,8,9,10,14)

Plotting the K-Map

K-Map groupings (maximize size, allow wrapping)

  1. Quad: {m0,m2,m8,m10} (rows AB=00 & 10, cols CD=00 & 10)
    • Common: B’ and D’ → term: B’ D’
  2. Pair (row 01, horizontal): {m5,m7}(CD = 01 & 11)
    • Common: A’, B, D→ term: A’ B D
  3. Pair (row 10, horizontal): {m8,m9}(CD = 00 & 01)
    • Common: A, B’, C’ → term: A B’ C’
  4. Pair (column 10, vertical): {m10,m14}(AB = 10 & 11)
    • Common: A, C, D’→ term: A C D’

All 1’s are covered; no uncovered minterms remain.

  1. Quad (Corners) – Green: m0​,m2​,m8​,m10​ is still a valid Quad. BD
  2. Pair – Red: m5​,m7​ is still a valid Pair. ABD
  3. Pair – Blue: m8​,m9​ is still a valid Pair. ABC (Covers m9​, m8​ is redundant)
  4. Pair – Orange: m10​,m14​ (Vertical Wrap) is still a valid Pair. ACD (Covers m14​, m10​ is redundant)

Minimal SOP Expression

The following prime implicants form the minimal cover for all the minterms:

  1. Four Corners: Covers m0​,m2​,m8​,m10​.
    • Term: BD
  2. Pair: Covers m5​,m7​.
    • Term: ABD
  3. Pair: Covers m8​,m9​. (Needed to uniquely cover m9​)
    • Term: ABC
  4. Pair (Vertical Wrap): Covers m10​,m14​. (Needed to uniquely cover m14​)
    • Term: ACD

The minimal Sum of Products (SOP) expression is the logical OR of these terms:

F(A,B,C,D)=BD+ABD+ABC+ACD

Leave a Reply

Your email address will not be published. Required fields are marked *