⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vga_colors.v

📁 通过vga通讯控制显示器显示七彩条文
💻 V
字号:
/*
 *  Copyright (C) 2006-2008 CMM Sigma Andrzej Chmielowiec <cmmsigma@cmmsigma.eu>
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License version 3
 *  as published by the Free Software Foundation.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  If you want to use this code under other conditions, please contact 
 *  CMM Sigma <cmmsigma@cmmsigma.eu>.
 */
/*
 * vga_colors.v author Andrzej Chmielowiec
 * (c) Copyright by CMM Sigma (http://www.cmmsigma.eu)
 */

/*
 * This code and its parts can be used for educational 
 * purposes only.
 */

/*
 * Module signals
 * ==============
 *
 * hSync[out] - 
 *   Horizontal synchronization of VGA (D-Sub Connector Pin 13).
 *
 * vSync[out] -
 *   Vertical synchronization of (D-Sub Connector Pin 14).
 *
 * red[out] -
 *   Red color component for given pixel (D-Sub Connector Pin 1).
 *
 * green[out] - 
 *   Green color component for given pixel (D-Sub Connector Pin 2).
 *
 * blue[out] - 
 *   Blue color component for given pixel (D-Sub Connector Pin 3).
 *
 * clk[in] -
 *   Clock signal.
 *
 */
module VgaColors
(
	output hSync,
	output vSync,
	output red,
	output green,
	output blue,
	input clk,reset_n
);
// want active-high reset
  wire reset;
  assign reset = ~reset_n;
// 640x480 expects 25 MHz, so divide 50 Mhz by two
  reg clk_div2;
  always @(posedge clk)
    if (reset) clk_div2 <= 0;
    else clk_div2 <= clk_div2 + 1'b01;

	wire [11:0] pixelWire;

	VgaSync #
	(
		.H_PIXELS(640),
		.V_LINES(480)
	)
	vgaSync
	(
		.hSync(hSync),
		.vSync(vSync),
		.redOut(red),
		.greenOut(green),
		.blueOut(blue),
		.pixel(pixelWire),
		.line(lineWire),
		.redIn(pixelWire[6]),
		.greenIn(pixelWire[7]),
		.blueIn(pixelWire[8]),
		.clk(clk_div2)
	);
	
endmodule

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -