Android / iOS

VGA Graphics On An FPGA

Posted: April 20, 2008


This is my first FPGA project. I got this Xilinx Spartan3 FGPA starter kit which came with 5 pins hooked up to a VGA port. Basically all it does is takes the 50MHz clock crystal and halves it to 25MHz. This creates a VGA clock where each pixel is 1 clock cycle. It uses a 10 bit counter for doing the horizontal timing and a 10 bit counter for the vertical timing. Using these counters it calculates when to apply voltage to the horizontal and vertical sync pins and data on the red, green, and blue pins. Coding was all done in VHDL (source code is below). Btw, anyone interested in reading about video timings, I found this page quite useful:

I have a video of vga2.vhd working on

Update (2014-Sep-02): I did a new VGA project recently in Java with a more full explanation on how VGA works here: Java VGA

Related Projects

VGA: FPGA VGA, SX VGA, Atmel VGA, Propeller Poker, Nexys2, Java VGA


Spartan 3 starter kit

This is the Spartan 3 starter kit from Digilent.

(Click image for bigger picture)

Spartan 3 VGA color bars

This is vga.vhd running on my old Gateway monitor. I didn't want to risk doing something dumb and blowing up a CRT I liked :).

(Click image for bigger picture)

FPGA VGA bouncing square

This is vga2.vhd. This is an animation of a square changing colors really fast and bouncing around the screen. I put a video for this on YouTube here h?v=YcRCNr78GuQ. All source code is downloadable at the bottom of this page.

(Click image for bigger picture)

Nexys2 FPGA VGA color bars

Update June 12, 2011: I updated the ucf file for the Digilent Nexys2 board and made vhdl file for it. The colorbars and square move around the screen in this. For information on how to compile and run this from the command line on linux see here.

(Click image for bigger picture)


Digilent - This is the web site where I got my FPGA starter kit from. They have some really nice stuff there.

Source code

VGA Project 1: vga.vhd vga.ucf
VGA Project 2: vga2.vhd vga2.ucf
Nexys2 VGA: vga_nexys2.vhdl vga_nexys2.ucf

Copyright 1997-2015 - Michael Kohn