Skip to content

Basic FSMD example to calculate the Greatest Common Divisor of two 8-bit numbers

License

Notifications You must be signed in to change notification settings

ihabadly/FSMD-GCD

Repository files navigation

FSMD-GCD

Basic Finite State Machine with Datapath (FSMD) example to calculate the Greatest Common Divisor (GCD) of two 8-bit numbers.

Install

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.

Usage

  1. 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-gcd.git
  2. Use Visual Studio Code (VSC) to edit and view the design files:

    $ cd fsmd-gcd
    $ code .

    Click on the gcd_toplevel.vhd file in the left pane to view its contents.

  3. From the VSC View menu, choose Terminal, in the VCS Terminal, create a "work" library:

    $ vlib work
  4. Compile all the design units:

    $ vcom *.vhd
  5. Simulate your design. For example, if x_i = 12, y_i = 8 then d_o = 4:

    $ vsim work.gcd_toplevel_tb

About

Basic FSMD example to calculate the Greatest Common Divisor of two 8-bit numbers

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages