Hands-on FPGA laboratory
From blink LED to RISC-V softcore — learn FPGA by doing!
An FPGA (Field-Programmable Gate Array) is a semiconductor device that can be reprogrammed to implement various digital circuits and functions. Unlike ASICs, FPGAs offer flexibility and adaptability, allowing designers to modify functionality even after manufacturing.
An FPGA consists of three fundamental building blocks:
- Configurable Logic Blocks (CLBs) - The basic computational units
- Interconnect Architecture - Programmable routing between blocks
- Input/Output Blocks - Interfaces to external devices
Each CLB contains:
- LUT (Look-Up Table) - Implements combinational logic functions
- Flip-Flop - Stores state for sequential logic
- Multiplexer - Selects between combinational or registered output
The CLB provides the basic logic and storage functionality, executes complex logic functions, and synchronizes operations using flip-flops with a clock signal.
Figure: Detailed gate-level view of CLB components
The diagram above shows how each CLB component works at the logic gate and mathematical level:
1. LUT (Look-Up Table)
- Mathematically: A LUT with n inputs implements any Boolean function of n variables
- A 2-input LUT is a 4×1 memory:
Output = Memory[2×A + B] - Gate equivalent: Can implement AND, OR, XOR, or any truth table
2. D Flip-Flop
- Mathematical model:
Q(t+1) = D(t)when clock rises (▲) - Stores 1 bit of state synchronously
- Output only changes on the rising edge of CLK
3. 2:1 Multiplexer
- Boolean equation:
Out = (¬Select · LUT_Out) + (Select · FF_Out) - Selects between: S=0 (combinational path) or S=1 (registered path)
4. Complete CLB
- Unified equation:
CLB_Out = Config ? FF(LUT(Inputs), CLK) : LUT(Inputs)
Start here if you are new to FPGAs:
- What is FPGA? - Fundamental concepts
- Basic Verilog - Syntax and structure
- FPGA vs Microcontroller - Understand the differences
- Gowin IDE Installation - Set up your environment
# 1. Clone the repository
git clone https://github.com/yourusername/fpga-practical-labs.git
cd fpga-practical-labs
# 2. Install tools (see docs/)
# 3. Check available projects
cd projects/
# 4. Start with Toggle LED
cd Toggle_led/| Project | Description | Status |
|---|---|---|
| Toggle LED | Basic LED toggle using Tang Nano 9K | ✅ Available |
| Servo Control | Servo motor control with progress LEDs | ✅ Available |
This project is licensed under:
- Code: MIT License 2026 FPGA Practical Labs Contributors
- Documentation: CC BY-SA 4.0
If this project helped you, consider giving it a star!