Skip to content

Instantly share code, notes, and snippets.

@coldcue
Created September 28, 2014 17:46
Show Gist options
  • Save coldcue/b439bf0b3518d9e7467b to your computer and use it in GitHub Desktop.
Save coldcue/b439bf0b3518d9e7467b to your computer and use it in GitHub Desktop.
module shr_4(
input clk,
input ce,
input rst,
output [3:0] out
);
reg [3:0] shr;
assign out = shr;
always @ (posedge clk)
if(rst)
shr <= 4'b1110;
else if(ce)
shr <= {shr[2:0],shr[3]};
endmodule
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment