Contents

Digital Electronics
Number Systems
Logic Gates
Boolean Algebra
Combinational Circuits
Sequential Circuits
Memory & PLDs
Digital System Design
Other Topics
Other Subjects
Section Progress63%

10 of 16 articles

K-Map 2 Variable

2-variable Karnaugh map, grouping rules, simplified expression.

Darshan N
Updated: 7 April 2026
12 min read

The 2-variable Karnaugh map is the entry point for visual logic minimization. Every address decoder in a microcontroller's memory map is designed using exactly this kind of grouping logic.

2-Variable K-Map Layout and Groupingm00m11m31m20B=0B=1B=1B=0A=0A=1AB \ order:A along rowsB along colsGroup of 2: m1+m3 → B (A cancels)2-Variable Truth TableABF=m1+m3000011100111IC: 74HC08 AND + 74HC04 NOT implement any 2-variable SOP
Figure 1: 2-variable K-map showing group of 2 that eliminates variable A, leaving F=B

Core Concept

A Karnaugh map (K-map) is a grid of cells arranged so that adjacent cells differ in exactly one variable. This adjacency is called Gray code ordering. It allows the human eye to spot groupings of 1s that correspond to simplified product terms.

For 2 variables A and B, the K-map has 4 cells arranged in one row. The column order is B=0, B=1, B=1, B=0 — or equivalently the minterms appear as m0, m1, m3, m2 from left to right. This ordering ensures m1 and m3 are adjacent (they differ only in A), and m0 and m2 are also adjacent. The map wraps around at the edges.

A group of 2 adjacent 1-cells eliminates one variable; a group of 4 (all cells) eliminates both variables. A 74HC08 quad-AND gate at 5 V with t_pd ≈ 6 ns implements any single product term that results from this simplification.

Boolean Expression

The simplified SOP is read from the K-map groups. A variable is included in a group's product term only if it is constant across all cells in that group. If A=0 in all cells of a group, write A'. If A=1 in all cells, write A. If A changes within the group, omit it.

Example
Given:
  2-variable function F with minterms at m1, m2, m3
  (F=1 when AB=01, 10, 11)

Formula / Rule:
  Draw K-map, group all adjacent 1s in powers of 2

Step by step:
  K-map (row = A, col order = 00,01,11,10):
  Cell m0(A=0,B=0)=0  Cell m1(A=0,B=1)=1
  Cell m3(A=1,B=1)=1  Cell m2(A=1,B=0)=1

  Group 1: m1 and m3 (vertical pair, B=1 constant)
           A changes (0 and 1) → omit A
           B=1 constant → keep B
           Term = B

  Group 2: m2 and m3 (vertical pair, A=1 constant)
           A=1 constant → keep A
           B changes → omit B
           Term = A

  F = B + A   (both groups cover all three 1-cells)

Final Answer:
  F = A + B
Exam Tip: In a 2-variable K-map, the cell order is m0, m1, m3, m2 — not m0, m1, m2, m3. Students who write them in binary order will make m2 and m3 non-adjacent and miss valid groupings. The wrap-around adjacency means m0 and m2 are also adjacent across the ends of the one-row map. Always verify your group size is a power of 2 (1, 2, or 4).

Key Properties

  • 2-variable K-map: 4 cells, one row, column order follows Gray code: 00, 01, 11, 10
  • Group of 1 cell → 2-literal term (no simplification); group of 2 → 1-literal term; group of 4 → constant 1
  • Each group must be a power-of-2 size: 1, 2, or 4 for a 2-variable map
  • A cell can belong to more than one group — use overlap to make groups as large as possible
  • 74HC08 quad-AND: t_pd ≈ 6 ns, Vcc 2–6 V, fan-out 10 — one IC holds four 2-input AND gates
  • Wrap-around adjacency: the leftmost column and rightmost column are logically adjacent
  • Don't-care cells (marked X) can be treated as 0 or 1 to enlarge groups — choose whichever helps

Quick Revision

  • 2-variable K-map has 4 cells in Gray code order: m0, m1, m3, m2
  • Adjacent cells differ in exactly one variable — that variable is eliminated
  • Group of 2 eliminates 1 variable; group of 4 gives the constant 1
  • Every 1-cell must be covered by at least one group
  • Use the largest possible groups — smaller groups leave literals in the expression
  • Essential prime implicants cover 1-cells that no other group covers — always include them
  • Exam trap: writing cells in binary order m0,m1,m2,m3 instead of Gray code m0,m1,m3,m2 breaks all wrap-around adjacency

K-Map 2 Variable

Verify your ability to minimize 2-variable functions using Karnaugh maps.

Question 1 of 3

Q1.For F(A,B) = sum(0, 1, 2), the minimized SOP expression using a 2-variable K-map is: