How ziyan/altera-de2-ann works
Project type and purpose
• This is an FPGA hardware-design project that implements an Artificial Neural Network (ANN) on the Altera DE2 development board.
• The README (“Artificial Neural Network on Altera DE2”) and the presence of VHDL files, QSF/QPF, and Quartus IP files indicate a custom hardware architecture rather than software.
File structure
• Top level:
• doc/ – design report
• src/ – all HDL sources and Quartus project files
• Under src/:
• ann/ – the top-level ANN VHDL entity (ann.vhd) plus project files (ann.qpf)
• / – display controller for the onboard LCD (display.vhd)
• lib/float/ – floating-point arithmetic IP (add, sub, mul, div, exp, cmp, etc.)
• lib/lcd/ – low-level LCD interface (lcd.vhd)
• lib/lfsr/ – linear-feedback shift register for random/pattern generation
• lib/sram/ – SRAM interface IP
• pr/ – pattern-recognition or pattern-generator logic (patterns.vhd, pr.vhd)
• Quartus project files (de2.qsf, de2.vhd) indicate the top-level wrapper for the DE2 board.
README
a. DE2 Board I/O Blocks
• On-chip SRAM interface (lib/sram)
• LCD module (lib/lcd + display.vhd)
• Clock/reset and any pushbuttons or switches (from de2.vhd)
b. Pattern Generator
• LFSR block (lib/lfsr) or PR block (src/pr) to produce ANN inputs
c. ANN Core
• Top-level ANN entity (src/ann/ann.vhd)
• Internally instantiates floating-point units (fp.vhd plus all fp_* IPs)
d. Floating-Point Arithmetic Units
• Separate IP blocks (fp_add, fp_sub, fp_mul, fp_div, fp_exp, fp_cmp)
• Connected via a shared bus or point-to-point with the ANN core
e. Controller
• .vhd invoking lcd.vhd to show results
f. Configuration/Project Files
Relationships and data flow
• LFSR/PR → ANN inputs
• ANN core → floating-point units (requests and results back)
• ANN outputs → display controller → LCD
• Clock and reset lines fanning out from a central clock generator module
Architectural patterns and design principles
• Modular IP-based design: each function packaged as a VHDL component
• Synchronous dataflow: all modules triggered on the common clock
• Separation of concerns: arithmetic (float lib), control/pattern gen (pr, lfsr), UI (LCD/display), compute (ANN)
Technologies and frameworks
• VHDL for all RTL
• Quartus II for synthesis, fitter, and programming (QSF/QPF)
• Altera DE2 board peripherals (SRAM, LCD)
c. Surround it with child modules: FPUs adjacent, SRAM below, pattern generator on the left, display on the right.