Advertisement
panther5482

inscriber automation

Feb 16th, 2024 (edited)
1,043
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. module inscriberAutomation(
  2.     (* side=LEFT, colors={RED,GREEN,BLUE} *)
  3.     input [2:0] comparators,
  4.     (* side=RIGHT, colors={RED,GREEN,BLUE,CYAN,MAGENTA,PINK,ORANGE} *)
  5.     output [6:0] inscribers
  6. );
  7.  
  8. (* analog *)
  9. reg inscriberSel;
  10. reg sysEnable;
  11. reg [6:0] inscribersRaw;
  12. reg [6:0] inscribersEnabled;
  13.  
  14. And3 a3 (
  15.     .I0(comparators[0]),
  16.     .I1(comparators[1]),
  17.     .I2(comparators[2]),
  18.     .O(sysEnable)
  19. );
  20.  
  21. RandomizerAnalog ar (
  22.     .Min(0),
  23.     .Max(6),
  24.     .Q(inscriberSel)
  25. );
  26.  
  27. DeMux16Analog d16 (
  28.     .I(1),
  29.     .S(inscriberSel),
  30.     .O(inscribersRaw)
  31. );
  32.  
  33. And2 a2 [6:0] (
  34.     .I0(inscribersRaw),
  35.     .I1(sysEnable),
  36.     .O(inscribersEnabled)
  37. );
  38.  
  39. Delay d [6:0] (
  40.     .I(inscribersEnabled),
  41.     .O(inscribers),
  42.     .D(10)
  43. );
  44.  
  45. endmodule
  46.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement