lab5Fall11

# lab5Fall11 - Lab 5 Finite State Machines Datapaths(GCD...

This preview shows pages 1–3. Sign up to view the full content.

Lab 5: Finite State Machines + Datapaths (GCD Calculator) ( Rev. 1) EEL 4712 – Fall 2011 1 Objective: The objective of this lab is to use a finite-state-machine controller integrated with a datapath to calculate the greatest common divisor (GCD) of two numbers, using two different designs. Required tools and parts: Quartus2, ModelSim-Altera Starter Edition, UF-4712 board Pre-lab requirements: Study the following pseudo-code to make sure you understand the basic algorithm for calculating the GCD of two numbers. The code has 2 inputs ( X and Y ), and one output ( output ). tmpX = X; tmpY = Y; while (tmpX != tmpY) { if (tmpX < tmpY) tmpY = tmpY-tmpX; else tmpX = tmpX-tmpY; } output = tmpX; 1. Design 1 (FSM+D1) : In this design, you will implement a custom circuit that implements the GCD algorithm by using the datapath shown below: tmpX Register tmpY Register - 2x1 Mux 2x1 Mux Output Register - x_sel y_sel y_en x_en output_en x_lt_y x_ne_y Datapath1 x y output *All dotted lines represent control inputs/outputs Comparator

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Lab 5: Finite State Machines + Datapaths (GCD Calculator) ( Rev. 1) EEL 4712 – Fall 2011 2 Implement the datapath by creating an entity datapath1 (store it in datapath1.vhd). You must use a structural description that instantiates all of the components shown. Therefore, you will also need a register entity, a 2x1 mux entity, a subtractor entity, and a comparator entity. The
This is the end of the preview. Sign up to access the rest of the document.

## This document was uploaded on 03/05/2012.

### Page1 / 3

lab5Fall11 - Lab 5 Finite State Machines Datapaths(GCD...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online