Contents

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

12 of 16 articles

K-Map 4 Variable

4-variable K-map, wrapping, corner groups.

Mohith N
Updated: 7 April 2026
8 min read

Four-variable K-maps solve the logic in 4-bit comparators, BCD decoders, and address logic for 16-location memory banks. The 16-cell grid is the largest map engineers use by hand before switching to Quine-McCluskey or EDA tools.

4-Variable K-Map — Cell Numbering (AB vs CD, Gray order)AB \ CDCD=00CD=01CD=11CD=10AB=00AB=01AB=11AB=10m0m1m3m2m4m5m7m6m12m13m15m14m8m9m11m10Group: m3,m7,m15,m11CD=11 col → CD termGroup: m0,m1,m4,m5AB=00,01 & CD=00,01 → A'D'Wrap-arounds in 4-var map:Horizontal: col CD=00 wraps to col CD=10 | Vertical: row AB=00 wraps to row AB=10Corner group: m0,m2,m8,m10 (all four corners form a valid group of 4)IC: 74HC20 dual 4-input NAND implements any group-of-16 term in one gate
Figure 1: 4-variable K-map cell layout with example groups and wrap-around adjacency rules

Core Concept

A 4-variable K-map has 16 cells in a 4×4 grid. Rows are AB in Gray order (00, 01, 11, 10) and columns are CD in Gray order (00, 01, 11, 10). This gives an essential property: every cell is adjacent to exactly 4 other cells — left, right, top, bottom — including wrap-around at all four edges.

Group sizes are powers of 2: 1, 2, 4, 8, or 16 cells. A group of 16 means F=1 always. A group of 8 eliminates 3 variables, leaving 1 literal. A group of 4 eliminates 2 variables. Corner groups (4 corners of the map) are a common source of exam errors — they form a valid group of 4.

The 74HC20 dual 4-input NAND operates at 2–6 V with t_pd ≈ 8 ns and fan-out of 10. It can implement any single product term in one gate when that term has up to 4 literals after K-map simplification.

Boolean Expression

The minimal SOP is obtained by selecting the fewest, largest prime implicant groups that cover every 1-cell. Write each group's product term by identifying which of A, B, C, D remain constant across the group. OR the terms together. Don't-care cells (marked X or d) may be included in any group to enlarge it.

Example
Given:
  F(A,B,C,D) = Σm(0,1,2,5,8,9,10,13) + d(4,12)
  (don't-cares at m4, m12)

Formula / Rule:
  Map all minterms and don't-cares; form largest possible groups

Step by step:
  Draw the 4×4 K-map with minterms and X for don't-cares.
  (Using notation [row AB][col CD])

  Group 1: m0,m1,m8,m9 + wrap-around with m2,m10 ... 
  Let's identify groups clearly:

  Group 1: m0,m1,m2,m8,m9,m10 — wrap-around block AB=00,10 × CD=00,01,10
    Hmm, that's not a rectangle. Let's form correct power-of-2 groups:

  Group A: m0,m1,m8,m9 (rows AB=00,10; cols CD=00,01) — group of 4
    A: 0,0,1,1 → changes → omit
    B: 0,0,0,0 → all 0 → B'
    C: 0,0,0,0 → all 0 → C'
    D: 0,1,0,1 → changes → omit
    Term = B'C'

  Group B: m0,m2,m8,m10 (rows AB=00,10; cols CD=00,10) — group of 4 (wrap-around cols)
    A: 0,0,1,1 → omit
    B: 0,0,0,0 → B'
    C: 0,1,0,1 → omit
    D: 0,0,0,0 → D'
    Term = B'D'

  Group C: m1,m5,m9,m13 (col CD=01 entire column) — group of 4
    A: 0,0,1,1 → omit; B: 0,1,0,1 → omit; C: 0,0,0,0 → C'; D: 1,1,1,1 → D
    Term = C'D

  Check coverage: m0✓(A,B), m1✓(A,C), m2✓(B), m5✓(C), m8✓(A,B), m9✓(A,C),
                  m10✓(B), m13✓(C) — all covered.

Final Answer:
  F = B'C' + B'D' + C'D
Exam Tip: The four corner cells m0, m2, m8, m10 form a valid group of 4. This is the most missed wrap-around in 4-variable K-maps. Also, don't-cares must appear in your group if they make the group larger, but they must never be the only 1-cell in a group — groups must contain at least one actual minterm. Finally, choosing non-prime implicants (groups that could be enlarged) wastes literals.

Key Properties

  • 4-variable map: 16 cells, 4×4 grid, both rows and columns in Gray code order
  • Four wrap-around edges: top-bottom and left-right — all four edges participate
  • Corner group m0,m2,m8,m10 is valid — reduces to B'D'
  • Group of 16 → F=1; group of 8 → 1 literal; group of 4 → 2 literals; group of 2 → 3 literals
  • 74HC20 dual 4-input NAND: Vcc 2–6 V, t_pd ≈ 8 ns, fan-out 10
  • Don't-cares can be 0 or 1 — use them only when they increase group size
  • Minimal SOP may not be unique; any cover using only prime implicants with minimum terms is acceptable

Quick Revision

  • 4-variable K-map: 16 cells, rows AB and cols CD both in Gray code 00,01,11,10
  • Each cell has 4 neighbours including wrap-around neighbours
  • Group must be a power of 2 and must form a rectangle (with wrap-around)
  • Eliminate a variable if it changes across the group; keep it if constant
  • Essential prime implicants first, then smallest additional set to cover remaining 1-cells
  • Don't-cares help enlarge groups; never use them as the sole justification for a group
  • Exam trap: missing the four-corner group m0,m2,m8,m10 — treat the map as a torus that wraps on all sides

K-Map 4 Variable

Test your grouping skills on 4-variable K-maps including wrapping and corner groups.

Question 1 of 3

Q1.In a 4-variable K-map (A,B,C,D), which four corner minterms form a valid group?