NTSC Video With VHDL

The Theory
           An NTSC signal has 5 main parts that you need to understand in order to create the signal intelligently and correctly:
(1) The Horizontal Sync
(2) The Color Burst
(3) The Data Display
(4) Interlacing Of Data
(5) The Vertical Sync

Horizontal Sync, Color Burst and Data Display

           Each visible line on your television (about 480 in total) will have followed the timing diagram seen above (click on it for a larger version). The timing diagram tells us the exact length of time the horizontal sync, color burst and display of data takes. The Horizontal sync brings the signal to 0v for 4.7uS. This sync is padded in front and back by 1.5uS and 0.6uS 0.3v pauses.
           Following the horizontal sync there is a color burst which is what tells your TV what colors will be used for the line, this takes 2.5uS (for this tutorial we will ignore using color and keep the signal steady at 0.3v).
           After the colorburst is a 1.6uS delay after which each pixel of data for the line is displayed over a 52.6uS time period. During this active video phase the output signal will be between 0.3v and 1.0v, representing the intesity of the current color being used.

Interlacing Of Data

           NTSC uses an interlaced data type of output where first the odd line numbers are display on your TV screen and then the even line numbers are displayed. These two fields are output to the TV one after the other and each has a vertical sync following it. Since pixel data isn't output pixel by pixel and line by line things can seem a little tricky, but with the tricks of VHDL we can make outputting what we want less of a hassle as we'll see later.

The Vertical Sync

           The picture above is a good illustration of what the vertical sync should look like and how it fits in with the rest of the data stream. Before line 1 or line 2 are reached the vertical sync happens. The vertical sync tells your TV that the entire field (whether even or odd) has just finished passing the data and that the TV should get ready to receive the next field of data. Here is a closer look with timing reference of how a vertical sync should look:

           After the series of 6 quick high pulses, 6 quick low pulses and 6 quick high pulses again, there's a series of 12 'line length' pulses. This completes the vertical sync.