How ombhilare999/seven-segment-with-tang-primer-fpga works
Project type and purpose
• This is an FPGA‐based hardware design project targeting the Sipeed Tang Primer board. It implements a Fibonacci number generator in Verilog, drives a seven-segment display through a segment-mapping module, and uses the Tang TD IDE flow to produce a bitstream for the FPGA.
File structure
• Top level
• constraint/io.adc – pin assignment file that maps logical signals (segments A–G, digit enables, clock, reset) to the FPGA’s physical I/O pins.
• src/
– Fibonacci_Series.v – synthesizable module that generates successive Fibonacci numbers on each clock tick.
– Seven_Segment.v – driver module that takes a 4-bit value and outputs segment signals for a common-cathode display.
– Fibonacci_Series_TB.v – testbench (top) for behavioral simulation, instantiating both generator and display modules.
• prj/ – Tang TD IDE project artifacts: .al design source, .bit bitstream, synthesis/routing reports (.area, .db), and log files.
• assets/ – images documenting the circuit wiring, physical summary, and demonstration GIF.
Extract insights from the README
• Purpose: Demonstrate real-time Fibonacci number display on seven-segment hardware.
• Workflow: Edit Verilog sources → simulate with TB → synthesize & implement with TD IDE using io.adc → program Tang Primer → observe display.
• Hardware: Common-cathode segments wired via 330 Ω resistors to FPGA I/O.
Main components and their interactions
a. Verilog Source Layer (src/)
• Fibonacci Generator – clocked process producing 4-bit output.
• Segment Decoder – combinational logic mapping 0–9 to A–G segment patterns.
• Testbench – verifies functionality in simulation.
b. Build/Toolchain Layer (prj/)
• Constraint Parser – imports io.adc for I/O mapping.
• Synthesis & Implementation – produces netlist, runs placement & routing.
• Bitstream Generation – outputs Seven_Segment.bit.
c. Hardware Layer
• FPGA (Tang Primer) – configures with bitstream, hosts logic.
• Seven-Segment Display – common-cathode segments, current limit resistors.
• Clock & Reset – on‐board oscillator and user button or jumper.
Flow:
Verilog sources → (simulate via testbench) → (synthesize & implement with constraints) → bitstream → FPGA configuration → drives segment pins → display hardware.
Architectural patterns and design principles
• Separation of Concerns: computation (Fibonacci), presentation (segment decoder), and constraints/toolchain are kept in distinct directories.
• Test-Driven Hardware: dedicated testbench module ensures correctness before synthesis.
• Dataflow style: purely combinational mapping in decoder, sequential logic in generator.