Skip to content

Instantly share code, notes, and snippets.

@axayjha
Last active April 8, 2019 19:42
Show Gist options
  • Save axayjha/a58c7c5763052dde33997b992a382f08 to your computer and use it in GitHub Desktop.
Save axayjha/a58c7c5763052dde33997b992a382f08 to your computer and use it in GitHub Desktop.
module PIPO_R2 (dout, din, ld, clr, clk);
input [15:0] din;
input ld, clr, clk;
output reg [15:0] dout;
always @(posedge clk)
// if clear signal is on, set register value to 0
if (clr) dout <= 16'b0;
// else if load signal is on, load new data
else if (ld) dout <= din;
endmodule
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment