2081 11

BIT103 ยท 2081 ยท 5 marks

Define shifter. Design a 4-bit shifter circuit. [1+4]

Define shifter. Design a 4-bit shifter circuit. [1+4]

Digital LogicChapter 10: Shift Registers and Data ProcessingShifter circuits

Quick answer

A shifter is a combinational logic circuit that shifts the bits of a binary input word either to the left or to the right by one or more bit positions. It can also perform logical shift, arithmetic shift, or circular (rotate) operations depending on the control inputs.

Shifter: Definition and 4-bit Design


Definition of Shifter (1 mark)


Design of a 4-bit Shifter Circuit (4 marks)

Overview

A basic 4-bit combinational shifter accepts:

  • A 4-bit input: D3, D2, D1, D0 (D3 = MSB, D0 = LSB)
  • A control signal: S (shift direction)
    • S = 0 โ†’ Shift Left (each bit moves one position toward MSB; LSB filled with 0)
    • S = 1 โ†’ Shift Right (each bit moves one position toward LSB; MSB filled with 0)

Truth Table / Operation

SY3Y2Y1Y0Operation
0D2D1D00Shift Left by 1
10D3D2D1Shift Right by 1

Boolean Expressions for Each Output

Using a 2-to-1 MUX at each output bit:

$$Y_3 = \bar{S} \cdot D_2 + S \cdot 0 = \bar{S} \cdot D_2$$

$$Y_2 = \bar{S} \cdot D_1 + S \cdot D_3$$

$$Y_1 = \bar{S} \cdot D_0 + S \cdot D_2$$

$$Y_0 = \bar{S} \cdot 0 + S \cdot D_1 = S \cdot D_1$$


Circuit Diagram (Gate Level)

Each output bit is implemented using a 2-to-1 MUX (two AND gates + one OR gate):

D3 โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                             AND โ”€โ”€โ”
S  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     |
                                   OR โ”€โ”€ Y2
Sฬ„  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     |
                             AND โ”€โ”€โ”˜
D1 โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

(Similar structure for Y3, Y1, Y0)

Complete structure:

         โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
         โ”‚           4-bit Shifter                     โ”‚
         โ”‚                                             โ”‚
D3 โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€ [AND] โ”€โ”€(SยทD3)โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Y2      โ”‚
         โ”‚       โ†‘                                     โ”‚
         โ”‚       S                                     โ”‚
         โ”‚                                             โ”‚
D2 โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€ [AND] โ”€โ”€(Sฬ„ยทD2)โ”€โ”€[OR]โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Y3     โ”‚
         โ”‚                        โ†‘                   โ”‚
         โ”‚       0 โ”€โ”€[AND]โ”€โ”€(Sยท0)โ”€โ”˜                   โ”‚
         โ”‚                                             โ”‚
D1 โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€ [AND] โ”€โ”€(Sฬ„ยทD1)โ”€โ”€[OR]โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Y2     โ”‚
         โ”‚                        โ†‘                   โ”‚
         โ”‚    D3โ”€โ”€[AND]โ”€โ”€(SยทD3)โ”€โ”€โ”€โ”˜                   โ”‚
         โ”‚                                             โ”‚
D0 โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€ [AND] โ”€โ”€(Sฬ„ยทD0)โ”€โ”€[OR]โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Y1     โ”‚
         โ”‚                        โ†‘                   โ”‚
         โ”‚    D2โ”€โ”€[AND]โ”€โ”€(SยทD2)โ”€โ”€โ”€โ”˜                   โ”‚
         โ”‚                                             โ”‚
  0 โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€ [AND] โ”€โ”€(Sฬ„ยท0) โ”€โ”€[OR]โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Y0     โ”‚
         โ”‚                        โ†‘                   โ”‚
         โ”‚    D1โ”€โ”€[AND]โ”€โ”€(SยทD1)โ”€โ”€โ”€โ”˜                   โ”‚
         โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Summary Table

OutputS=0 (Shift Left)S=1 (Shift Right)
Y3D20
Y2D1D3
Y1D0D2
Y00D1

Key Points

  • Each output bit uses one 2-to-1 MUX controlled by S.
  • Total: 4 MUX units (each built from 2 AND gates + 1 OR gate + 1 NOT gate shared).
  • The circuit is purely combinational (no clock or memory elements).
  • The vacated bit position is filled with logic 0 (logical shift).

Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.