Enhanced Graphics Adapter

From Wikipedia, the free encyclopedia
Jump to: navigation, search
Enhanced Graphics Adapter
Release date October 1984; 33 years ago (October 1984)[1]
Architecture Motorola 6845, Chips and Technologies
Entry-level IBM EGA card, Chips and Technologies, ATI EGA Wonder
Mid-range ATI EGA Wonder 800
High-end ATI EGA Wonder 800+
Predecessor Monochrome Display Adapter, Color Graphics Adapter
Successor Video Graphics Array
IBM EGA card – 64 KB version
A non-IBM EGA card

The Enhanced Graphics Adapter (EGA) is a historical IBM PC computer display standard from 1984 that superseded and exceeded the capabilities of the CGA standard introduced with the original IBM PC, and was itself superseded by the VGA standard in 1987.


EGA was introduced in October 1984 by IBM,[2][3] shortly after (but not exclusively for) its new PC/AT.

The EGA standard was made obsolete by the introduction in 1987 of MCGA and VGA with the PS/2 computer line.[4]

Shortly before the introduction of VGA, Genoa Systems introduced a half-size graphics card built around a proprietary chip set, which they called Super EGA (later cards supporting an extended version of the VGA were similarly named Super VGA).[5]


EGA produces a display of sixteen simultaneous colors from a palette of sixty-four, at a resolution of up to 640×350 pixels. The EGA card includes a 16 KB ROM to extend the system BIOS for additional graphics functions, and includes a custom CRT controller (CRTC) that has limited backward compatibility with the Motorola MC6845 chip used to generate video timing signals in earlier IBM PC graphics controllers.[6] The EGA CRTC can support all of the modes of the IBM MDA and CGA adapters, partially through specific mode options intended for this purpose, but even in its maximum-compatibility mode configuration it is not register-compatible with an MC6845, so programs that directly program the 6845 to set up video modes will fail on an EGA. When an MDA or CGA mode is set up on the EGA by calling the BIOS, then the raster timing, video memory layout, data format, and some other low-level hardware details such as cursor control are identical to those aspects of the operation of an MDA or CGA, providing a high degree of direct software and hardware (e.g. CRT monitor) compatibility.

In the 640×350 high resolution mode, each of the sixteen colors can be selected from a palette comprising all possible combinations of two bits per pixel each for red, green and blue, allowing four levels of intensity for each primary color and sixty-four possible colors overall. EGA also includes full sixteen-color versions of the CGA 640×200 and 320×200 graphics modes; only the sixteen CGA/RGBI colors are available in these modes[citation needed]. EGA four-bit (sixteen colors) graphic modes are also notable for a sophisticated use of bit planes and mask registers[7] together with CPU bitwise operations,[8] which constitutes an early graphics accelerator inherited by VGA and numerous compatible hardware.

EGA is dual-sync; it scans at 21.8 kHz when 350-line modes are used and 15.7 kHz when 200-line modes are used. The original CGA modes are also present, though EGA is not 100% hardware compatible with CGA, as was mentioned. EGA can drive an MDA monitor by a special setting of switches on the board (or by direct hardware programming—the switches only affect the operation of the BIOS); only 640×350 high-resolution monochrome graphics and the standard MDA text mode are available in this mode. In summary, the EGA supports all BIOS-standard video modes of all previous IBM PC video adapters except the enhanced CGA of the IBM PCjr. The standard MDA and CGA modes are supported 100% at the BIOS level, with additional support in some details at the hardware register level. The three enhanced graphics modes of the PCjr—160x200 16-color, 320x200 16-color, and 640x200 4-color—are not supported by the EGA, and IBM lists their BIOS video mode numbers (08, 09, and 0A hexadecimal) as reserved. However, the EGA can generate displays equivalent to these modes using different modes (with different video memory formats, requiring different programming). It should be noted specifically that the EGA 320x200 16-color mode is not the same as nor compatible with the PCjr mode of the same format: the PCjr mode uses 4-bit pixels that are packed 2 pixels to a byte (one in the low nibble, and one in the high nibble) in a 32 KB video buffer that is split into 4 banks of interleaved lines (similar to the two interleaved banks in CGA graphics modes), whereas the EGA mode uses the linear bit-plane format that is native to the EGA.

EGA cards use the PC ISA bus and were available starting in both eight- and sixteen-bit versions. The original IBM EGA card had 64 KB of onboard RAM and required a daughter-board to add an additional 64 KB (cards with 64 KB are limited to four colors when 640×350 mode is used). All third-party cards came with 128 KB already installed and some even 256 KB, allowing multiple graphics pages, multiple text-mode character sets, and large scrolling displays. A few third-party EGA clones (notably the ATI Technologies and Paradise boards) feature a range of extended graphics modes (e.g., 640×400, 640×480 and 720×540), as well as automatic monitor type detection, and sometimes also a special 400-line interlace mode for use on CGA monitors.

Front and rear views of the TVM MD-3 CRT monitor (EGA / pre-VGA era). Note the DE-9 connector, cryptic mode switch, contrast and brightness controls at front, and the V-Size (controls vertical scaling) and V-Hold (controls signal to CRT refresh-rate synchronization) knobs at rear.

Output capabilities[edit]

Sample of text mode characters with cursor
Simulated image as displayed using EGA 640×350×16, corrected for aspect ratio
Screenshot of the Arachne web browser using the 640×350 graphics mode. The screenshot contains 14 colors.

EGA supports:

  • 640×350 w/16 colors (from a 6 bit palette of 64 colors), pixel aspect ratio of 1:1.37.
  • 640×350 w/2 colors, pixel aspect ratio of 1:1.37.
  • 640×200 w/16 colors, pixel aspect ratio of 1:2.4.
  • 320×200 w/16 colors, pixel aspect ratio of 1:1.2.

Text modes:

  • 40×25 with 8×8 pixel font (effective resolution of 320×200)
  • 80×25 with 8×8 pixel font (effective resolution of 640×200)
  • 80×25 with 8×14 pixel font (effective resolution of 640×350)
  • 80×43 with 8×8 pixel font (effective resolution of 640×344)

Extended graphics modes of third party boards:

  • 640×400
  • 640×480
  • 720×540

Color palette[edit]

EGA color table
The full 64-color EGA palette
Screen color test of EGA 16 colors
Screen color test of EGA in CGA 16-color palette

The EGA palette allows all 16 CGA colors to be used simultaneously, and it allows substitution of each of these colors with any one from a total of 64 colors (two bits each for red, green and blue). This also allows the CGA's alternate brown color to be used without any additional display hardware. The later VGA standard built on this by allowing each of the 64 colors to be further customized. The extended color palette cannot be used in 200-line modes.

When selecting a color from the EGA palette, two bits are used for the red, green and blue channels. This allows each channel a value of 0, 1, 2 or 3. To select the color magenta, the red and blue values would be medium intensity (2, or 10 in binary) and the green value would be off (0). When calculating the intended value in the 64-color EGA palette, the binary number of the intended entry is of the form "rgbRGB" where a lowercase letter is the least significant bit of the channel intensity and an uppercase letter is the most significant bit. For magenta, the most significant bit in the red and blue values is a 1, so the uppercase R and B placeholders would become 1. All other digits are zeros, giving the binary number 000101 for the color magenta. This is 5 in decimal, so setting a palette entry to 5 would result in it being set to magenta. All the color values for the default colors are listed in the table on the right.

Default EGA 16-color palette (set up to match the standard CGA colors)
Number Color Hexadecimal rgbRGB Decimal
0 Black #000000 000000 0
1 Blue #0000AA 000001 1
2 Green #00AA00 000010 2
3 Cyan #00AAAA 000011 3
4 Red #AA0000 000100 4
5 Magenta #AA00AA 000101 5
6 Brown #AA5500 010100 20
7 White / light gray #AAAAAA 000111 7
8 Dark gray / bright black #555555 111000 56
9 Bright blue #5555FF 111001 57
10 Bright green #55FF55 111010 58
11 Bright cyan #55FFFF 111011 59
12 Bright red #FF5555 111100 60
13 Bright magenta #FF55FF 111101 61
14 Bright yellow #FFFF55 111110 62
15 Bright white #FFFFFF 111111 63


The EGA uses a female nine-pin D-subminiature (DE-9) connector which looks identical to the CGA connector. The hardware signal interface, including the pin configuration, is largely compatible with CGA. The differences are in the re-purposing of three pins for the EGA's secondary RGB signals: the CGA "Intensity" pin (pin six) has been changed to "Secondary Green (Intensity)"; the second ground of CGA (pin two) has been changed to "Secondary Red (Intensity)", and pin seven (Reserved on the CGA) is now used for "Secondary Blue (Intensity)". If the EGA is operated in modes having the same scan rates as CGA, a connected CGA monitor should operate correctly, though if the monitor connects pin two to ground, the shorting of the EGA's secondary red output to ground could conceivably damage the EGA adapter. Similarly, if the CGA monitor is wired with pin two as its sole ground (which is poor design), it will not work with the EGA, though it will work with a CGA. Finally, because of the use of the CGA's intensity pin as secondary green, on a CGA monitor connected to an EGA, all CGA colors will display correctly, but all other EGA colors will incorrectly display as the standard CGA color which has the same values for the g, R, G, and B bits (ignoring the r and b bits.) Conversely, an EGA monitor should work with a CGA adapter, but the secondary red signal will be grounded (always zero) and the secondary blue will be floating (unconnected), causing all high-intensity CGA colors except brown to display incorrectly, and all colors to potentially have a variable blue tint due to the indeterminate state of the unconnected secondary blue.

Almost all EGA cards have DIP switches on the back of the card to select the monitor type. If CGA is selected, the card will operate in 200-line mode and use 8x8 characters in text mode. 350-line modes cannot be accessed, nor any of the extended color palette. If EGA is selected, the card will operate in 350-line mode and use 8×14 text. When 200-line modes are set, it will sync down to 15 kHz. If MDA is selected, the card also uses 350 lines and 8×14 text, but the only graphics mode that can be accessed is 640×350×2.

The IBM 5154 EGA monitor has a special IBM 5153 CGA compatibility mode when operating with CGA sync signals, and it will automatically change to the CGA pinout to avoid all of the mentioned problems when operating in this mode.[9]

Memory mapping[edit]

EGA graphics modes are planar, as opposed to the interlaced CGA and Hercules modes. The video memory is divided into four pages (except 640×350×2, which has two pages), one for each component of the RGBI color space. Each bit represents one pixel. If a bit in the red page is enabled, but none of the equivalent bits in the other pages are, a red pixel will appear in that location on-screen. If all the other bits for that particular pixel were also enabled, it would become white, and so forth. The planes are 8 KB in size (200-line modes and 640×350 with two colors), 16 KB (640×350 with 64 KB video RAM), or 32 KB (640×350 with 128 KB video RAM) and reside at segment A000 in the CPU's address space. They are bank-switched and only one plane can be read from at once, although the programmer may set the control registers on the EGA card to select which planes are written to. Thus, it is possible to write to all of them at once even though just one plane can be read from at any given moment.

Color text and CGA modes reside in segment B800, and monochrome text at B000 for backwards compatibility.


Female DE-9 connector, on EGA (computer).
Pin numbers (looking at socket): top row is pins 1–5, bottom row is pins 6 to 9, both numbered from right to left in this illustration.

DE9 Diagram.svg

Pin assignments
Pin Name Function
1 GND Ground
2 SR Secondary Red (Intensity)
3 PR Primary Red
4 PG Primary Green
5 PB Primary Blue
6 SG Secondary Green (Intensity)
7 SB Secondary Blue (Intensity)
8 H Horizontal Sync
9 V Vertical Sync


Type Digital, TTL
Resolution H × V 640×350, other modes available
H-freq 15.7 or 21.8 kHz
V-freq 60 Hz
Colors 6-bit (64)


An inexpensive PC clone with EGA has better graphics than contemporary rivals Commodore 64 or Apple II, which before 1987 were more popular for games.[10] However it was very simple graphics compared to Amiga computer OCS, which can have up to 4096 colors in HAM mode. Commercial software began supporting EGA by 1986 and Sierra's King's Quest 3 was one of the earliest PC games to use it. Most software made up to 1991 can run in EGA, although the vast majority of commercial games used 320×200 with 16 colors for reasons of compatibility with CGA and Tandy and to support users who did not own a proper EGA monitor. The 350-line modes were mostly used by freeware/shareware games and application software, although SimCity is a notable example of a commercial game that runs in 640×350×16 mode.

See also[edit]


  1. ^ IBM Announcement Letter Number 184-114 dated September 10, 1984, http://www-01.ibm.com/common/ssi/ShowDoc.wss?docURL=/common/ssi/rep_ca/4/897/ENUS184-114/index.html&lang=en&request_locale=en
  2. ^ High-Resolution Standard Is Latest Step in DOS Graphics Evolution, InfoWorld, June 26, 1989, p. 48
  3. ^ News Briefs, Big Blue Turns Colors, InfoWorld, Oct. 8, 1984
  4. ^ Scott Mueller, Upgrading and Repairing PCs, Tenth Edition, Que,1998, 0-7897-1636-4, page 515
  5. ^ Hardware, Genoa Systems Ready to Ship $449 Half-Size Graphics Card, InfoWorld, February 23, 1987
  6. ^ Hart, Glenn A. (December 25, 1984). "IBM Sets a New Standard". PC Magazine. Ziff-Davis Publishing. 3 (25): 173. 
  7. ^ Complete Instructions to BLOAD and BSAVE EGA and VGA Screens, Microsoft
  8. ^ Abrash, Michael (2001). "Chapter 43: Bit-plane animation". Graphics Programming Black Book. Coriolis Group Books. p. 1342. ISBN 1-57610-174-6. Retrieved February 6, 2017. 
  9. ^ IBM Options and Adapters, Volume 1, "Enhanced Color Display", page 4: "When operating in Mode 1, the display maps the 4 input bits into 16 of the possible 64 colors as shown in the following chart." August 2nd, 1984.
  10. ^ Proctor, Bob (March 1988). "Titans of the Computer Gaming World / SSI". Computer Gaming World. p. 36. Retrieved 2 November 2013.