USING VERILOG PLEASE Objectives: To design and construct a synthesizable Finite
ID: 3805380 • Letter: U
Question
USING VERILOG PLEASE
Objectives: To design and construct a synthesizable Finite State Machine and Datapath which computes the greatest common denominator (GCD) of two numbers as explained & discussed in lecture.
Problem: Implement one of the two GCD FSMD designs discussed in the class lecture and outlined in the slide set. Those two designs are your only options.
DescriptionYour design will take in two 4-bit numbers and output the binary value of the greatest common divisor of those two numbers. The numbers will be input via the dip switches, the result will be output via the LEDs, and control is done via pushbuttons.
Your design will consist of two components - the controller and the datapath. The controller is to be a pure FSM. The datapath operates based on signals generated by the controller FSM - it should have no independent controlling logic.
IMPORTANT: The datapath must be constructed structurally. This means that you can only instantiate components, and connect them with wires. You will need to create individual components (Adder, Comparator, Register, etc) for each element in the datapath. Registers are the only clocked component, and they should be triggered by the clock on the opposite edge than that of the Controller FSM. All non-register components must be purely combinational - no sequential elements. Your registers should have some type of enable signal for control, and a separate reset signal. Check the Template library for examples/starting points.
Explanation / Answer
tmpX = X;
tmpY = Y;
while (tmpX != tmpY)
{
if (tmpX < tmpY) tmpY = tmpY-tmpX;
else
tmpX = tmpX-tmpY;
}
output = tmpX;
This specification must appear in the GCD architecture entitled FSMD. The entity has a go input and done output (revised 2/23) that work as follows. After being reset, the circuit should wait until go becomes 1 (active high), at which point the GCD algorithm should be performed for the given x and y inputs. Upon completion, done should be asserted (active high). Done should remain asserted until the application is started again, which is represented by a 0 on the go signal followed by a 1. In other words, the circuit shouldn’t continuously execute if go is left at 1. Use the provided testbench (gcd_tb.vhd) to test your architecture. Note that the testbench uses a configuration to specify which gcd architecture is used.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.