Mini GPU
Build a minimal GPU that combines parallel processing with VGA output—render simple graphics using hardware acceleration.
Overview
This project combines the parallel processing unit with VGA output to create a minimal GPU. The GPU can execute simple graphics operations like filling rectangles, drawing lines, or copying blocks of pixels—all accelerated by parallel hardware. This is how early 2D graphics accelerators worked before 3D GPUs became common.
Components Needed
- 4x SN74LS181 IC (ALU)
- 4x SN74HC374 IC (Register)
- 4x SN74HC393 IC (Counter)
- 3x SN74HC138 IC (Decoder)
- 2x SRAM (6116 or similar)
- 1x VGA components
- manyx Wires
Instructions
Design the Architecture
Plan your mini GPU: command registers (operation, coordinates, color), parallel pixel processors, frame buffer memory, and VGA output stage. Define simple commands like FILL, LINE, COPY.
Build Command Registers
Create registers to hold: X1, Y1, X2, Y2 coordinates, color value, and operation code. These define what graphics operation to perform and where.
Implement Rectangle Fill
Build hardware that steps through X and Y coordinates within the defined rectangle, writing the color value to each frame buffer location. Use counters for X/Y and comparators to detect edges.
Add Parallel Pixel Processing
Use multiple ALU channels to process several pixels per clock. For example, fill 4 horizontal pixels at once by having 4 parallel write paths to the frame buffer.
Connect to VGA Output
Wire the frame buffer to the VGA controller. The VGA system continuously reads the frame buffer while your GPU writes graphics commands to it.
Test Graphics Commands
Load coordinates and color into command registers. Trigger the fill operation. Watch as the rectangle appears on the monitor, drawn by your hardware!
Challenges
- Implement Bresenham's line algorithm in hardware
- Add character/font rendering capability
- Build a simple sprite engine
- Create a blitter for block memory copies
- Add transparency/alpha blending