Pages

Sunday, 21 July 2013

Design of Serial IN - Serial OUT Shift Register using Behavior Modeling Style (Verilog CODE) -






Design of Serial IN - Serial OUT Shift Register using Behavior Modeling Style -


Output Waveform :   Serial IN - Serial OUT  Shift Register



Verilog CODE-



//-----------------------------------------------------------------------------
//
// Title       : Serial_in_Serial_out
// Design      : verilog upload 2
// Author      : Naresh Singh Dobal
// Company     : nsdobal@gmail.com
// Verilog Programs & Exercise by Naresh Singh Dobal.
//
//-----------------------------------------------------------------------------
//
// File        : Serial IN - Serial OUT shift register using Behavior Modeling Style.v



module Serial_in_Serial_out ( din ,clk ,reset ,dout );

output dout ;
reg dout ;

input din ;
wire din ;
input clk ;
wire clk ;
input reset ;
wire reset ;

reg [2:0]s;

always @ (posedge (clk)) begin
if (reset)
dout <= 0;
else begin
s[0] <= din ;
s[1] <= s[0] ;
s[2] <= s[1] ;
dout <= s[2];
end
end

endmodule

9 comments: