Created
April 12, 2018 14:09
-
-
Save cocomoff/a4bd3f88fda65462364ebf460fa94960 to your computer and use it in GitHub Desktop.
7seg decode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module seg7dec ( | |
input [3:0] DIN, | |
output reg [6:0] HEX | |
); | |
always @* begin | |
case ( DIN ) | |
4'h0: HEX = 7'b1000000; | |
4'h1: HEX = 7'b1111001; | |
4'h2: HEX = 7'b0100100; | |
4'h3: HEX = 7'b0110000; | |
4'h4: HEX = 7'b0011001; | |
4'h5: HEX = 7'b0010010; | |
4'h6: HEX = 7'b0000010; | |
4'h7: HEX = 7'b1011000; | |
4'h8: HEX = 7'b0000000; | |
4'h9: HEX = 7'b0010000; | |
default:HEX = 7'bxxxxxxx; | |
endcase | |
end | |
endmodule |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment