Integrated CPU + GPU System

The ultimate project: combine your CPU and GPU into a complete graphics computer system with shared memory bus and command interface.

Overview

This is the capstone of capstones—a complete computer system with CPU, GPU, shared memory, and video output. The CPU runs programs that send commands to the GPU, which renders graphics to the display. You'll implement memory-mapped I/O for CPU-GPU communication, bus arbitration for shared memory access, and synchronization between the two processors. This is a real, functioning graphics computer built from basic logic!

Components Needed

  • 1x Complete CPU components
  • 1x Complete GPU components
  • 4x SN74HC245 IC (Bus Transceiver)
  • 2x SN74HC138 IC (Address Decoder)
  • 4x SRAM (6116 or larger)
  • 1x EEPROM (28C16 or larger)
  • 1x VGA components
  • very manyx Wires

Instructions

  1. Design the Memory Map

    Plan the address space: 0x000-0x0FF for CPU program ROM, 0x100-0x1FF for RAM, 0x200-0x2FF for GPU command registers, 0x300+ for frame buffer. The GPU command registers are how the CPU talks to the GPU.

  2. Build the Shared Bus

    Create a shared address and data bus. Use 74HC245 transceivers for bidirectional data flow. Use address decoders to enable the correct device based on address.

  3. Implement Bus Arbitration

    Build arbitration logic: CPU has priority by default. When GPU needs memory (for frame buffer access during rendering), it requests the bus. CPU pauses until GPU releases the bus.

  4. Create GPU Command Interface

    Add command registers accessible at specific addresses. CPU writes command, coordinates, and color, then writes to a "execute" register to trigger GPU operation.

  5. Add Status/Busy Flag

    GPU sets a "busy" flag while processing. CPU reads this flag to know when GPU is done. This prevents sending new commands while GPU is working.

  6. Write a Graphics Program

    Create a CPU program that: initializes the system, sends GPU commands to draw shapes, waits for completion, and repeats for animation. Program this into the EEPROM.

  7. Integrate and Debug

    Connect all subsystems. Use single-stepping to verify CPU-GPU communication. Watch the bus signals with a logic analyzer. Debug timing issues between the two processors.

  8. Run the Demo

    Load your graphics demo program. Power on and watch your creation: a complete computer system built from basic logic ICs, running software that renders graphics to a real monitor!

Challenges

  • Add interrupt capability for GPU-to-CPU signaling
  • Implement a command FIFO so CPU can queue multiple commands
  • Add keyboard or joystick input for interactivity
  • Create a simple game running on your computer
  • Expand to a more powerful CPU instruction set