8 Bit Barrel Shifter Verilog Code | Verilog Code of Barrel Shifter

8 Bit Barrel Shifter Verilog Code

Verilog Code of Barrel Shifter

In this post we are going to share with you the verilog code of barrel shifter. Barrel shifter is a combinational circuit, unlike regular shifters which are sequential circuit.  To shift a 8 bit data , register based shifters will take 8 clock cycles whereas Barrel Shifter can do it by the time of one clock cycle. It is used in ALU for performing shifting operation.

The general block diagram of a mux based Barrel Shifter is given below.

barrel shifter

We have implemented the above barrel shifter in verilog. The verilog code of Barrel Shifter is given below.

8 bit Barrel Shifter Verilog Code

 

The test bench for 8 bit Barrel Shifter is given below.

Barrel Shifter Verilog Code Test Bench

 

The simulation result of barrel shifter verilog code is given below.

 

If you have any query/suggestion please feel free to comment below the post.

 

Leave a Reply

avatar
  Subscribe  
Notify of