Digital logic & computing · tree view
Combinational circuits — adders, decoders, multiplexers — produce outputs that depend only on the current input combination; Karnaugh maps minimize the gate count needed to realize any truth table.
In mathematics a combination is an unordered set, which is a formal way to say that nobody cares which order the items came in. Most games work this way, if you rolled dice one at a time and get a 2 followed by a 3 it is the same as if you had rolled a 3 followed by a 2. With combinational logic, the circuit produces the same output regardless of the order the inputs are changed.
Practical circuits will have a mix of combinational and sequential logic, with sequential logic making sure everything happens in order and combinational logic performing functions like arithmetic, logic, or conversion.
Simplifying boolean equations or making some Karnaugh map will produce the same circuit shown below, but start by looking at the results. The Σ column is our familiar XOR gate, while the Cout column is the AND gate. This device is called a half-adder for reasons that will make sense in the next section.
A decoder is a circuit that changes a code into a set of signals. It is called a decoder because it does the reverse of encoding, but we will begin our study of encoders and decoders with decoders because they are simpler to design.
A common type of decoder is the line decoder which takes an n-digit binary number and decodes it into 2n data lines.
A demultiplexer, sometimes abbreviated dmux, is a circuit that has one input and more than one output. It is used when a circuit wishes to send a signal to one of many devices. This description sounds similar to the description given for a decoder, but a decoder is used to select among many devices while a demultiplexer is used to send a signal among many devices.
A multiplexer, abbreviated mux, is a device that has multiple inputs and one output.
For any large combinational circuit there are generally two approaches to design: you can take simpler circuits and replicate them; or you can design the complex circuit as a complete device.
Maurice Karnaugh, a telecommunications engineer, developed the Karnaugh map at Bell Labs in 1953 while designing digital logic based telephone switching circuits.
Karnaugh maps reduce logic functions more quickly and easily compared to Boolean algebra. By reduce we mean simplify, reducing the number of gates and inputs. We like to simplify logic to a lowest cost form to save costs by elimination of components. We define lowest cost as being the lowest number of gates with the lowest number of inputs per gate.
Note the sequence of numbers across the top of the map. It is not in binary sequence which would be 00, 01, 10, 11. It is 00, 01, 11 10, which is Gray code sequence. Gray code sequence only changes one binary bit as we go from one number to the next in the sequence, unlike binary. That means that adjacent cells will only vary by one bit, or Boolean variable.
On a cautionary note, do not attempt to form groups of three. Groupings must be powers of 2, that is, 1, 2, 4, 8 ...
As you might suspect, a Sum-Of-Products Boolean expression is literally a set of Boolean terms added (summed) together, each term being a multiplicative (product) combination of Boolean variables.
Look at the Karnaugh map as being a rearranged truth table. The Output of the Boolean equation may be computed by the laws of Boolean algebra and transfered to the truth table or Karnaugh map.
Informally, there is a lot of confusion. Both demultiplexers and multiplexers have similar names, abbreviations, schematic symbols and circuits, so confusion is easy. The term multiplexer, and the abbreviation mux, are often used to also mean a demultiplexer, or a multiplexer and a demultiplexer working together.
QUARTER ADDER circuits produce the sum of two numbers but do not generate a carry. HALF ADDER circuits produce the sum of two numbers and generate a carry. FULL ADDER circuits add a carry to obtain the correct sum.
Add two bits: 0+0=0, 0+1=1, 1+0=1, and 1+1=10₂ — one column of sum plus a carry. The sum bit Σ equals A XOR B; the carry-out equals A AND B. Two gates are the whole adder.
To predict the outcome:
| a | b | sum_sigma | carry_out | binary_sum |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 00 |
| 0 | 1 | 1 | 0 | 01 |
| 1 | 0 | 1 | 0 | 01 |
| 1 | 1 | 0 | 1 | 10 |
Chain the carry: a full adder sums bit A, bit B and the carry from the column to the right (Cin). Σ = A ⊕ B ⊕ Cin, and Cout = AB + Cin·(A ⊕ B). Stack one full adder per bit and any word width adds.
To predict the outcome:
| a | b | cin | sum_sigma | cout |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 1 | 0 |
| 0 | 1 | 0 | 1 | 0 |
| 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 | 0 |
| 1 | 0 | 1 | 0 | 1 |
| 1 | 1 | 0 | 0 | 1 |
| 1 | 1 | 1 | 1 | 1 |
A mux is a data switch: Y follows A when S=0 and B when S=1 (Y = A·S′ + B·S). With two data inputs and one select there are 2³ = 8 full input combinations.
To predict the outcome:
| a | b | s | y | selected |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | A |
| 0 | 0 | 1 | 0 | B |
| 0 | 1 | 0 | 0 | A |
| 0 | 1 | 1 | 1 | B |
| 1 | 0 | 0 | 1 | A |
| 1 | 0 | 1 | 0 | B |
| 1 | 1 | 0 | 1 | A |
| 1 | 1 | 1 | 1 | B |
Four data inputs (D3…D0), two select bits (S1 S0): select value n (0–3) routes Dn through to Y. To see the routing clearly, the data pattern is fixed at D3D2D1D0 = 0101 in every row; only the select changes, and Y must follow the addressed line.
To predict the outcome:
| d3 | d2 | d1 | d0 | s1 | s0 | y | selected_line |
|---|---|---|---|---|---|---|---|
| 0 | 1 | 0 | 1 | 0 | 0 | 1 | D0 |
| 0 | 1 | 0 | 1 | 0 | 1 | 0 | D1 |
| 0 | 1 | 0 | 1 | 1 | 0 | 1 | D2 |
| 0 | 1 | 0 | 1 | 1 | 1 | 0 | D3 |
A 2-to-4 decoder turns a 2-bit address A1A0 into four data lines where exactly the addressed line goes high (one-hot): D0 = A1′·A0′, D1 = A1′·A0, D2 = A1·A0′, D3 = A1·A0. Four gates, four unique codes.
To predict the outcome:
| a1 | a0 | d3 | d2 | d1 | d0 |
|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | 1 |
| 0 | 1 | 0 | 0 | 1 | 0 |
| 1 | 0 | 0 | 1 | 0 | 0 |
| 1 | 1 | 1 | 0 | 0 | 0 |
Plot each minterm as a 1 on a 3-variable K-map (A rows, BC columns in Gray code 00,01,11,10). Two groups cover all the 1s: a quad of the four cells with C=1 (minterms 1,3,5,7 — C is the only variable they share), and a pair on the AB=11 column (minterms 6,7 — they share A and B). Reading each group as one product term gives F = C + AB.
To predict the outcome:
| minterm | a | b | c | f | covered_by |
|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | — |
| 1 | 0 | 0 | 1 | 1 | quad → C |
| 2 | 0 | 1 | 0 | 0 | — |
| 3 | 0 | 1 | 1 | 1 | quad → C |
| 4 | 1 | 0 | 0 | 0 | — |
| 5 | 1 | 0 | 1 | 1 | quad → C |
| 6 | 1 | 1 | 0 | 1 | pair → AB |
| 7 | 1 | 1 | 1 | 1 | quad → C and pair → AB |