Design and Implementation of a 15-Bit Barrel Shifter in Verilog
Muskan Gupta
Department of Electronics and Communication Engineering
Indian Institute of Technology Roorkee
Email: muskan_g@ece.iitr.ac.in
Enrollment Number: 22116057
Abstract
This experiment details the design and implementation of a 15-
bit barrel shifter that can left-shift an input data value by a
specified amount, controlled by a 3-bit signal.
Design Parameters
[1] Input, in: A 15-bit vector representing the data to be
shifted.
[2] Output, out: A 3-bit vector specifying the number of
positions to be shifted (0-7).
[3] Control signal, ctrl: A 15-bit vector containing the result
of the shift operation.
Tools
Verilog Compiler and Simulator
Theory
A 15-bit barrel shifter is a digital circuit that efficiently shifts Fig.2: Testbench Code
data by a specified number of bit positions. Unlike traditional
shifters, which perform shifts through iterative operations, a
barrel shifter allows for a multi-bit shift in a single clock cycle,
making it much faster. The 15-bit barrel shifter uses a
combination of multiplexers to select shifted values, based on
the required shift distance (e.g., 1 to 14 bits), controlled by a
Fig.3: Output
binary input that specifies the number of bits to shift.
Conclusion
Results
This experiment designed a 15-bit barrel shifter that left-shifts
data by 0 to 7 positions based on a 3-bit control signal,
producing an efficient and rapid shift operation. Barrel shifters
are vital in digital systems for high-speed data manipulation.
The implemented design demonstrates effectiveness in
arithmetic and signal processing applications.
Fig.1: Design Code