Courses / Computer Science I
Basic Digital Design

Adders, Multiplexers, and Decoders

Computer Science I 361 words Free to read

Useful Blocks

Rather than design every circuit from raw gates, engineers assemble standard building blocks — combinational modules so common they are used like Lego pieces.

The adder does binary addition. A half adder adds two bits, producing a sum (ABA \oplus B, the XOR) and a carry (ABA \cdot B, the AND). A full adder adds three bits — two operands plus a carry-in — producing a sum and a carry-out, so full adders can be chained: the carry-out of one feeds the carry-in of the next. Chaining nn full adders makes a ripple-carry adder that adds two nn-bit numbers (with the carry rippling along, which also explains why addition takes longer for wider numbers).

A multiplexer (MUX) is a data selector: it has several data inputs, some select lines, and one output, and it routes the chosen input to the output. A MUX with 2k2^k data inputs needs kk select lines. MUXes are how a circuit chooses between sources — the hardware equivalent of an if/else.

A decoder does the opposite: it takes a kk-bit input and activates exactly one of 2k2^k output lines — the one whose number matches the input. Decoders select a specific memory row or device from an address. Its inverse, an encoder, turns a one-active-line input back into a binary number.

BlockFunction
Half / full adderAdd bits, producing sum and carry
Multiplexer (MUX)Route one of several inputs to the output
DecoderActivate one of 2k2^k outputs from a kk-bit input
Common pitfall: mixing up a multiplexer and a decoder. A MUX has many inputs and one output (it selects one input to pass through); a decoder has one small input and many outputs (it activates exactly one output line). They are near-opposites — one narrows, the other fans out.

A 4-to-1 multiplexer with four data lines converging; the two select bits choose one path that lights in accent through to the single output — beside a decoder fanning one 2-bit input out to activate one of four out.

2k inputsk select lines2^k \text{ inputs} \Rightarrow k \text{ select lines}

Adders, Multiplexers, and Decoders

Practise this lesson

The explanation above is free to read. The graded practice for this lesson lives in the Tryals app.

10practice questions
2interactive scenes
Start Computer Science I free

Basic Digital Design