Building Blocks: Adders
Instead of raw gates, engineers use standard building blocks: reliable combinational modules acting like Lego pieces.
The half adder adds two bits to output a sum () and a carry (). A full adder adds three bits including a carry-in, outputting a sum and carry-out.
Chaining full adders builds a ripple-carry adder for -bit numbers. Wider numbers take longer because the carry must ripple through every stage.
MUX vs. Decoder
A multiplexer (MUX) is a data selector routing one of inputs to a single output using select lines (). It acts as hardware if/else.
A decoder does the opposite: a -bit input activates exactly one of outputs. Its inverse is an encoder.
| Block | Structure | Function |
|---|---|---|
| MUX | Many inputs, 1 output | Routes chosen data |
| Decoder | inputs, outputs | Activates one line |
Common pitfall: MUXes narrow many inputs to one; decoders fan a small input out to many outputs.