Question
Greatest Common Divisor: For the term project, you will implement a Verilog code on FPGA that calculates the greatest common divisor (GCD) of two numbers.
Greatest Common Divisor: For the term project, you will implement a Verilog code on FPGA that calculates the greatest common divisor (GCD) of two numbers. The design will take two 4-bit input numbers from FPGA switches and calculate their GCD. The seven segments will either display the 4-bit numbers or the GCD result with respect to a toggle button. Once pressed, the toggle button will make seven segments switch the display. The inputs and outputs are detailed below;
Inputs Num1_in: First 4-bit number input. It can be any decimal value from 0 to 15. It will be declared using 4 switches (SW1-4) on FPGA. Num2_in: Second 4-bit number input. It can be any decimal value from 0 to 15. It will be declared using the remaining 4 switches (SW5-8) on FPGA. GCD_on: It is a 1-bit toggle input. If pressed for the first time, the seven segments will display the result of the GCD operation. If pressed again, the seven segments will go back to displaying the 4 bit number inputs. Clock_in: Clock input. It is the 20ns main clock on FPGA. Outputs Num1_out: It is a 7-bit SS output that represents the first 4-bit input number, Num1_in. It will be displayed on the left half of seven segments given the correct GCD_on toggle input. Num2_out: It is a 7-bit SS output that represents the second 4-bit input number, Num2_in. It will be displayed on the right half of seven segments given the correct GCD_on toggle input. GCD_out: It is a 7-bit SS output that represents the 4 bit GCD result. It will be displayed on the right half of seven segments given the correct GCD_on toggle input. The suggested input and output connections are given below;
Bonus Keypad: For the 10% bonus, you will revise your design to use a 4x4 keypad instead of switches to take the input numbers.
All the buttons are connected to each other with wires in a matrix formation, in other words 4 wires for each row and 4 wires for each column. Row and column wires do not touch each other initially. Once a button is pressed, the wires crossing that button touches each other. So, a link appears in between respected row and column wires of that button. The keypad will give you the location of the number pressed instead of the number itself. To decode the number, you need to write a Keypad scanner Verilog code which will send voltage through the rows or columns of the keypad and search for the button pressed. Be careful that you should take into account a small amount of pressing and releasing the button time (~100ms for pressing & ~20ms for releasing). Finally, this code block should convert the address of the button to the number pressed.
Project Report: Your report should have header page which includes; course name, project name, group member names, IDs, sections and the date. In your reports include; introduction (where you briefly describe the project in your own words) and a conclusion (where you explain what you learned, what difficulties you encountered and so on).
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started