Advertisement
Guest User

Untitled

a guest
Apr 27th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. module vr(input CLK, input[1:0] BTN, inout [48:1] pio);
  2. reg[26:0] cnt;
  3. always @ (posedge CLK)
  4. begin
  5. if(BTN[0] or BTN[1])
  6. reg <= reg+27'b1;
  7. else
  8. reg <= reg-27'b1;
  9. end
  10. wire num[3:0] = cnt[26:23];
  11.  
  12. reg [6:0] abcdefg;
  13. always@*
  14.  
  15. case(num)
  16. 4'h0: abcdefg = 7'b1111110;
  17. 4'h1: abcdefg = 7'b0110000;
  18. 4'h2: abcdefg = 7'b1101101;
  19. 4'h3: abcdefg = 7'b1111001;
  20. 4'h4: abcdefg = 7'b0110011;
  21. 4'h5: abcdefg = 7'b1011011;
  22. 4'h6: abcdefg = 7'b1011111;
  23. 4'h7: abcdefg = 7'b1110000;
  24. 4'h8: abcdefg = 7'b1111111;
  25. 4'h9: abcdefg = 7'b1111011;
  26. 4'ha: abcdefg = 7'b1110111;
  27. 4'hb: abcdefg = 7'b0011111
  28. 4'hc: abcdefg = 7'b1001110;
  29. 4'hd: abcdefg = 7'b0111101;
  30. 4'he: abcdefg = 7'b1001111;
  31. 4'hf: abcdefg = 7'b1000111;
  32.  
  33.  
  34. assign pio[1:7] = abcdefg;
  35.  
  36. endmodule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement