`timescale 1ns / 1ps ////////////////////////////////////////////////////////////////////////////////// // // Engineer: Montek Singh // Create Date: 10/1/2014 // ////////////////////////////////////////////////////////////////////////////////// module vgadisplaydriver( input clk, // output [2:0] red, // Nexys 3 // output [2:0] green, // Nexys 3 // output [2:1] blue, // Nexys 3 // output [3:0] red, // Nexys 4 // output [3:0] green, // Nexys 4 // output [3:0] blue, // Nexys 4 output hsync, output vsync ); wire [10:0] x; wire [10:0] y; vgatimer myvgatimer(clk, hsync, vsync, activevideo, x, y); // For Nexys 3, use the following for 8-bit color assign red[2:0] = (activevideo == 1) ? x[2:0] : 3'b0; assign green[2:0] = (activevideo == 1) ? {x[2:1],y[0]} : 3'b0; assign blue[2:1] = (activevideo == 1) ? y[1:0] : 2'b0; // For Nexys 4, use the following for 12-bit color assign red[3:0] = (activevideo == 1) ? x[3:0] : 4'b0; assign green[3:0] = (activevideo == 1) ? {x[2:1],y[1:0]} : 4'b0; assign blue[3:0] = (activevideo == 1) ? y[3:0] : 4'b0; endmodule