Nepedia
Back to Discover
Advanced Reader
🔢

Karnaugh map

math Maturity 11-13 Next article →

A Karnaugh map, often called a K-map, is a visual tool used to simplify Boolean algebra expressions.

Karnaugh
Karnaugh

In digital engineering and logical circuit design, engineers must create rules for how machines make decisions. These rules are often written as complex mathematical statements. A Karnaugh map allows a person to use their natural pattern-recognition skills to simplify these rules. By turning a list of data into a visual grid, the map reduces the need for long, difficult calculations. This process helps designers implement logic using the smallest number of logic gates possible.

To build a Karnaugh map, you begin with a truth table. A truth table is a list that shows every possible combination of inputs and the resulting output.

K-map minterms A
K-map minterms A

These results are transferred onto a two-dimensional grid of cells. Each cell is known as a minterm, and its value represents the output for a specific input combination. The grid is not organized like a standard number list. Instead, the rows and columns are ordered using Gray code. Gray code is a system where only one variable changes between any two adjacent cells. This specific ordering is vital because it allows patterns to emerge visually.

Once the grid is filled, the next step is grouping. The goal is to find the simplest possible form of the original information, known as a canonical form.

K-map 6,8,9,10,11,12,13,14
K-map 6,8,9,10,11,12,13,14

To do this, you look for groups of 1s or groups of 0s. These groups must be shaped as rectangles or squares. There is a strict rule for the size of these groups: the area must be a power of two. This means a group can contain 1, 2, 4, 8, or 16 cells. To get the most efficient result, you should make these rectangles as large as possible. Groups are allowed to overlap if it helps make a group larger.

The history of these diagrams shows a long evolution of logical thinking. In 1881, Allan Marquand created a logical diagram. In 1952, Edward W. Veitch rediscovered these ideas and created the Veitch chart. Finally, in 1953, Maurice Karnaugh introduced his refined technique. Because of these contributors, the maps are sometimes called Marquand–Veitch diagrams or Karnaugh–Veitch maps. They represent an early advance in formal logic methodology. These tools remain essential in our modern digital age for designing reliable computer hardware.

One of the most unique features of a Karnaugh map is its connectivity. You can visualize the grid as a torus, which is a shape like a donut.

karnaugh map torus
karnaugh map torus
Torus from rectangle
Torus from rectangle

Because of this toroidal connection, the edges of the map are actually adjacent to one another. The cells on the far right edge touch the cells on the far left edge. Similarly, the cells at the very top wrap around to meet the cells at the bottom. This means a rectangular group can wrap across the edges of the map. This property allows for even larger groups, which leads to even simpler mathematical expressions.

Designers also use Karnaugh maps to handle "don't care" conditions. A "don't care" occurs when a specific combination of inputs has an output that does not matter to the designer.

K-map 6,8,9,10,11,12,13,14 don't care
K-map 6,8,9,10,11,12,13,14 don't care

On a map, these are usually marked with a dash or an X. You can treat a "don't care" cell as either a 1 or a 0. This flexibility allows you to expand your rectangular groups. Larger groups result in fewer terms in your final equation. This can simplify the circuit even further and even remove unnecessary parts of the logic.

Finally, Karnaugh maps are critical for identifying and fixing race hazards. A race hazard is a momentary glitch where an output might flicker incorrectly during a transition.

K-map 6,8,9,10,11,12,13,14 anti-race
K-map 6,8,9,10,11,12,13,14 anti-race

These hazards are easy to spot on a map when there are gaps between adjacent, disjoint regions. If a transition between two states is not covered by a specific term, a glitch may occur. To fix this, engineers add "consensus terms." These are extra, redundant terms that bridge the gaps between groups. While these terms might seem unnecessary in pure math, they are vital for ensuring stable, race-free performance in real-world digital systems.

685 words

Where will your curiosity go next?

Keep exploring at your chosen reading level.

🖼️ Images & Media (7)
File:Karnaugh.svg
Karnaugh.svg
File:karnaugh_map_torus.svg
karnaugh_map_torus.svg
File:K-map minterms A.svg
K-map minterms A.svg
File:Torus from rectangle.gif
Torus from rectangle.gif
File:K-map 6,8,9,10,11,12,13,14.svg
K-map 6,8,9,10,11,12,13,14.svg
File:K-map 6,8,9,10,11,12,13,14 don't care.svg
K-map 6,8,9,10,11,12,13,14 don't care.svg
File:K-map 6,8,9,10,11,12,13,14 anti-race.svg
K-map 6,8,9,10,11,12,13,14 anti-race.svg
More to explore

What is Nepedia?

A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.