Merge pull request #265 from lnis-uofu/shift_reg

add shift register test case
This commit is contained in:
tangxifan 2021-03-08 09:49:22 -07:00 committed by GitHub
commit a1aade5d01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,24 @@
//-----------------------------------------------------//
// Design Name : Shift_reg
// File Name : Shift_reg_8192.v
// Function : Shift register
//------------------------------------------------------//
module shift_reg_8192 #( parameter size = 8191 ) (shift_in, clk, shift_out);
// Port Declaration
input shift_in;
input clk;
output shift_out;
reg [ size:0 ] shift; // shift register
always @ (posedge clk)
begin
shift = { shift[size-1:0] , shift_in } ;
end
assign shift_out = shift[size];
endmodule