Home / Learn Chip Programming / Combinational Circuits: Adders, Multiplexers and Decoders
Combinational Circuits: Adders, Multiplexers and Decoders
Circuits whose output depends only on the current inputs. These are the building blocks of every ALU.
Theory in plain words
What it is
A combinational circuit has no memory. Change the inputs and the output follows after a small delay. Examples: adder, multiplexer, decoder, comparator.
Why we use it
These circuits do the work inside a CPU. The ALU adds with adders, picks results with multiplexers and the control unit decodes instructions with decoders.
How it works
Combine gates so that every output is a function of the inputs only. The delay through the longest path (the critical path) limits how fast the chip clock can run.
Where it is used
- ALU in CPUs and microcontrollers
- Address decoding: which chip or memory is selected
- Display drivers, priority encoders, comparators
Half adder and full adder
- Half adder: Sum = A XOR B, Carry = A AND B. It cannot take a carry in.
- Full adder: Sum = A XOR B XOR Cin, Cout = (A AND B) OR (Cin AND (A XOR B)).
Watch the carry travel from bit 0 to bit 3. This waiting for the carry is the ripple delay; fast CPUs use carry-lookahead adders instead.
Multiplexer (MUX): a digital switch
A 4 to 1 multiplexer has four data inputs, two select lines and one output. The select lines (S1 S0) say which input goes to the output. A MUX is how a CPU chooses between registers or between results.
A decoder is how a microcontroller picks one peripheral or one memory block out of many using address lines.
Quick quiz
1. A full adder has how many inputs?
A, B and carry in.
2. What does a multiplexer do?
The select lines choose which input reaches the output.
Common questions
A full adder has how many inputs?
3. A, B and carry in.
What does a multiplexer do?
Chooses one of many inputs. The select lines choose which input reaches the output.