Skip to content

Instantly share code, notes, and snippets.

@02015678
Created January 18, 2015 17:01
Show Gist options
  • Save 02015678/71493987365291198b8d to your computer and use it in GitHub Desktop.
Save 02015678/71493987365291198b8d to your computer and use it in GitHub Desktop.
module DDPP8_56(CLK, RST, ENA, DIGI);
input CLK, RST, ENA;
output [7:0] DIGI;
reg [7:0] DIGI;
wire tmp;
assign tmp = {DIGI[6:0]==7'b1111111}?0:1;
always @(posedge CLK)
begin
if (RST) DIGI <= 8'b11111110;
else
case (ENA)
1: DIGI <= {DIGI[6:0],tmp};
0: DIGI <= DIGI;
endcase
end
endmodule
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment