Start with a blinking LED. Not because it’s impressive, but because it gives you only a few things to debug: the clock, an output pin and the path from source code to a programmed board. Once you can make the LED blink at the rate you predicted, add a button. Then put a number on a display.

The ten projects below build on one another. Each tells you what to implement, how to tell if it works, and where to look if it doesn’t. Start in simulation if you don’t have a board yet; the LED, button and display logic don’t need real pins to be tested.

Before building · Projects 1–3: basics · Projects 4–7: interfaces · Projects 8–10: systems

Before the first project

The examples use a Digilent Basys 3 as a reference: its 100 MHz oscillator, switches, buttons, LEDs, four-digit display, VGA and USB-UART give you several ways to see what your logic is doing. Check your own board manual for equivalent connections; pin numbers and active levels don’t transfer between boards.

Keep a minimal known-good project with the clock and one LED assigned. Start each new design with a small testbench and use the right constraints for your board and revision. Digilent provides a Basys 3 reference manual and master constraints file. If the tools are new to you, open our FPGA build process guide before starting.

Projects 1–3: the clock, an input and a display

1. Blink an LED at one cycle per second

Use the 100 MHz clock and a counter that toggles the LED after every 50,000,000 ticks. That’s half a second on and half a second off. Counting from zero through 49,999,999 needs 26 bits. Keep the design on your board clock; a clock-enable pulse also lets you update other slow logic without creating another clock domain.

Check: In your testbench, set the threshold to five ticks and assert that each toggle is five rising edges apart. On the board, confirm the full on/off cycle takes about one second. Half the intended speed often means you counted a full period between toggles instead of a half-period.

2. Make a push button count once

Synchronize the asynchronous button level, then wait for it to stay stable before accepting a new state. Only then detect a press edge. The synchronizer and debouncer address different problems: one reduces metastability risk, the other rejects multiple transitions from contact bounce. Try 10 ms as a starting threshold, not a universal constant.

Check: Simulate a short burst of transitions, a sustained press, a bouncing release and a second press. Expect one pulse per accepted press and none on release. A one-cycle pulse must be consumed by a circuit that can see it; don’t send it into an unrelated slow clock domain without a suitable bridge.

3. Drive a four-digit seven-segment display

Build the number-to-segment decoder separately from the circuit that scans the digits. Try displaying 1234 rather than 0000; an incorrect digit order is obvious at once. On the Basys 3, check the active-low signal conventions in the manual. As a starting calculation, a 1 kHz slot rate across four digits refreshes each digit at 250 Hz.

Check: Check that only the intended digit is enabled in each active slot. If neighboring digits show faint segments, briefly blank the digit enables before changing the shared segment pattern.

Projects 4–7: build something that talks back

4. Build a stopwatch that can pause

Reuse your debouncer and display. Separate the state controlling start and stop from the elapsed-time counter, and feed the counter a regular clock-enable pulse. On a 100 MHz clock, a 100 Hz enable comes once every 1,000,000 cycles. Decide whether the fractional tick phase is preserved across pause; otherwise the first displayed increment after resume can arrive earlier than expected.

Check: Test start, pause, resume, rollover and reset while running. Define what happens when reset and start arrive together, then test that exact combination.

5. Dim an LED with PWM

Compare a free-running eight-bit count to a threshold. With a threshold of 64 and a period of 256 counts, the output is high for 25% of each period. If you want 100% duty, define an explicit full-on setting: an eight-bit threshold tops out at 255, which is not 256.

Check: Count the number of high cycles over a complete PWM period at 0%, 25% and full-on. Start with the onboard LED and leave motors out of this first version. An FPGA pin is not a motor driver.

6. Echo bytes over UART

Build the transmitter first, then the receiver. Use 115,200 baud, eight data bits, no parity and one stop bit (8N1). At 100 MHz, one bit spans approximately 868.06 clock cycles. If you implement an oversampling tick, calculate its error separately. The Basys 3’s USB-UART bridge saves you from wiring a separate adapter.

Check: Send 0x55 and look for the alternating data bits. Then send 0x00 and 0xFF to check framing across long runs. If terminal output is garbled, verify the actual bit period and the terminal’s format before rewriting the receiver. Define what happens if the host sends bytes faster than your echo path can accept them.

7. Read an SPI peripheral from its datasheet

Try a Digilent Pmod ALS if you have one. Its reference manual specifies a 16-clock transfer for a reading. Sketch chip select, clock and data on a timeline first. From that diagram, write down which edge samples data and which bits become the result.

Check: Simulate a known conversion word, then verify the decoded result. On a board, compare covered and illuminated readings. If the value is exactly doubled or halved across a range of inputs, inspect bit alignment. Before connecting any external board, confirm supply, signal voltage and pinout.

Projects 8–10: combine the pieces

8. Generate a VGA test pattern

Use horizontal and vertical counters to generate the active area, blanking and sync. Use one timing recipe from the board manual instead of mixing porch values from different modes. Start with color bars and add motion only after the monitor locks. On a board with no VGA connector, simulate the timing and frame coordinates; don’t assume VGA and HDMI use interchangeable signaling.

Check: Count pixel intervals per line, lines per frame and sync-pulse widths in simulation. If the monitor says “no signal,” check sync polarity, periods and pin mapping before changing the colors.

9. Write a tiny CPU that runs one useful program

Use an instruction register, program counter, a small register file and an ALU. Start with just enough instructions to load two constants, add them and halt. A simple multicycle controller makes the fetch, decode and execute boundaries visible and can handle synchronous memory reads explicitly.

Check: Predict the program-counter sequence and final register value on paper. Assert both in simulation. Add a taken and a not-taken branch only after the first sequence passes.

10. Capture an internal waveform in block RAM

Sample a known internal signal such as the UART transmitter from project 6. Write samples into a circular buffer, mark the trigger location, collect a defined number of post-trigger samples, then freeze the buffer before uploading it. At 10 million samples/s, a 2,048-sample buffer holds 204.8 µs at that sample rate; memory buys capture time, not bandwidth.

Check: Trigger on a known transition, reconstruct the sample order after the write pointer wraps and decode the UART byte from the capture. Catch a trigger near the buffer boundary in simulation. Treat external asynchronous signals as an extension, with explicit input-voltage checks and a sampling design suited to the signal.

What should you build next?

If you can blink an LED but your buttons are unreliable, stop at project 2 until you can explain the waveform. If you already understand that path, UART is a good next choice: after it works, it gives the rest of your projects a way to report what’s happening.

No board yet? Simulate the counters, state machines and UART now. When you move to hardware, keep those tests and add new checks for clock constraints, pin mapping and the interfaces the simulator didn’t model.

The project checks are acceptance targets, not results from a board test. Recalculate the timing for your board and check the constraints against its own hardware manual. See our editorial standards or send a correction.


Leave a Reply

Your email address will not be published. Required fields are marked *