Home › Practice › Digital Fundamentals › K-map: the hallway lamp

K-map: the hallway lamp

EasyK-mapcombinationallogic

A hallway lamp is wired to two sensors. A is 1 when the sun is up. B is 1 when someone is home. The lamp output F is off in exactly one situation: the sun is up and nobody is home. In every other situation it is on.

Concept first. A Karnaugh map (K-map) is a truth table folded into a grid, so that you can see the simplest equation instead of working it out with algebra. Each cell is one row of the truth table: its row and column headers tell you the input values, and the cell holds the output. The headers are in a special order (00, 01, 11, 10 on a bigger map, called Gray order) so that two cells side by side differ in exactly one input. That is the whole trick. If two neighbouring cells are both 1, the input that changed does not matter for them, so it can disappear from the equation. A group is a rectangle of 1s whose size is 1, 2, 4 or 8. The bigger the group, the more inputs drop out, and the shorter its product term. The aim is to cover every 1 with as few and as large groups as possible, and never to touch a 0. Groups may overlap.

What to do.

Solve in your browser →

No install and no sign-up needed. You write your answer in the editor and Nishkam checks it.

More in this track

← ALU flags: N, Z, C, VK-map: read a map that wraps →