Skip to content
Digital circuitsCHIP Chair Logo

n-bit arithmetic

n-bit arithmetic refers to digital circuits that operate on an arbitrary number of bits. The variable n may be a large value, such as n=16 in the course exercises. Adders, subtractors, comparators, incrementers, etc., can be implemented. Here we will look at two examples: an adder and an incrementer.

Example: A 16-bit adder

To build an n-bit adder, you need to concatenate n1 full adders and a half adder.

Thus, to add two binary numbers A and B of 16 bits, we will concatenate 15 full adders and a half adder:

n-bit adder

The inputs are A and B. The outputs are:

  • the sum output S (16 bits), and
  • the carry-out bit Cout.

To simplify the circuit we can use full adders at all stages, with Cin=0 at the first adder. As with the 4-bit adders, a full adder can perform the function of a half adder if Cin=0.

n-bit adder implemented only with full adders

The final circuit will have the same structure as the 4-bit adders, but with 16 blocks concatenated instead of 4.

Example: n-bit incrementer

We will design a 5-bit incrementer. This circuit increments the value of a binary input A by one.

To do this, we will add the binary value:

00001

In this case, instead of a variable we use a constant. At CircuitVerse there is an input block called 'constant value', which allows defining a fixed value.

Constant block

By double-clicking the block, we can specify the value of the constant, as in these examples:

To implement the incrementer, we simply add the constant 00001 to the variable A using a 5-bit adder. For example, if A=01000:

5-bit incrementer

CircuitVerse does not consider the constant value as an input variable in Verilog format. This means that the block const_0 is part of the incrementer circuit, and not an external input:

Verilog code

Exercises on Jutge.org: Introduction to Digital Circuit Design

Remember that to access the exercises and for the Judge to evaluate your solutions you must be enrolled in the course. 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