Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VHDL VGA Controller – Interactive Shapes

An FPGA project that implements a VGA controller capable of displaying 8 different shapes in 8 colors, with real-time movement and speed control using board buttons and switches.
Developed on a Digilent Nexys A7 FPGA.


Features

  • VGA output: 640×480 @ 60Hz (25 MHz pixel clock).
  • 8 selectable shapes (via 3-bit switch).
  • 8 selectable colors (via 3-bit RGB switches).
  • Interactive movement: up, down, left, right, reset.
  • Two movement speeds (selectable).
  • Debounced button inputs for stable interaction.
  • Fully modular VHDL design: reusable components.

Project Structure

  • main.vhd – Top-level entity (ties all modules together).
  • SYNC.vhd – VGA timing generator (HSYNC, VSYNC, (x, y) counters).
  • FREQ_DIV.vhd – Frequency divider (100 MHz → 25 MHz).
  • Debouncer.vhd – Synchronizes button input with pixel clock.
  • shape.vhd – Shape selector, color mux, drawing equations.
  • SQUARE.vhd – Primitive example of a basic shape.

User Controls

  • Buttons:
    • UP / DOWN / LEFT / RIGHT – move shape.
    • RESET – reset position to screen center.
  • Switches:
    • SW[2:0] – select shape (0–7).
    • SW[5:3] – select color (RGB palette).
    • SW[x] – speed selection (slow/fast).

How Shapes Are Calculated

Shapes are rendered using equations on pixel coordinates (x, y) and shape center (cx, cy):

  • Square/Rectangle: check pixel inside bounding box.
  • Circle: (x - cx)² + (y - cy)² ≤ r².
  • Triangle: edge functions (all signs equal).
  • Other shapes: added by equations in shape.vhd.

Movement updates (cx, cy) registers per frame based on debounced button inputs and selected speed.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages