5 Variable K-Map in Digital Logic

Last Updated : 20 Jul, 2026

A 5-variable Karnaugh Map (K-Map) is an extension of the 4-variable K-Map used to simplify complex Boolean expressions. It consists of two 4-variable K-Maps placed side by side, allowing functions with five variables to be minimised using grouping techniques.

  • Simplifies 5-variable Boolean expressions.
  • Reduces the number of logic gates.
  • Produces simpler and more efficient digital circuits.
kmap_5

The following example shows how the cell number of a 5-variable K-Map is determined.

kmap_2

For the highlighted cell, P = 0, Q = 0, R = 1, S = 1, and T = 1, giving the binary value (00111). This corresponds to decimal value 7, so the cell number is 7. Similarly, the remaining cells are numbered based on their binary values.

Filling the K-Map

  1. For SOP (Sum of Products), place '1' in the cells corresponding to the given minterms. Example: ∑m(0,1,5,7,30,31) → Place 1 in cells 0, 1, 5, 7, 30, and 31.
  2. For POS (Product of Sums), place '0' in the cells corresponding to the given maxterms. Example: ∏M(0,1,5,7,30,31) → Place 0 in cells 0, 1, 5, 7, 30, and 31.

Steps to Simplify a 5-variable K-Map

  1. Group adjacent 1's for SOP or 0's for POS.
  2. Form groups only in powers of 2 (1, 2, 4, 8, or 16 cells).
  3. Make the largest possible groups while covering all marked cells.
  4. Ensure every Essential Prime Implicant (EPI) is included.
  5. Write the simplified Boolean expression from the obtained groups.

I. Solving SOP using a 5-variable K-Map

Consider the following Boolean function in SOP form:

Σm(0, 2, 4, 7, 8, 10, 12, 16, 18, 20, 23, 24, 25, 26, 27, 28)

kmap_

The K-Map contains four groups:

  • Group 1 (Red): Cells 0, 4, 8, 12, 16, 20, 24, 28
  • Group 2 (Blue): Cells 7, 23
  • Group 3 (Green): Cells 0, 2, 8, 10, 16, 18, 24, 26
  • Group 4 (Yellow): Cells 24, 25, 26, 27

For each group, identify the variables that remain constant across all grouped cells. These common variables form the simplified product term.

  • Group 1: S'T'
  • Group 2: Q'RST
  • Group 3: R'T'
  • Group 4: PQR'

Combining all the product terms, we obtain the simplified Boolean expression:

II. Solving POS using a 5-variable K-Map

Consider the following Boolean function in POS form:

kmap_5

The K-Map contains four groups:

  • Group 1: The one marked in red comprises cells ( 0, 4, 8, 12, 16, 20, 24, 28)
  • Group 2: The one marked in blue comprises cells (7, 23)
  • Group 3: The one marked in pink comprises cells ( 0, 2, 8, 10, 16, 18, 24, 26)
  • Group 4: The one marked in yellow comprises cells (24, 25, 26, 27)

For each group, identify the variables that remain constant across all grouped cells. Complement these variables to obtain the corresponding sum term.

  • Group 1: S + T
  • Group 2: Q + R' + S' + T'
  • Group 3: R + T
  • Group 4: P' + Q' + R

Combining all the sum terms, we obtain the simplified Boolean expression: f(P Q R S T) = (S + T)(Q + \bar R + \bar S + \bar T)( R + T)(\bar P + \bar Q + R)  

Comment

Explore