0% found this document useful (0 votes)
90 views17 pages

8-Bit Barrel Shifter Using Mux

Uploaded by

fermidirac2020
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
90 views17 pages

8-Bit Barrel Shifter Using Mux

Uploaded by

fermidirac2020
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 17

NATIONAL INSTITUTE OF TECHNOLOGY, RAIPUR

Dept. Of Electronics & Communication Engineering


(VLSI & Embedded System Engineering )
M. Tech – 1stSem

Presentation On
“ 8 Bit Barrel Shifter using Multiplexers”
Guided by: Presented by :
Dr. Ashish Kumar 1. Nikita Marndi
Asst. Professor 2. Krishna Kumar Sahu
Dept. of Electronics & Communication Eng. 3. Shubham Chandra
02/11/2024 Dept. of Electronics & Communication Engineering 1
Contents

1. Introduction
2. Block Diagram
3. Internal Operation
4. Flow Chart
5. Verilog Code
6. Test Bench
7. Simulation Waveform
8. Applications
9. Conclusion
10. References

02/11/2024 Dept. of Electronics & Communication Engineering 2


Introduction

What is a Shifter?
• It is digital circuit that is used for arithmetic shifting, logical shifting and rotation functions.
• It is commonly used in arithmetic operations and bit manipulation.
• Logical shifter, Barrel Shifter and Funnel shifter are different examples of Shifter circuits.

What is a Barrel Shifter?


• A shifter circuit that can shift data by multiple bit positions in a single clock cycle.
• It rotates numbers in a cycle such that empty spots are filled with bits shifted off from the other
end.

02/11/2024 Dept. of Electronics & Communication Engineering 3


Contd.

Why the name – Barrel Shifter?


• It rotates bits similar to a rotating barrel in a mechanical device. The structure of the shifter can be
imagined
like a barrel where data can be shifted or "rotated" left or right by multiple positions in one step, just
like
a barrel rotates in circular fashion.

Multiplexer (MUX) Usage:


• MUXes are used for selecting between various shifted outputs based on control or shift inputs.
• They enable multi bit shifting with fewer hardware resources.

Select Lines for Shifting Magnitude:


• To shift the data in single cycle, we will use 3 bit (2^3 = 8) select lines for 8 bit numbers.

02/11/2024 Dept. of Electronics & Communication Engineering 4


Block Diagram

02/11/2024 Dept. of Electronics & Communication Engineering 5


Internal Operation
Internally, the 8 bit barrel shifter uses 3 layers of multiplexers.

1. First Layer: Shift by 1 bit if control signal b[0] is set.


2. Second Layer: Shift by 2 bit if control signal b[1] is set.
3. Third Layer: Shift by 4 bit if control signal b[2] is set.

For an 8-bit barrel shifter:

• If the input is a = 8’b10101010; shifting for 3 bit i.e,b = 3’b001 and dir = 0 for left shifting
the output is y = 8’b01010101.
• In barrel shifter, instead of shifting by 1 positions repeatedly, the control logic shifts the input
directly by 3 positions in 1 cycle.

02/11/2024 Dept. of Electronics & Communication Engineering 6


Flow Chart

For n bit number, number of 2:1 mux required for barrel shifter is n*log2(n).
For 8 bit : 8*log2(8) = 24 mux
Here input [7:0]a = 10101010, for 1 bit left shift we are getting output [7:0]y = 01010101
02/11/2024 Dept. of Electronics & Communication Engineering 7
Verilog Code

02/11/2024 Dept. of Electronics & Communication Engineering 8


02/11/2024 Dept. of Electronics & Communication Engineering 9
02/11/2024 Dept. of Electronics & Communication Engineering 10
02/11/2024 Dept. of Electronics & Communication Engineering 11
Testbench

02/11/2024 Dept. of Electronics & Communication Engineering 12


Simulation Waveform

02/11/2024 Dept. of Electronics & Communication Engineering 13


Application

1. Signal Processing: Used in digital signal processing (DSP) for fast manipulation of data in Fourier transforms and filtering.

2. Graphics Processing: In video and image processing, shifting operations are needed for scaling, rotation, or manipulation

of pixel data, and barrel shifters can be used to perform these processes.

3. Processors/ALUs: Barrel shifters are used in processors for faster arithmetic and bit manipulation operations. For example,

they are used in multiplication, division, and other arithmetic operations that involve shifting.

4. Cryptography: Many cryptographic algorithms require fast bitwise operations, such as rotation and shifting, which can be

efficiently performed using barrel shifters.

02/11/2024 Dept. of Electronics & Communication Engineering 14


Conclusion

1. Efficient Bit Shifting: The 8-bit barrel shifter allows for fast shifting of data by multiple positions in a single clock cycle.
2. MUX-Based Design : The use of multiplexers simplifies the circuit and enables shifts of large magnitudes with minimal
hardware.
3. Versatility : Can be used for both left and right shifts by modifying the control logic. Suitable for a variety of digital
systems and hardware requiring rapid data manipulation.
4. Real-World Applications : Widely used in processors, cryptographic systems, digital signal processors (DSPs), and
floating-point arithmetic operations.

The barrel shifter is an important component in modern digital circuits, offering a balance between speed and simplicity,
with applications in various fields of computing and electronics

02/11/2024 Dept. of Electronics & Communication Engineering 15


References

1. S. B. Jondhale, T. S. Mulla, and Sachin Patil Patil, “Design and Implementation of 8 Bit Barrel Shifter Using 2:1
Multiplexer in Verilog,” Journal of Advances in Science and Technology, vol. 12, 2016.

02/11/2024 Dept. of Electronics & Communication Engineering 16


THANK YOU

02/11/2024 Dept. of Electronics & Communication Engineering 17

You might also like