Skip to content
Digital circuitsCHIP Chair Logo

Buses

In digital circuits, a bit bus (or simply bus) is a set of communication lines that carry data bits in parallel. It is used to interconnect different components of a system by transferring digital signals.

Bit shifting is a fundamental operation in data processing of a bus. It consists of moving all the bits of a register (or binary word) to the left or to the right.

Notation

In this section we will work with variables that represent binary numbers of N bits. To refer to a variable, we will use notation such as A[3:0], which describes a set of 4 bits named A.

The range [3:0] specifies that the bits are indexed from 3 down to 0. This variable can be decomposed into its individual bits:

A=A[3:0]=[A3 A2 A1 A0]

Where A3 is the most significant bit (MSB) and A0 is the least significant bit (LSB). This notation allows us to refer to both the complete set (A) and to each of its bits (Ai).

Example: Designing a 4-bit left-shift bus circuit

Suppose we work with binary data and need to move all the bits of a sequence one position to the left.

For example, 1010 binary is 10 in decimal:

10102=1010

If we shift left by one position we obtain 10100, which is equivalent to multiplying its value by 2.

101002=2010

A complete truth table for a high-number-of-bits N is infeasible (it would have 2N rows). We will focus on a case of N=4 bits, where the table is still manageable.

The following shows the truth table of a left-shifting circuit. The input is A[3:0]=[A3A2A1A0] and the output is B[3:0]=[B3B2B1B0].

Input AOutput B
00000000
00010010
00100100
00110110
01001000
01011010
01101100
01111110
10000000
10010010
10100100
10110110
11001000
11011010
11101100
11111110

Our objective is to design a 4-bit shift circuit. We have two options:

In this section we will use multiplexers. The circuit is the following:

Left-shift circuit

The control signal Sel determines whether the shift is performed:

  • If Sel=0, the output is equal to the input (no shifting).
  • If Sel=1, the multiplexers perform a left shift by one position.

For each output bit Bi, we will use a 2-to-1 multiplexer:

  • MUX for B3
    • Input 0: A3
    • Input 1: A2
    • Output: B3
  • MUX for B2
    • Input 0: A2
    • Input 1: A1
    • Output: B2
  • MUX for B1
    • Input 0: A1
    • Input 1: A0
    • Output: B1
  • MUX for B0
    • Input 0: A0
    • Input 1: 0 (input bit)
    • Output: B0

Exercises at 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