Color Graphics Adapter
The Color Graphics Adapter (CGA), introduced by IBM in August 1981 as an optional expansion card for the original IBM Personal Computer (model 5150), was the first color display standard for the platform, enabling both alphanumeric text and basic pixel-based graphics in color or monochrome.[1][2] It represented a significant advancement over the contemporaneous Monochrome Display and Printer Adapter (MDA) by supporting vivid color output on compatible monitors or televisions, thus broadening the PC's appeal for business, gaming, and educational applications during the early personal computing era.[3][2] The CGA card utilized a Motorola 6845 cathode-ray tube (CRT) controller chip, 16 KB of dual-ported video memory mapped to address B8000h, and an 8 KB ROM character generator supporting 256 characters in 8x8 pixel matrices, allowing for flexible display configurations.[2] It offered four primary text modes—40×25 or 80×25 characters in either black-and-white or color (with 16 foreground and 8 background colors and blinking attributes; underline and reverse video effects were typically implemented in software)—and graphics modes including 320×200 pixels with 4 colors selected from a palette of 16 (with palette variants that could appear monochrome on certain outputs) and 640×200 pixels with 2 colors.[2] These modes operated at a non-interlaced 60 Hz refresh rate with a video bandwidth of up to 14 MHz, and the adapter's 16 KB memory could store up to eight 40×25 text screens or four 80×25 screens, facilitating smooth switching between displays.[2] Physically, the CGA installed in one of the IBM PC's five expansion slots and featured multiple output options, including a 9-pin D-subminiature (DE-9) connector for direct RGBI (Red, Green, Blue, Intensity) drive to color monitors, a phono jack for composite video output, and an auxiliary edge connector for an optional RF modulator to connect to standard televisions, along with a light pen interface.[2] Programming access was provided via I/O ports 3D0h–3DFh (or 3B0h–3BFh in monochrome emulation), interrupt level IRQ2, and BIOS routines starting at offset F000:FE6Eh, with user-definable character sets extendable through interrupt 1Fh.[2] Despite its limitations—such as the restricted color palette and low resolution, which later prompted successors like the Enhanced Graphics Adapter (EGA) in 1984—the CGA established foundational video standards for IBM-compatible PCs, influencing software development and hardware compatibility for over a decade.[3][2]History and Development
Release and Context
The Color Graphics Adapter (CGA) was introduced by IBM in 1981 as an optional expansion card for the newly launched IBM Personal Computer (model 5150), marking the company's first foray into color graphics for personal computing. Priced at $300, the CGA was designed to plug into one of the PC's expansion slots, providing users with an affordable upgrade path from monochrome displays to support color output for both text and basic graphics applications. This release coincided directly with the IBM PC's debut on August 12, 1981, positioning the system as a versatile platform for business and emerging home computing needs.[4][5] In the early personal computer market of the late 1970s and early 1980s, the IBM PC and its CGA option entered a landscape dominated by systems like the Apple II, which had offered color graphics since its 1977 launch and appealed strongly to hobbyists, educators, and gamers through vibrant visuals in software such as games and educational tools. IBM aimed to bridge the gap between professional business computing—previously limited to text-only monochrome displays like the Monochrome Display Adapter (MDA)—and the colorful, interactive experiences that drove consumer adoption in the home market. The CGA's inclusion addressed this by enabling color for text modes and simple graphics, facilitating applications in data visualization for business users while opening doors for entertainment software that could leverage limited color palettes.[6] Key to the CGA's functionality was its reliance on the Motorola 6845 cathode-ray tube controller for timing and display synchronization, allowing the IBM PC to output to compatible color monitors and thus expand its appeal beyond corporate environments.[4] This strategic release helped the IBM PC gain traction in a competitive field, eventually standardizing color graphics as an essential feature in the evolving PC ecosystem.Design Objectives
The IBM Color/Graphics Monitor Adapter (CGA) was engineered primarily to introduce affordable color display capabilities to the IBM Personal Computer family, extending beyond the monochrome limitations of prior systems while targeting business environments that benefited from enhanced visual differentiation in text-based applications.[7] This design emphasized cost-effectiveness for professional users, enabling features like color attributes to improve readability and data organization in productivity software, alongside basic support for emerging gaming applications to broaden the PC's appeal.[7] A key compromise in the CGA's development was restricting the maximum resolution to 640×200 pixels, which allowed the adapter to repurpose existing television broadcasting standards such as NTSC and PAL, thereby minimizing hardware complexity and production costs compared to more advanced, higher-resolution systems of the era.[7] This approach not only reduced expenses but also facilitated compatibility with readily available consumer display equipment, making color graphics accessible without requiring specialized, expensive monitors.[7] The CGA's objectives were heavily influenced by IBM's established monochrome heritage, particularly the Monochrome Display Adapter (MDA), with the goal of ensuring seamless backward compatibility for text modes to support legacy business software and ease the transition for users accustomed to high-contrast monochrome displays.[7] By building directly on the MDA foundation, the design maintained essential text functionality while layering in color support via interfaces like RGBI, striking a balance between innovation and reliability in early personal computing ecosystems.[7]Hardware Design
Technical Architecture
The Color Graphics Adapter (CGA) relies on a Motorola 6845 CRT controller as its primary video address generator, which handles raster scan operations, video timing signals, memory addressing, display refresh, cursor positioning, and synchronization with the display device.[2] This chip interfaces with 16 KB of dual-ported dynamic random-access memory (DRAM) for video storage, accessible by the CPU starting at address B8000h, enabling simultaneous access by the processor and the display circuitry to store and retrieve pixel, character, font, and attribute data.[2] Complementary TTL logic circuits form the composite color generator, which processes memory contents to produce baseband video color signals, ensuring efficient generation of analog output from digital data.[2] The CGA's 16 KB address space is organized into segmented pages to support distinct data types: dedicated regions for character attributes, a fixed ROM-based font generator providing 256 character patterns, and allocatable areas for pixel bitmaps or additional attribute storage.[2] This mapping allows for a 16 KB regeneration buffer on the color card, with the 6845 controller dynamically addressing memory during scan lines to fetch and assemble display elements without interrupting CPU operations.[2] The dual-port design resolves contention between CPU writes and video readout through prioritized arbitration logic, maintaining stable refresh rates.[2] Clocking is derived from a 14.31818 MHz master oscillator, which is divided to generate key timing signals: division by 3 yields the 4.77 MHz processor clock, while division by 4 produces the 3.58 MHz color burst subcarrier for NTSC compatibility.[2] For pixel-level timing, the clock is further divided to support bandwidths such as 7 MHz, 14 MHz in graphics operations, with the 6845 using these to control horizontal and vertical scan rates via programmable registers.[2] This hierarchical clock distribution ensures precise synchronization across the TTL-based timing generator, memory controller, and color encoder, forming the operational backbone of the adapter's display pipeline.[2]Connector Specifications
The Color Graphics Adapter (CGA) utilized a DE-9 (also known as DB-9) connector for its primary RGBI video output, providing a digital interface compatible with dedicated color monitors such as the IBM 5153. This 9-pin D-subminiature female connector on the card carried TTL-level signals for red, green, blue, intensity, horizontal sync, vertical sync, and grounds, enabling direct-drive display of the CGA's 16-color palette without external modulation.[8][9][10] The pin assignments for the DE-9 connector are as follows:| Pin | Signal | Description |
|---|---|---|
| 1 | GND | Ground |
| 2 | GND | Ground |
| 3 | R | Red (TTL) |
| 4 | G | Green (TTL) |
| 5 | B | Blue (TTL) |
| 6 | I | Intensity (TTL) |
| 7 | RES | Reserved |
| 8 | HSYNC | Horizontal Sync (TTL) |
| 9 | VSYNC | Vertical Sync (TTL) |
Display Capabilities
Output Interfaces
The Color Graphics Adapter (CGA) features two primary output interfaces designed to accommodate both dedicated computer monitors and consumer television sets, enabling versatile display options for early IBM Personal Computer systems. The RGBI digital interface provides a high-fidelity digital video signal optimized for color monitors, while the composite video interface offers compatibility with standard televisions and composite monitors through an analog signal. These interfaces allow the CGA to support a range of text and graphics modes, with color reproduction varying based on the connected display type.[13] The RGBI digital interface utilizes a 9-pin D-shell connector to deliver TTL-level signals for red, green, blue, and intensity (RGBI), supporting a 4-bit color depth that enables up to 16 discrete colors from a predefined palette. This interface is intended for direct connection to compatible color monitors, such as the IBM 5153 Color Display, where it produces sharp, artifact-free imagery in modes like 320×200 pixels with four colors or 640×200 pixels in monochrome. The digital nature of the RGBI output ensures precise color and resolution without the signal degradation common in analog connections, making it suitable for professional and technical applications requiring accurate visual representation.[13][14] In contrast, the composite video interface employs a standard female RCA phono jack to output a baseband analog signal compatible with NTSC televisions or composite monitors, facilitating broader consumer accessibility by allowing connection to home entertainment devices often requiring an RF modulator for channel tuning. This interface supports the same display modes as RGBI but encodes color information in a manner that can introduce visual artifacts and reduced color fidelity due to the limitations of composite signal transmission. While capable of displaying color in text and low-to-medium resolution graphics modes, the composite output prioritizes compatibility over precision, resulting in softer imagery and potential color bleeding compared to the digital alternative.[13][14] The CGA card supports simultaneous output to both the RGBI and composite interfaces from a single adapter, allowing users to connect multiple displays concurrently for demonstration or multi-viewing purposes. However, this dual-output capability shares the card's processing and memory resources, imposing limitations such as synchronized signal generation and no independent mode selection per interface, which can constrain performance in demanding scenarios. This feature enhances the adapter's flexibility in mixed environments, such as educational or small office settings where both high-quality monitor viewing and television projection are desired.[14]Color Palette Basics
The Color Graphics Adapter (CGA) employs a 4-bit color indexing system that supports 16 distinct colors, numbered from 0 to 15, derived from combinations of red, green, blue, and intensity components.[15] These colors are fixed and predefined, allowing selection through memory attributes in text modes or pixel values in graphics modes.[16] The palette includes:| Index | Color Name | RGBI Bits (I R G B) |
|---|---|---|
| 0 | Black | 0000 |
| 1 | Blue | 0001 |
| 2 | Green | 0010 |
| 3 | Cyan | 0011 |
| 4 | Red | 0100 |
| 5 | Magenta | 0101 |
| 6 | Brown | 0110 |
| 7 | Light Gray | 0111 |
| 8 | Dark Gray | 1000 |
| 9 | Bright Blue | 1001 |
| 10 | Bright Green | 1010 |
| 11 | Bright Cyan | 1011 |
| 12 | Bright Red | 1100 |
| 13 | Bright Magenta | 1101 |
| 14 | Yellow | 1110 |
| 15 | White | 1111 |
Text Modes
40 × 25 Character Mode
The 40 × 25 character mode of the Color Graphics Adapter (CGA) supports a text-based display consisting of 40 columns and 25 rows of characters, with each character occupying an 8 × 8 pixel cell to yield an effective pixel resolution of 320 × 200.[9][17] This configuration draws from a built-in 8 × 8 character generator ROM containing 256 alphanumeric and graphic symbols, where the font is typically rendered in a 7 × 7 double-dotted pattern within the cell for improved visibility on low-resolution displays.[14] It corresponds to BIOS modes 0 (color) and 1 (black-and-white).[2] This mode requires 2 KB of video RAM from the CGA's 16 KB total, allocated as 1,000 bytes for character codes and 1,000 bytes for associated color attributes, enabling efficient storage for the full screen buffer at base memory address B8000h.[9] The display timing is managed by the onboard Motorola MC6845 CRT controller, which uses a 14.318 MHz master oscillator divided to produce a 7.159 MHz pixel clock specifically for low-resolution operations like this mode, resulting in a non-interlaced vertical refresh rate of approximately 60 Hz.[17][18] Horizontal timing accommodates 40 characters plus border, with the character clock effectively at about 0.895 MHz to support the reduced density compared to higher-column modes.[18] A low-resolution text mode available on IBM PC systems, selectable via BIOS INT 10h function 00h with AL=00h for color or AL=01h for black-and-white; the power-on default is 40×25 black-and-white even on CGA. It provides clear readability on CGA-compatible RGB monitors or, via the composite video output, on standard home television sets where its lower horizontal bandwidth demands ensured better synchronization and compatibility without the color bleeding issues seen in denser layouts.[9][14] Color application in this mode relies on per-character attributes for foreground and background selection from a 16-color palette, with optional blinking, though detailed attribute handling is mode-agnostic across text resolutions.[14]80 × 25 Character Mode
The 80 × 25 character mode of the Color Graphics Adapter (CGA) provides a text resolution of 80 columns by 25 rows, corresponding to a pixel resolution of 640 × 200.[2] Each character occupies an 8 × 8 pixel cell, with the glyph typically rendered in a 7 × 7 pixel pattern and one scanline reserved for descenders in lowercase letters.[2] This mode utilizes 4 KB of video RAM per display page (calculated as 80 columns × 25 rows × 2 bytes per character, where one byte holds the ASCII code and the other the attribute byte), with the CGA's total 16 KB supporting up to four such pages (4 KB each), accessible starting at memory address B800:0000h.[2][9] It corresponds to BIOS modes 2 (color) and 3 (black-and-white).[2] The display operates at a 60 Hz vertical refresh rate in non-interlaced fashion, with a horizontal scan frequency of approximately 15.75 kHz, enabling compatibility with composite video monitors and RGB displays.[2] Horizontal timing is finer than in lower-density modes, with the Motorola MC6845 cathode-ray tube controller (CRTC) programmed to generate 16 character clock cycles per column (eight visible pixels plus blanking intervals), supporting the denser 640-pixel width without exceeding standard television signal constraints.[2] As the primary text mode for professional and productivity applications on early IBM PCs, the 80 × 25 configuration served as the default for MS-DOS command-line interfaces, BIOS setup screens, and software such as word processors and spreadsheets, offering sufficient density for tabular data and code editing while integrating with the shared 16-color attribute system for foreground/background and blinking effects.[2] This emphasis on high-density text distinguished it from coarser modes suited to television viewing, prioritizing readability on dedicated monitors for business use.[2]Text Mode Color Attributes
In CGA text modes, each screen character is defined by a pair of bytes in video memory: the first byte specifies the character code from the 256-entry ROM font, while the second byte is the attribute byte that determines the visual styling of that character.[9] The attribute byte consists of 8 bits with the following structure:| Bit | Function | Description |
|---|---|---|
| 7 | Blink/Background Intensity | When the blink enable bit (bit 5) in the CGA mode control register is set (standard for text modes), bit 7 enables blinking for the character; otherwise, it sets background intensity for brighter backgrounds.[9] |
| 6 | Background Red | Sets the red component of the background color (1 = red enabled).[9] |
| 5 | Background Green | Sets the green component of the background color (1 = green enabled).[9] |
| 4 | Background Blue | Sets the blue component of the background color (1 = blue enabled).[9] |
| 3 | Foreground Intensity | Enables high-intensity (bright) mode for the foreground color (1 = bright).[9] |
| 2 | Foreground Red | Sets the red component of the foreground color (1 = red enabled).[9] |
| 1 | Foreground Green | Sets the green component of the foreground color (1 = green enabled).[9] |
| 0 | Foreground Blue | Sets the blue component of the foreground color (1 = blue enabled).[9] |