1
0

PhaseGen.v 585 B

1234567891011121314151617181920212223242526272829
  1. /*
  2. * Phase generator for color carrier
  3. */
  4. module PhaseGen(
  5. input clk, //2*57.272727MHz
  6. input [4:0] select, // phase select
  7. output wire colorPhase, // phase of selected color
  8. output wire burstPhase // phase of color burst
  9. );
  10. reg [4:0] counter;
  11. wire [4:0] phaseCounter;
  12. assign phaseCounter = counter - select + 5'd0;
  13. assign burstPhase = counter[4];
  14. assign colorPhase = phaseCounter[4];
  15. always @(posedge clk)
  16. begin
  17. counter <= counter + 1'b1;
  18. end
  19. initial
  20. begin
  21. counter <= 5'd0;
  22. end
  23. endmodule