Skip navigation.
Home

Verilog Serial in Serial Out Shift Register

A serial in serial out is the simplest kind of shift register to create. The input is shifted in on the left side of the register and the data is shifted out the right side of the register. This snippet demonstrates a parameterized serial in serial out verilog shift register.

module serial_in_out #(parameter WIDTH=8) (
  input  clk,
  input  data_in,                     
  output data_out
                     );
 
// register to hold shift values.
reg [WIDTH-1:0] shift_reg;
 
// sync process.
always @(posedge clk)
  shift_reg <= {data_in,shift_reg[WIDTH-1:1]};
 
// data output of shift register.
assign data_out = shift_reg[0];
 
endmodule

AttachmentSize
serial_in_serial_out_shift.v365 bytes

|

2011-08-23_11-17-13 -> 58a9e74c137382e1abf43a28bcc7adbe :: f4c31c8c81ffd691a77e671c640 http://www.hdlsnippets.com/?f4c31c8c81ffd691a77e671c640,