2018-08-13 22:17:36 +00:00
|
|
|
|
2017-11-20 01:32:58 +00:00
|
|
|
`include "hvsync_generator.v"
|
|
|
|
|
2018-02-05 20:51:20 +00:00
|
|
|
module top(clk, reset, hsync, vsync, rgb);
|
2017-11-20 01:32:58 +00:00
|
|
|
|
2018-02-05 20:51:20 +00:00
|
|
|
input clk, reset;
|
2017-11-20 01:32:58 +00:00
|
|
|
output hsync, vsync;
|
|
|
|
output [2:0] rgb;
|
|
|
|
wire display_on;
|
|
|
|
wire [8:0] hpos;
|
|
|
|
wire [8:0] vpos;
|
|
|
|
|
|
|
|
hvsync_generator hvsync_gen(
|
|
|
|
.clk(clk),
|
2018-02-05 20:51:20 +00:00
|
|
|
.reset(reset),
|
2017-11-20 01:32:58 +00:00
|
|
|
.hsync(hsync),
|
|
|
|
.vsync(vsync),
|
|
|
|
.display_on(display_on),
|
|
|
|
.hpos(hpos),
|
|
|
|
.vpos(vpos)
|
|
|
|
);
|
|
|
|
|
|
|
|
wire r = display_on && hpos[4];
|
|
|
|
wire g = display_on && vpos[4];
|
|
|
|
wire b = display_on && hpos[0];
|
|
|
|
assign rgb = {b,g,r};
|
|
|
|
|
|
|
|
endmodule
|