script async='async' crossorigin='anonymous' src='https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-6016566166623052'/> Verilog coding: Verilog code for 4-Bit universal shift register:

Thursday 14 December 2017

Verilog code for 4-Bit universal shift register:

 4-Bit universal shift register:

                         You are looking for 4 bit Universal shift register? The Shift Register is one of sequential logic circuit that is used for the storage or the transfer of binary data.  A simple register can shift only in one direction that is called uni-directional shift register ' and ' A register that shifts in both direction (left or right ) is called bi-directional shift registers.  So, if a register shifts in both directions and ('Left to right' or 'right to left ') and has parallel load capabilities then it is called ' Universal shift register'.  Following is the Functional table and Block Diagram For "4 bit shift register".



Function table for the register

       

                           Fig.1: 4 Bit universal shift register

fpga verilog code example

Verilog code of D-Flip Flop:

module 4bit_universal_shift_reg(d, clr, clk, Q);
input d, clr, clk;
output Q;
reg Q;
always @ (negedge clr or posedge clk)
begin
if (!clr)
Q<= 1’b0;
else
Q<= d;
end
endmodule

No comments:

Post a Comment