Technical
VGA Graphics Card on Breadboards
April 2023 - May 2023
A VGA graphics card on breadboards that draws the screen as 8×8 character cells — 256 glyphs, 12 KB of RAM, and a 256-color palette — letting a simple CPU drive a monitor without writing every pixel.
The Problem
I built this in senior year of high school as a continuation of understanding how computers and their peripherals work. Modern graphics cards let the CPU assign colors to every pixel — excellent picture quality, but 1920×1080 is 2,073,600 pixels. A simple graphics card would put all of that work on the CPU. Modern CPUs can handle it; a simple computer like those from the 1980s would take multiple seconds. I designed this card to attach to a similar computer. It needed a less demanding way to draw, taking a page out of retro computing.
How It Works
The card splits the monitor into 8×8 pixel characters. At any time, the CPU can assign one of 256 characters to one of the character slots on the screen, reducing the number of pixels that need to be drawn by a factor of 64. The card has 12 kilobytes of RAM (2 KB for the screen characters, 2 KB for the characters, 2 KB for the colors on screen, and 6 KB for the color palette). There can be only 256 unique characters on screen at a time — any of them can be changed, but only 256 total. Each character can have only two colors, a background and a foreground. Those are real limitations, but smart programming and pixel artistry can work around them.
Why Characters
A character-based card like this allows very fast manipulation of small parts of the screen. In Pong, the CPU only has to remove the ball and the moving paddle and draw them in their new positions. Programming is easier too: every time the score increases, the variable simply increases by one. Because the numbers are in order in character RAM, the program does not have to calculate which number to display — it just displays the next number in RAM.
A paint-like application I wrote in Python generates the characters and colors, then exports the palettes to a JSON file. When the program starts, it loads the characters and colors from those files. Because the card uses a color palette, the computer can set 256 unique colors, then assign a color to each character with a single byte. That lets the card display 256 out of 16,777,216 colors with only one byte.
What’s Next
I originally designed this graphics card to work with a custom 16-bit computer. After I built it, some problems turned up: it is very large, which creates a lot of instability because of all the wire. I want to add sprites that can be drawn anywhere on the screen over anything beneath them. This card is a project to learn from; I plan a new one that is smaller and has more functionality, built on PCBs to reduce the instability.