Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module VGA_Draw(CLOCK_50, line, pegColours, VGA_CLK,
- VGA_HS,
- VGA_VS,
- VGA_BLANK_N, VGA BLANK
- VGA_SYNC_N,
- VGA_R,
- VGA_G,
- VGA_B
- );
- localparam line1y = 8'd4, line2y = 8'd12, line3y = 8'd20, line4y = 8'd28, line5y = 8'd36, line6y = 8'd44, line7y = 8'd52, line8y = 8'd60;
- localparam line1x = 7'd20, line2x = 7'd28, line3x = 7'd36, line4x = 7'd44;
- input [7:0] pegColours;
- input [3:0] line;
- input CLOCK_50;
- output VGA_CLK;
- output VGA_HS;
- output VGA_VS;
- output VGA_BLANK_N;
- output VGA_SYNC_N;
- output [9:0] VGA_R;
- output [9:0] VGA_G;
- output [9:0] VGA_B;
- reg [8:0] currY;
- always @(*)
- begin
- case (line[3:0])
- 3'b000: currY <= line1y;
- 3'b001: currY <= line2y;
- 3'b010: currY <= line3y;
- 3'b011: currY <= line4y;
- 3'b100: currY <= line5y;
- 3'b101: currY <= line6y;
- 3'b110: currY <= line7y;
- 3'b111: currY <= line8y;
- endcase
- end
- //ROW N
- VGA_Control L1C1(.CLOCK_50(CLOCK_50), .KEY(KEY), .SW([1colour[7:6]),
- .yCoord(currY), .xCoord(line1x), .VGA_ClK(VGA_CLK),
- .VGA_HS(VGA_HS), .VGA_VS(VGA_VS), .VGA_BLANK_N(VGA_BLANK_N),
- .VGA_SYNC_N(VGA_SYNC_N), .VGA_R(VGA_R), .VGA_G(VGA_G),
- .VGA_B(VGA_B));
- VGA_Control L1C2(.CLOCK_50(CLOCK_50), .KEY(KEY), .SW([1colour[5:4]),
- .yCoord(currY), .xCoord(line2x), .VGA_ClK(VGA_CLK),
- .VGA_HS(VGA_HS), .VGA_VS(VGA_VS), .VGA_BLANK_N(VGA_BLANK_N),
- .VGA_SYNC_N(VGA_SYNC_N), .VGA_R(VGA_R), .VGA_G(VGA_G),
- .VGA_B(VGA_B));
- VGA_Control L1C3(.CLOCK_50(CLOCK_50), .KEY(KEY), .SW([1colour[3:2]),
- .yCoord(currY), .xCoord(line3x), .VGA_ClK(VGA_CLK),
- .VGA_HS(VGA_HS), .VGA_VS(VGA_VS), .VGA_BLANK_N(VGA_BLANK_N),
- .VGA_SYNC_N(VGA_SYNC_N), .VGA_R(VGA_R), .VGA_G(VGA_G),
- .VGA_B(VGA_B));
- VGA_Control L1C4(.CLOCK_50(CLOCK_50), .KEY(KEY), .SW([1colour[1:0]),
- .yCoord(currY), .xCoord(line4x), .VGA_ClK(VGA_CLK),
- .VGA_HS(VGA_HS), .VGA_VS(VGA_VS), .VGA_BLANK_N(VGA_BLANK_N),
- .VGA_SYNC_N(VGA_SYNC_N), .VGA_R(VGA_R), .VGA_G(VGA_G),
- .VGA_B(VGA_B));
- endmodule;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement