Advertisement
Kireychik

Clock.sv

May 15th, 2020
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. module Clock(
  2.     input logic c,
  3.     output logic [5:0] sec,
  4.     output logic [5:0] min,
  5.     output logic [4:0] hours
  6.     );
  7.    
  8. logic trig_sec = 0;
  9. logic trig_min = 0;
  10. logic trig_hour = 0;
  11.    
  12. counter60 SEC (
  13.     .c(c),
  14.     .en(1),
  15.     .trig(trig_sec),
  16.     .count(sec)
  17. );
  18. counter60 MIN (
  19.     .c(c),
  20.     .en(trig_sec),
  21.     .trig(trig_min),
  22.     .count(min)
  23. );
  24. counter24 HOUR (
  25.     .c(c),
  26.     .en(trig_min && trig_sec),
  27.     .trig(trig_hour),
  28.     .count(hours)
  29. );
  30.  
  31.  
  32. endmodule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement