Skip to content
Digital circuitsCHIP Chair Logo

Basic circuits

We begin with the most fundamental arithmetic digital circuits, such as half adders, full adders and bit comparators.

Example: Half Adder

The half adder (Half Adder in English) is the basis of full adders (Full Adders in English) and of n‑bit additions.

We will design a circuit that takes two bits, A and B, and computes:

  • the Sum, and
  • the Carry.

The truth table of the function we want to implement is the following:

ABSumCarry
0000
0110
1010
1101

When A=B=1, the sum overflows, i.e. it cannot be represented with a single output bit. The result of this overflow is the carry bit (carry in English) which is a higher‑order digit.

We can use Karnaugh maps or the rules of Boolean Algebra to derive the two simplified Boolean expressions that describe the circuit's logic:

Sum=A¯B+AB¯=AXORBCarry=AB

Thus, the circuit implementing this Half Adder is the following:

Half Adder circuit

This circuit is one of the building blocks for full adders and for n‑bit adders.

Example: Full Adder

We will design a full adder that sums three input bits: the bits A and B plus an input carry bit Centrada. It represents a sum of two bits that takes into account a possible carry bit originating from a previous sum inside a chain of additions.

Its outputs are a sum bit, and an output carry bit Csortida.

The truth table of the circuit is:

ABCinSumCout
00000
01010
10010
11001
00110
01101
10101
11111

We can use Karnaugh maps or Boolean algebra rules to derive the two simplified Boolean expressions that describe the circuit's logic:

Suma=AXORBXORCentradaCsortida=AB+BCentrada+ACentrada=AB+Centrada(AXORB)

Thus, the circuit implementing a full adder is the following:

Full Adder circuit

This circuit can be interpreted as two half adders with an OR gate for the output carry:

Full Adder circuit

Example: Comparator

We will design a comparator circuit that takes two bits, A and B, and compares them.

Comparator circuits have 3 outputs: the first indicates if A is greater than B, the second is active if A equals B, and the third indicates if A is less than B.

The truth table is:

ABSortieA<BSortieA=BSortieA>B
00010
01100
10001
11010

Simplified expressions:

SortieA<B=A¯BSortieA=B=A¯B¯+AB=AXNORBSortieA>B=AB¯

Thus, the comparator circuit is the following:

Comparator circuit

Example: Multi-bit Adder

With the full adder and half adder you can build larger circuits, such as ripple-carry adders, which permit the addition of binary numbers with multiple bits.

For example, the following four‑bit adder:

4-bit adder

Exercises on Jutge.org: Introduction to Digital Circuit Design

Note that to access the exercises and for the Jutge system to evaluate your solutions you must be enrolled in the course Introduction to Digital Circuit Design. You will find all the instructions here.



CHIP Chair Logos

Xavier Casas, Francesc Madrid
Lliçons.jutge.org
© Universitat Politècnica de Catalunya, 2026

lliçons.jutge.org