Video Graphics Array

From Wikipedia, the free encyclopedia
Jump to: navigation, search
This article is about the computer display standard. For the 640x480 resolution, see display resolution. For the 15-pin video connector, see VGA connector. For a full list of display resolutions, see Graphic display resolutions. For other uses, see VGA (disambiguation).
Video Graphics Array
Release date 1987; 28 years ago (1987)
Predecessor Enhanced Graphics Adapter

Video Graphics Array (VGA) refers specifically to the display hardware first introduced with the IBM PS/2 line of computers in 1987,[1] but through its widespread adoption has also come to mean either an Amplitude Modulated computer display standard, the 15-pin D-subminiature VGA connector or the 640x480 resolution itself.



Output capabilities[edit]

VGA graphics in 640x480x16 resolution
VGA graphics in 320x200x256 resolution


Standard graphics modes[edit]

Standard graphics modes are:


Higher-resolution and other display modes[edit]

Higher-resolution and other display modes are also achievable, even with standard cards and most standard monitors - on the whole, a typical VGA system can produce displays with any combination of:





For example, high resolution modes with square pixels are available at 768x576 or 704x528 in 16 colors, or medium-low resolution at 320x240 with 256 colors; alternatively, extended resolution is available with "fat" pixels and 256 colors using, e.g. 400x600 (50 Hz) or 360x480 (60 Hz), and "thin" pixels, 16 colors and the 70 Hz refresh rate with e.g. 736x410 mode.

"Narrow" modes such as 256x224 tend to preserve the same pixel ratio as in e.g. 320x240 mode unless the monitor is adjusted to stretch the image out to fill the screen, as they are derived simply by masking down the wider mode instead of altering pixel or line timings, but can be useful for reducing memory requirements and pixel addressing calculations for arcade game conversions or console emulators.

Standard text modes[edit]

Standard text modes:

  • 80x25 character display, rendered with a 9x16 pixel font, with an effective resolution of 720x400 in either 16 colors or monochrome, the latter being compatible with legacy MDA-based applications.[3]
  • 40x25, using the same font grid, for an effective resolution of 360x400
  • 80x43 or 80x50 (8x8 font grid) in 16-colors, with an effective resolution of 640x344 (EGA-compatible) or 640x400 pixels.

As with the pixel-based graphics modes, additional text modes are technically possible (as VGA resolution settings are notionally calculated from character-grid dimensions) with an overall maximum of about 100x80 cells and an active area spanning about 88x64 cells, but these are rarely used as it usually makes much more sense to just use a graphics mode - with a small, perhaps proportional font - if a larger text display is required. One variant that is sometimes seen is 80x30 or 80x60, using an 8x16 or 8x8 font and an effective 640x480 pixel display, which trades use of the more flickery 60 Hz mode for an additional 5 or 10 lines of text and square character blocks (or, at 80x30, square half-blocks).

Technical details[edit]

Circuitry design[edit]

VGA compared to other standard resolutions.



The original VGA specifications are as follows:

  • 256 kB Video RAM (The very first cards could be ordered with 64 kB or 128 kB of RAM, at the cost of losing some or all high-resolution 16-color modes.)
  • 16-color and 256-color paletted display modes.
  • Selectable 25.175 MHz[4] or 28.322 MHz master pixel clock
  • Usual line rate fixed at 31.469 kHz
  • Maximum of 800 horizontal pixels[5]
  • Maximum of 600 lines[5]
  • Refresh rates at up to 70 Hz[6]
  • Packed-pixel mode: 256 colors (Mode 13h)
  • Hardware smooth scrolling support
  • No hardware sprites,
  • No Blitter, but supports very fast data transfers via "VGA latch" registers.
  • Some "Raster Ops" support
  • Barrel shifter
  • Split screen support
  • 0.7 V peak-to-peak[7]


Signal timings[edit]

The intended standard value for the horizontal frequency of VGA is exactly double the value used in the NTSC-M video system, as this made it much easier to offer optional TV-out solutions or external VGA-to-TV converter boxes at the time of VGA's development. The formula for the VGA horizontal frequency is thus (60 ÷ 1001) × 525 kHz = 4500 ÷ 143 kHz ≈ 31.4685 kHz. All other frequencies used by the VGA card are derived from this value by integer multiplication or division. Since the exactness of quartz oscillators is limited, real cards will have slightly higher or lower frequency.

All derived VGA timings (i.e. those which still use the master 25.2 & 28.3 MHz crystals and 31.5 kHz line rate) can be varied widely by software that bypasses the VGA firmware interface and communicates directly with the VGA hardware, as many MS-DOS based games did. However, only the standard modes, or modes that at least use exactly the same H-sync and near-exact V-sync timings as one of the standard modes, can be expected to work with the original late-1980s and early-1990s VGA monitors. The use of other timings may in fact damage such monitors and thus was usually avoided by software publishers. Later "multisync" CRT monitors were usually much more flexible, and in combination with later SVGA graphics cards, could display a much wider range of resolutions and refresh rates at wholly arbitrary sync frequencies and pixel clock rates (or at least, within a particular lower/upper range, depending on model, which enfolded at least the normal (S)VGA options, often XGA as well, and far more besides in more upmarket examples).

For the most common VGA mode (640x480 "60 Hz" non-interlaced), the horizontal timings are:[8][9]

Parameter Value Unit
Pixel clock frequency 25.175 MHz[10]
Horizontal frequency 31.469 kHz
Horizontal pixels 640
Horizontal sync polarity Negative
Total time for each line 31.778 µs
Front porch (A) 0.636 µs
Sync pulse length (B) 3.813 µs
Back porch (C) 1.907 µs
Active video (D) 25.422 µs

(Total horizontal sync and blanking time = 6.356 µs; equivalent to pixel widths of A = 16, B = 96, C = 48, D = 640 and each complete line = 800)

VGA horizontal timings for 640x480

NB. The figures shown in this image may be slightly inaccurate and not match the above table exactly. The same general layout applies, merely at a lower frequency, for the vertical timings.

These timings are the same in the higher frequency mode, but all pixel counts are correspondingly multiplied by 9/8ths - thus, 720 active pixels, 900 total per line, and a 54 pixel back porch.

The vertical timings are:

Parameter Value Unit
Vertical lines 480
Vertical sync polarity Negative
Vertical frequency 59.94 Hz
Total time for each frame 16.683 ms
Front porch (A) 0.318 ms
Sync pulse length (B) 0.064 ms
Back porch (C) 1.048 ms
Active video (D) 15.253 ms


These timings are somewhat altered in "70Hz" mode, as although it uses the same line rate, its frame rate is not quite exactly 7/6ths that of "60Hz", despite 525 dividing cleanly into 7 - and, of course, 480/400 is itself a larger 6:5 ratio. Instead, it compromises on a 449-line frame (instead of the expected 450), with the back porch extended to 34 lines, and the front porch to 13, with an unaltered 2-line sync pulse - and the active image taking up 89% of the total scan period rather than 91%. The monitor is triggered into synchronising at the higher frame scan rate (and, with digital displays such as LCDs, the higher horizontal pixel density) by use of a positive-polarity VSync pulse, versus the negative pulse of 60 Hz mode.



Typical uses of selected modes[edit]

640x400 @ 70 Hz is traditionally the video mode used for booting most VGA-compatible x86 personal computers.[11] which show a graphical boot screen (text-mode boot uses 720x400 @ 70 Hz).

640x480 @ 60 Hz is the default Windows graphics mode (usually with 16 colors),[11] up to Windows 2000. It remains an option in XP and later versions via the boot menu "low resolution video" option and per-application compatibility mode settings.

320x200 @ 70 Hz is the most common mode for VGA-era PC games, using exactly the same timings as the 640x400 mode, but halving the pixel rate (and, in 256 colour mode, doubling the bit-depth of each pixel) and displaying each line of pixels twice.

The actual timings vary slightly from the defined standard. For example, for 640x480 @ 60 Hz, a 25.17 µs active video time with a pixel frequency of 25.174 MHz gives 634 pixels, rather than the expected 640.


A D-SUB connector (commonly known as VGA connector)
See also: VGA connector

VGA uses a DE-15 connector. This connector fits on the mounting tab of an ISA expansion card.

VGA BNC connectors

An alternative method of connecting VGA devices that maintains very high signal quality is the BNC connector, typically used as a group of five connectors, one each for Red, Green, Blue, Horizontal Sync, and Vertical Sync. With BNC, the coaxial wires are fully shielded end-to-end and through the interconnect so that no crosstalk or external interference is possible.

However, BNC connectors are relatively large compared to the DE 15, and some attention is needed to make sure each cable goes to the correct socket. Additionally, extra signal lines such as +5 V, DDC, and DDC2 are not supported using BNC connectors.

Standard text modes[edit]


Like EGA, VGA supports having up to 512 different simultaneous characters on screen, albeit in only 8 foreground colors, by rededicating one color bit as the highest bit of the character number. The glyphs on 80x25 mode are normally made of 9x16 pixels. Users may define their own character set by loading a custom font onto the card. As character data is only eight bits wide on VGA, just as on all of its predecessors, there is usually a blank pixel column between any two horizontally adjacent glyphs. However, some characters are normally made nine bits wide by repeating their last column instead of inserting a blank column, especially those defining horizontally connected IBM box-drawing characters. This functionality is hard-wired to the character numbers C0hex to DFhex, where all horizontally connecting characters are found in Codepage 437 and its most common derivatives. The same column-repeating trick was already used on the older MDA hardware with its 9x14 pixel glyphs, but on VGA it can be turned off when loading a font in which those character numbers do not represent box drawing characters.[12][13]

Monochrome modes[edit]


Addressing details[edit]

Examples of VGA images in 640x480x16 (top) and 320x200x256 modes (bottom). Dithering is used to mask color limitations.


  • 0xA0000 for EGA/VGA graphics modes (64 KB)
  • 0xB0000 for monochrome text mode (32 KB)


Color palette[edit]

VGA 256 default color palette


In addition to the extended palette, VGA adds a second level of indirection: Unlike EGA's fixed 64-color palette, each of VGA's 256 palette entries could be assigned an arbitrary color value through the VGA DAC. The EGA BIOS only allowed two bits per channel to represent each entry, while VGA allowed six bits to represent the intensity of each of the three primaries (red, blue and green). This provided 64 different intensity levels for each of red, green and blue, resulting in 262,144 possible colors, any 256 of which could be assigned to the palette (and in turn out of those 256, any 16 of them could be displayed in CGA video modes).



Programming tricks[edit]


  • The use of multiple video pages in hardware allowed the programmer to perform double buffering, triple buffering or split screens, which, while available in VGA's 320x200 16-color mode, was not possible using stock Mode 13h.
  • Most particularly, several higher, arbitrary-resolution display modes were possible, all the way up to the programmable limit of 800x600 with 16 colors (or 400x600 with 256 colors), as well as other custom modes using unusual combinations of horizontal and vertical pixel counts in either color mode.

Software such as Fractint, Xlib and ColoRIX also supported tweaked 256-color modes on standard adaptors using freely-combinable widths of 256, 320, and 360 pixels and heights of 200, 240 and 256 (or 400, 480 and 512) lines, extending still further to 384 or 400 pixel columns and 576 or 600 (or 288, 300) lines in rare cases, as well as other arbitrary sizes in-between. However, 320x240 was the best known and most-frequently used, as it offered a standard 40-column resolution and 4:3 aspect ratio with square pixels - so much so that "Mode X" itself became generally synonymous with "320x240x8".

The highest resolution modes were only used in special, opt-in cases rather than as standard, especially where high line counts were involved. Standard VGA monitors had a fixed line scan (H-scan) rate - "multisync" monitors being, at the time, expensive exotica - and so the vertical/frame (V-scan) refresh rate had to be reduced in order to accommodate them, which increased visible flicker and thus eye strain. For example, the highest 800x600 mode, being otherwise based off the matching SVGA resolution (with 628 total lines), reduced the refresh rate from 60 Hz to about 50 Hz (and 832x624, the theoretical maximum resolution achievable with 256kb at 16 colors, would have reduced it to about 48 Hz, barely higher than the rate at which XGA monitors employed a double-frequency interlacing technique to mitigate full-frame flicker).

These modes were also outright incompatible with some monitors, producing display problems such as picture detail disappearing into overscan (especially in the horizontal dimension), vertical roll, poor horizontal sync or even a complete lack of picture depending on the exact mode attempted. Due to these potential issues, most VGA tweaks used in commercial products were limited to more standards-compliant, "monitor-safe" combinations, such as 320x240 (square pixels, three video pages, 60 Hz), 320x400 (double resolution, two video pages, 70 Hz), and 360x480 (highest resolution compatible with both standard VGA monitors and cards, one video page, 60 Hz) in 256 colors, or double the H-rez in 16-color mode.

Hardware manufacturers[edit]

Several companies produced VGA compatible graphic board models.[15]

See also[edit]


  1. ^ Ken Polsson. "Chronology of IBM Personal Computers". Retrieved 2015-01-28. 
  2. ^ Hinner, Martin. "VGA Timings". Retrieved 7 November 2012. 
  3. ^ Abrash, Michael. "How 360x480 in 256 color mode works". Graphics Programming Black Book. Retrieved 7 November 2012. 
  4. ^ "VGA 640x350 Signal timing". 
  5. ^ a b PS/2 Video Subsystem Technical Reference Manual 1992
  6. ^ "VGA Signal timings". 
  7. ^ "VGA Electrical FAQ". 
  8. ^ "Javier Valcarce VGA timings page". 
  11. ^ a b " - Circuits".  090425
  12. ^ J. D. Neal (1998). "Hardware Level VGA and SVGA Video Programming Information". FreeVGA Project. Retrieved 2010-11-18. 
  13. ^ Innocenti Maresin. "VGA console basics and Linux console-tools, VGA-compatible text screen features and restrictions". Retrieved 2010-11-18. 
  14. ^ Norton, Peter and Wilton, Richard (1988). The new Peter Norton programmer's guide to the IBM PC and PS/2.
  15. ^

Further reading[edit]

External links[edit]