Guest User

Untitled

a guest
Sep 15th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. //=======================================================
  3. //  This code is generated by Terasic System Builder
  4. //=======================================================
  5.  
  6. module Program3(
  7.  
  8.     //////////// CLOCK //////////
  9.     CLOCK_50,
  10.  
  11.     //////////// LED //////////
  12.     LED,
  13.  
  14.     //////////// KEY //////////
  15.     KEY
  16. );
  17.  
  18. //=======================================================
  19. //  PARAMETER declarations
  20. //=======================================================
  21.  
  22.  
  23. //=======================================================
  24. //  PORT declarations
  25. //=======================================================
  26.  
  27. //////////// CLOCK //////////
  28. input                       CLOCK_50;
  29.  
  30. //////////// LED //////////
  31. output  reg     [7:0]       LED;
  32.  
  33. //////////// KEY //////////
  34. input            [1:0]      KEY;
  35.  
  36.  
  37. //=======================================================
  38. //  REG/WIRE declarations
  39. //=======================================================
  40.  
  41.  
  42.  
  43. //=======================================================
  44. //  Structural coding
  45. //=======================================================
  46.  
  47. always @ (posedge CLOCK_50)
  48.  
  49. if (KEY[0])
  50. begin
  51.     LED = (LED << 1) | 1;
  52. end
  53.  
  54. //else if (KEY[1])
  55. //begin
  56. //  LED = (LED >> 1);
  57. //end
  58.  
  59. endmodule
Add Comment
Please, Sign In to add comment