Basic Finite State Machine with Datapath (FSMD) example to calculate the Fibonacci series up to the 12th index.
These examples use ModelSim® and Quartus® Prime from Intel FPGA, GIT, Visual Studio Code, make sure they are installed locally on your computer before proceeding.
-
Grab a copy of this repository to your computer's local folder (i.e. C:\projects):
$ cd projects $ git clone https://github.com/ihabadly/fsmd-fibonacci.git
-
Use Visual Studio Code (VSC) to edit and view the design files:
$ cd fsmd-fibonacci $ code .
Click on the fibo_toplevel.vhd file in the left pane to view its contents.
-
From the VSC View menu, choose Terminal, in the VCS Terminal, create a "work" library:
$ vlib work
-
Compile all the design units:
$ vcom *.vhd
-
Simulate your design. For example, if i = 12, then fib = 233:
$ vsim work.fibo_toplevel_tb