Advertisement
Sb93

vsevenseg.v

Oct 31st, 2024
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. module vsevenseg(
  2.     input [3:0] x,
  3.     output [6:0] seg_L);
  4.  
  5.     reg seg_L;
  6.  
  7.     always @ *
  8.     begin
  9.         case(x)
  10.             4'd0: seg_L = 7'b100_0000;
  11.             4'd1: seg_L = 7'b111_1001;
  12.             4'd2: seg_L = 7'b010_0100;
  13.             4'd3: seg_L = 7'b011_0000;
  14.             4'd4: seg_L = 7'b001_1001;
  15.             4'd5: seg_L = 7'b001_0010;
  16.             4'd6: seg_L = 7'b000_0010;
  17.             4'd7: seg_L = 7'b111_1000;
  18.             4'd8: seg_L = 7'b000_0000;
  19.             4'd9: seg_L = 7'b001_0000;
  20.             4'd10: seg_L = 7'b000_1000;
  21.             4'd11: seg_L = 7'b000_0011;
  22.             4'd12: seg_L = 7'b100_0110;
  23.             4'd13: seg_L = 7'b010_0001;
  24.             4'd14: seg_L = 7'b000_0110;
  25.             4'd15: seg_L = 7'b000_1110;
  26.             default: seg_L = 7'b111_1111;
  27.         endcase
  28.     end
  29. endmodule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement