From "Code"
🎧 Listen to Summary
Free 10-min PreviewVideo Displays and Keyboard Input Systems
Key Insight
The Cathode-Ray Tube (CRT), like a television, is a common computer output device. Its image is formed by a continuous light beam rapidly sweeping across the screen: from upper-left to right (scan line), then zipping back left (horizontal retrace), and from lower-right to upper-left (vertical retrace) after the last line, repeating 60 times per second (field rate) for American TV. This process uses an 'interlaced display,' where two fields (one with even, one with odd scan lines) combine to form a complete frame of 525 scan lines, with a horizontal scan rate of 15750 Hertz. For black and white displays, the video signal is straightforward: vertical sync pulses (0 volts for 400 microseconds) mark field beginnings, horizontal sync pulses (0 volts for 5 microseconds) mark scan line beginnings, and voltages between 0.5V (black) and 2V (white) indicate shades of gray. The television's 'bandwidth' (e.g., 4.2 MHz for American broadcast TV) limits how quickly the video signal can change between colors, thus limiting the horizontal detail.
To connect a video display to a computer, the image is conceptually divided into 'pixels' (picture elements). A 4.2 MHz bandwidth allows for approximately 533 pixels horizontally, but with retrace and hidden areas, about 320 useful pixels remain. Vertically, about 200 useful pixels are available after accounting for retrace and avoiding interlace for computer use, leading to a primitive resolution of 320x200 (64000 pixels). Video display adapters require RAM to store display contents. A text-only adapter might need 1 kilobyte of RAM to store 1000 7-bit ASCII characters (25 lines of 40 characters), using a ROM 'character generator' to convert ASCII codes into 8x8 pixel patterns. A graphics board, capable of drawing pictures, requires more RAM: 8KB for two colors (1 bit per pixel), 64KB for 256 gray shades (1 byte per pixel), or 192KB for full color (3 bytes per pixel). Computer monitors generally have higher bandwidth than televisions, allowing for higher resolutions like 25 lines of 80 characters (standard for the IBM PC in 1981).
A significant milestone in display resolution was the 640x480 standard introduced in 1987 by IBM's Personal System/2 and Apple's Macintosh II, which remains a minimum standard. This resolution adheres to the 4:3 'aspect ratio' (width-to-height ratio) established by Thomas Edison and William Kennedy Laurie Dickson around 1889 for motion pictures and used by television, ensuring 'square pixels' where horizontal and vertical lines of equal pixel count appear the same physical length. Modern video adapters support higher resolutions such as 800x600, 1024x768, and 1280x960. For keyboard input, each key is a simple switch. Keyboards generate 'scan codes' for each key press (e.g., a 4-bit code for a 16-key keyboard, generated by a counter, decoder, and data selector), which a program translates into ASCII codes or other actions. Keyboard interfaces typically include an 'interrupt signal' to notify the microprocessor of a key press, prompting the CPU to execute a dedicated program (e.g., an RST instruction) to handle the input.
📚 Continue Your Learning Journey — No Payment Required
Access the complete Code summary with audio narration, key takeaways, and actionable insights from Charles Petzold.