Professional Documents
Culture Documents
Lab Objectives
Now that you know how to develop Verilog designs and load them into the DE1-SoC board, we can now
start looking at more complex designs.
Since there are only 6 items, not all UPC codes are used. The behavior of your circuit for these
situations is unimportant (i.e., Don’t Care).
Nordstrom has a special method for finding shoplifters. Whenever they sell an expensive item, they put
a secret mark on it at checkout. Thus, expensive items that are purchased are specially marked, while
stolen expensive items will not be so marked (inexpensive items are never marked, since it is too
expensive to mark everything sold). When there is a return, we want to make sure someone didn’t steal
the item, then return the stolen item for money. Therefore, there are the following four cases to
consider for whether or not an item was stolen:
• An expensive, marked item is not stolen.
• An expensive, unmarked item is stolen.
• An inexpensive, unmarked item is not stolen.
• An inexpensive, marked item should never occur, so treat it as a Don’t Care.
1
You will be given the UPC of the item under test (signals “ ”, “ ”, and “ ” for simplicity), and a detector
will check for a secret mark (“ ”). Your circuit should have one “ ” light that lights up
whenever a discounted item’s UPC is supplied, as well as a “ ” light that lights up whenever a
theft is detected (Figure 1).
1) Create a circuit design by hand for each output. Use K-Maps or Boolean algebra to optimize the
design (K-Maps will likely be easiest).
2) Write the corresponding Verilog code in Quartus Prime and simulate it, using the available
switches and lights on the FPGA as inputs and outputs.
3) Download the design to the FPGA and test/debug it.
4) Once you have the design working on the FPGA, draw out the finalized schematic for
submission.
Lab Grading
Working Design: 50 points for correctness, style, and testing.
Logic Minimization: Up to 10 points for using as few logic gates as possible.
You are only allowed to use standard gates (AND, OR, NAND, NOR, NOT, XOR, XNOR).
Each gate appearing in your hand-drawn circuit diagram counts the same, and gates (other
than NOT) can have as many inputs as you want. Unlike Lab 2, there are no “free” gates, so
every gate in your schematic is counted.
2
In-Person Demo (during your demo slot)
• Demonstrate your UPC code circuit working in simulation in ModelSim.
• Demonstrate your UPC code circuit working on the DE1 board.
• Be prepared to answer questions on both the theoretical and practical parts of the lab.
Lab 3 Rubric
Grading Criteria Points
60 pts