module task2(CLOCK_50, KEY, SW, LEDR, HEX0, HEX1, HEX2, HEX3, HEX4, HEX5,
	VGA_R, VGA_G, VGA_B, VGA_HS, VGA_VS, VGA_CLK, VGA_X, VGA_Y,
	VGA_COLOUR, VGA_PLOT);

	input logic CLOCK_50;
	input logic [3:0] KEY;
	input logic [9:0] SW;
	output logic VGA_HS, VGA_VS, VGA_CLK, VGA_PLOT;
	output logic [2:0] VGA_COLOUR;
	output logic [6:0] VGA_Y, HEX0, HEX1, HEX2, HEX3, HEX4, HEX5;
	output logic [7:0] VGA_X, VGA_R, VGA_G, VGA_B;
	output logic [9:0] LEDR;

	logic resetn, start, done;
	logic [2:0] colour;

	assign resetn = KEY[3];
	assign start = ~KEY[0];
	assign LEDR[0] = done;

	vga_adapter #(.RESOLUTION("160x120")) U0(resetn, CLOCK_50,
		VGA_COLOUR, VGA_X, VGA_Y, VGA_PLOT,
		{VGA_R, 2'b00}, {VGA_G, 2'b00}, {VGA_B, 2'b00},
		VGA_HS, VGA_VS, VGA_BLANK, VGA_SYNC, VGA_CLK);

	fillscreen U1(CLOCK_50, resetn, colour, start, done,
		VGA_X, VGA_Y, VGA_COLOUR, VGA_PLOT);

endmodule: task2
