Due Monday, January 23rd (write up is due in class, you must demo it in the KLab by 7pm)
This lab can be done individually or in groups of two.
This lab is worth 10 points.
Before you begin, you'll want to walk through the tutorial.
In this lab, you'll be reverse-engineering a mystery FPGA configuration. The mystery configuration contains a simple combinational logic function of three inputs and two outputs. The three inputs are swtiches 0, 1 and 2 on component SW7. The outputs are LED 0 and 1 (components D10 and D9).
Your task is to figure out what function this configuration implements (by recording the outputs for all eight possible switch settings) and then write a simple structural Verilog file that implements the exact same function. To load the config file, you'll need to run iMPACT from the Windows Start menu. Once loaded, record the operation of the circuit. Next, follow the Verilog entry instructions from the tutorial, but include in the Verilog file the required logic gates and any need wires. For an example of structural Verilog, see the two "HDL" slides from lectures notes from the first day of class. The simple gates available are: not, and, or, nand, nor, and xor.
Important
In this lab you can only use structural verilog and only these six gate types: not, and, or, nand, nor, and xor
Note
The LED outputs and the swtiches are both use "active low" signaling. That is, the LED turns on when its signal is a 0 and the LED is off when its signal is a 1. Similarly, The swtiches return a 1 when off and a 0 when on. You'll need to take this into account when writing your Verilog.
When you've completed and tested your design, demo your design to one of the TAs. They will verify the design works correctly and ask you a few questions about the design. If you pass the demo, they will check you off.
Important
If you do this as a two-person group, both students must be present at the demo.
Turn in the follow items in class on Monday.
A few hints:
In Verilog, various gates (such as and, or, nand, nor) can take multiple inputs. For example, to calcualte the "or" of three signals in Verilog:
or (out, in1, in2, in3)
One systematic way to make any combinational logic function is to build a PLA (which were discussed in CSE240). Remember, a PLA has an "and" term for each "one" output in the function. These "and" terms are the "and" of each of the inputs or its inverse. The final answer is the "or " of these "and" terms.