Video Graphics Array

From Wikipedia, the free encyclopedia

VGA redirects here. For the IATA airport code see Tirupati Airport

Video Graphics Array (VGA) is an analog computer display standard first marketed in 1987 by IBM. While it has been obsolete for some time except in the pocket pc market where it is becoming the new standard, it was the last graphical standard that the majority of manufacturers decided to follow, making it the lowest common denominator that all PC graphics hardware supports prior to a device-specific driver being loaded. For example, the Microsoft Windows splash screen appears while the machine is still operating in VGA mode, which is the reason that this screen always appears in reduced resolution and color depth.

The term VGA is often used to refer to a resolution of 640×480, regardless of the hardware that produces the picture. It may also refer to the 15-pin D-subminiature VGA connector which is still widely used to carry analog video signals of all resolutions.

VGA was officially superseded by IBM's XGA standard, but in reality it was superseded by numerous extensions to VGA made by clone manufacturers that came to be known as "Super VGA".

Contents

[edit] Technical details

VGA is referred to as an "array" instead of an "adapter" because it was implemented from the start as a single chip, replacing the Motorola 6845 and dozens of discrete logic chips covering a full-length ISA board that the MDA, CGA, and EGA used. This also allowed it to be placed directly on a PC's motherboard with a minimum of difficulty (it only required video memory, timing crystals and an external RAMDAC), and the first PS/2 models were equipped with VGA on the motherboard.

The VGA specifications are as follows:

  • 256 KiB Video RAM
  • 16-color and 256-color modes
  • 262144-value color palette (six bits each for red, green, and blue)
  • Selectable 25 MHz or 28 MHz master clock
  • Maximum of 720 horizontal pixels
  • Maximum of 480 lines
  • Refresh rates at up to 70 Hz
  • Planar mode: up to 16 colors (4 bit planes)
  • Packed-pixel mode: 256 colors (Mode 13h)
  • Hardware smooth scrolling support
  • Some "Raster Ops" support
  • Barrel shifter
  • Split screen support
  • Soft fonts

The VGA supports both All Points Addressable graphics modes, and alphanumeric text modes. Standard graphics modes are

  • 640×480 in 16 colors
  • 640×350 in 16 colors
  • 320×200 in 16 colors
  • 320×200 in 256 colors (Mode 13h)

As well as the standard modes, VGA can be configured to emulate many of the modes of its predecessors (EGA, CGA, and MDA).

[edit] Programming tricks

An undocumented but popular technique nicknamed Mode X (first coined by Michael Abrash) was used to make available programming techniques and graphics resolutions not possible in the standard Mode 13h. This was done by "unchaining" the 256 KiB VGA memory into four separate "planes", which would make all of VGA's 256 KiB of RAM available in 256-color modes. There was a trade-off for extra complexity and performance loss in some types of graphics operations, but this was mitigated by other operations becoming faster in certain situations:

  • Single-color polygon filling could be accelerated due to the ability to set four pixels with a single write to the hardware
  • The video adapter could assist in copying video RAM regions, which was sometimes faster than doing this with a slow CPU such as the 8088 or 80286
  • Several higher-resolution display modes were possible: at 16 colors, 704×528, 736×552, 768×576, and even 800×600 were possible. Software such as Xlib (a VGA graphics library for C in the early 1990s) and ColoRIX (a 256-color graphics program), also supported tweaked 256-color modes using many combinations of columns of 256, 320, and 360 pixels, and rows of 200, 240, 256, 400, and 480 lines (the upper limit being 640×400 which used almost every available byte of VGA's 256 KiB video ram). However, 320×240 was the best known and most-frequently used since it was a typical 4:3 aspect ratio resolution with square pixels.
  • The use of multiple video pages in hardware allowed the programmer to perform double buffering, which while available in all of VGA's 16-color modes, was not possible in Mode 13h.

However the monitor refresh rate had to be reduced to accommodate these modes, increasing eye-strain. They were also incompatible with some older monitors, producing display problems such as picture detail disappearing into overscan, flickering, vertical roll, and lack of horizontal sync depending on the mode being attempted. Because of this, most VGA tweaks used in commercial products were limited to "monitor-safe" combinations, such as 320×400 (double resolution, two video pages), 320×240 (square pixels), and 360x480 (highest resolution compatible with standard VGA monitors).

[edit] Text modes

Standard alphanumeric text modes for the VGA use 80×25 or 40×25 text cells. Each cell may choose from one of 16 available colors for its foreground and 8 colors for the background; the 8 background colors allowed are the ones without the high-intensity bit set. Each character may also be made to blink; all that are set to blink will blink in unison. The blinking option for the entire screen can be exchanged for the ability to choose the background color for each cell from among all 16 colors. All of these options are the same as those on the CGA adapter as introduced by IBM.

VGA adapters usually support both a monochrome and a color text mode, though the monochrome mode is almost never used. Black and white text on nearly all modern VGA adapters is drawn by using gray colored text on a black background in color mode. VGA monochrome monitors were sold (intended primarily for text applications), but most of them will work at least adequately with a VGA adapter in color mode.

In color text mode, each screen character is actually represented by two bytes. The lower, or character byte is the actual character for the current character set, and the higher, or attribute byte is a bitfield used to select various video attributes such as color, blinking, character set, and so forth. This byte-pair scheme is among the features that VGA inherited ultimately from CGA.

[edit] Addressing details

The video memory of the VGA is mapped to the PC's memory via a window in the range between 0xA0000 and 0xC0000 in the PC's real mode address space. Typically these are:

  • 0xA0000 for EGA/VGA graphics modes (64 KiB)
  • 0xB0000 for monochrome text mode (32 KiB)
  • 0xB8000 for color text mode and CGA-compatible graphics modes (32 KiB)

Due to the use of different address mappings for different modes it is possible to have a Monochrome Display Adapter and a color adapter such as the VGA, EGA, or CGA installed in one machine. At the beginning of the 1980s, this was used, for example, to display Lotus 1-2-3 spreadsheets in high-resolution text on a MDA display and associated graphics on a low-resolution CGA display. Later, many programmers used such a setup, with the monochrome card displaying debugging information while a program ran in graphics mode on the other card. Notably, Microsoft's CodeView debugger could work in a dual monitor setup to debug Windows. There were also DOS device drivers, usually named ox.sys, which implemented a serial interface simulation on the MDA display, and, for example, allowed the user to receive crash messages from debugging versions of Windows without using an actual serial terminal. It is also possible to use the "MODE MONO" command at the dos prompt to redirect the output to the monochrome display. When a Monochrome Display Adapter was not present you could include the 0xB000 - 0xB7FF memory space for programs. For example adding the line "DEVICE=EMM386.EXE I=B000-B7FF" would make this memory available to programs that you have loaded high.

[edit] Technology

It has been rumored that the Pixar Image Computer has been reverse engineered for IBM to have a superior graphics standard. Also, the success of VGA may explain why the Pixar Image Computer has failed to gain market momentum.

[edit] References

    [edit] Further reading

    Computer display standards Size comparison
    Video hardware Size comparison
    MDA | Hercules | CGA | EGA | VGA | MCGA | 8514 | XGA
    Display resolutions
    QVGA | VGA | SVGA | XGA | XGA+ | SXGA | SXGA+ | UXGA | QXGA | QSXGA | QUXGA | HXGA | HSXGA | HUXGA
    Widescreen variants
    WXGA | WSXGA/WXGA+ | WSXGA+ | WUXGA | WQXGA | WQSXGA | WHXGA | WHSXGA | WHUXGA | WQUXGA