Skip to content

Instantly share code, notes, and snippets.

@coldcue
Created September 28, 2014 17:46
Show Gist options
  • Select an option

  • Save coldcue/b439bf0b3518d9e7467b to your computer and use it in GitHub Desktop.

Select an option

Save coldcue/b439bf0b3518d9e7467b to your computer and use it in GitHub Desktop.

Revisions

  1. coldcue created this gist Sep 28, 2014.
    18 changes: 18 additions & 0 deletions 7seg_shr.v
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    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