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.

In shortA half adder uses XOR and AND. A full adder adds a carry. Chain them to add any number of bits. Multiplexers choose, decoders select.

Theory in plain words

A 4 bit ripple carry adderA0 + B0Full adder 0carryFull adder 1carryFull adder 2 ... 3Sum + final carry
A 4 bit ripple carry adder

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

4 bit ripple carry adder built from gatesTry it Yourself

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.

4 to 1 multiplexer and 2 to 4 decoderTry it Yourself

A decoder is how a microcontroller picks one peripheral or one memory block out of many using address lines.

Careful:Real circuits have delay. If two paths with different delays meet, the output can flicker briefly (a glitch or hazard). This is why designs are synchronised with a clock, which is the next lesson.

Quick quiz

1. A full adder has how many inputs?

2. What does a multiplexer do?

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.