Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module HexDriver (input logic [3:0] In0,
- output logic [6:0] Out0);
- always_comb
- begin
- if(In0 == 4'b0000) { // Input = 0
- Out0 = 7'b1000000;
- } else if(In0 == 4'b0001) { // Input = 1
- Out0 = 7'b1111001;
- } else if(In0 == 4'b0010) { // Input = 2
- Out0 = 7'b0100100;
- } else if(In0 == 4'b0011) { // Input = 3
- Out0 = 7'b0110000;
- } else if(In0 == 4'b0100) { // Input = 4
- Out0 = 7'b0011001;
- } else if(In0 == 4'b0101) { // Input = 5
- Out0 = 7'b0010010;
- } else if(In0 == 4'b0110) { // Input = 6
- Out0 = 7'b0000010;
- } else if(In0 == 4'b0111) { // Input = 7
- Out0 = 7'b1111000;
- } else if(In0 == 4'b1000) { // Input = 8
- Out0 = 7'b0000000;
- } else if(In0 == 4'b1001) { // Input = 9
- Out0 = 7'b0010000;
- } else if(In0 == 4'b1010) { // Input = A
- Out0 = 7'b0001000;
- } else if(In0 == 4'b1011) { // Input = B
- Out0 = 7'b0000011;
- } else if(In0 == 4'b1100) { // Input = C
- Out0 = 7'b1000110;
- } else if(In0 == 4'b1101) { // Input = D
- Out0 = 7'b0100001;
- } else if(In0 == 4'b1110) { // Input = E
- Out0 = 7'b0000110;
- } else if(In0 == 4'b1111) { // Input = F
- Out0 = 7'b0001110;
- } else {
- Out0 = 7'bX;
- }
- end
- endmodule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement