BIT103 ยท 2081 ยท 5 marks
Define shifter. Design a 4-bit shifter circuit. [1+4]
Define shifter. Design a 4-bit shifter circuit. [1+4]
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
| S | Y3 | Y2 | Y1 | Y0 | Operation |
|---|---|---|---|---|---|
| 0 | D2 | D1 | D0 | 0 | Shift Left by 1 |
| 1 | 0 | D3 | D2 | D1 | Shift 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
| Output | S=0 (Shift Left) | S=1 (Shift Right) |
|---|---|---|
| Y3 | D2 | 0 |
| Y2 | D1 | D3 |
| Y1 | D0 | D2 |
| Y0 | 0 | D1 |
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.