Skip to content

Instantly share code, notes, and snippets.

@buttercutter
Created October 12, 2017 09:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save buttercutter/59803bc1b6030cdcd8013edcc2852500 to your computer and use it in GitHub Desktop.
Save buttercutter/59803bc1b6030cdcd8013edcc2852500 to your computer and use it in GitHub Desktop.
module shift_register(clk, serial_in, data_is_available, received_data); // manages sampling-related data signal using SIPO shift register
input clk, serial_in, data_is_available;
output reg [7:0] received_data; // SIPO
always @(posedge clk)
begin
if(data_is_available)
received_data <= { serial_in , received_data[7:1] }; // LSB received first by UART definition
end
endmodule
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment