Inside VGA - mammenx/synesthesia_zen GitHub Wiki

HOME > TECHNICAL DOCUMENTATION > INSIDE VGA

Video Graphics Array (VGA) is a video transmission and display standard first brought out by IBM in the late 1980s, primarily intended for analog medium. The 15 pin D-Sub VGA connector and the 640x480 resolution are industry standards which are supported by devices even to this day.

There are many terms associated with VGA that would be good to know as it helps fully appreciate this standard. In fact many modern standards like V-by-One-HS and DVI reuse these concepts for the digital domain.

Now, lets have a look at the VGA signals:

VGA Signal Timing Diagram

There are three signals given here; the main video line or green line, the Horizontal Sync (HSYNC) line and the Vertical Sync (VSYNC) line. All three are analog signals, but lets now get into the voltages now.

The main video line is a composite of RED, GREEN & BLUE signals which together form the complete color of a particular pixel. But how does this single line convey all the different pixel colors in a 640x480 screen? Well, its taken for granted that all the VGA lines run on a core pixel clock (25.125MHz for the 640x480 resolution). So by sampling the main line on this clock period, its possible to extract different pixel information one at a time. Also all the timing parameters of the VGA standard are expressed in units of this pixel clock.

To understand the need for the HSYNC & VSYNC signals, one needs to get into the mechanics of how old school CRT monitors work. This video says it all. Basically you have an electron gun that sweeps across the screen "painting" the colors pixel by pixel, line by line and frame by frame. So how does it know when the current line/frame is complete and that it has to rollover to next line/frame? This is where the HSYNC VSYNC signals come in.

VGA Line Sweep

As you can see from the diagram above, each time the end of a horizontal line of pixel is reached, the HSYNC pulse (active low) is triggered. This makes the gun point to the start of the next line. In terms of indexes, the X index is reset to 0 while the Y index is incremented by 1. Now when the last pixel in the last line of the screen is painted, the VSYNC signal (also active low) is triggered. This makes the gun point to the first pixel of the first line of the screen i.e. both X & Y indexes are reset to 0. Sweet.

Now modern LCD screens don't have electron guns painting back and forth but the principle remains the same. It's called refreshing the screen and its how motion is made on the screen. In 640x480 VGA, the screen refresh rate is 60 times a sec.

Then comes the Front & Back porches. These are nothing but time intervals before and after applying the sync pulses.

Putting everything together, the syn_vga_fsm module is responsible for generating the VGA signals based on industry standard values.

⚠️ **GitHub.com Fallback** ⚠️