EECS 270: Lab 1

Introduction to the Quartus Toolset

See lab schedule for due dates.
Total Value: 50 points

  1. Overview
  2. The main goal of this first experiment is to familiarize you with the lab setup and to give you your first formal exposure to the Altera software and the DE2 programmable logic board. You will perform all of the design stages outlined in the EECS 270 Laboratory Overview.

  3. Preparation
  4. This being your first lab, the actual design work required is quite minimal. However, you need to do quite a bit of reading in order to make this a useful exercise. Read the following before you do the lab, and refer to it as needed later:
    1. The EECS 270 Laboratory Overview document. This is a good starting point and a useful reference for data that you'll frequently need.
    2. The tutorial we've prepared for you.
    3. The post-lab questions assume you know a bit about hexadecimal notation. Read the supplement included with this lab on hex notation and number systems.

  5. Design Specification
  6. The top-level schematic of the circuit you need to design is shown in Figure 1. Named SELECTOR, it has two 8-bit inputs connected to two different banks of dip switches (SW7-0 and SW17-10). It also has an input connected to the KEY3 push-button (leftmost blue button on the board). It has an 8-bit output connected to the red LEDs 0 to 7, and a 7-bit output connected to the rightmost 7-segment display (HEX0 on the board). Locate all of these inputs and outputs on the DE2 board before you continue.


    Figure 1: Top-level view of SELECTOR
    Your design should achieve the following:
    1. When the push-button is depressed, the 8-bit word specified by the settings of the SW[7:0] should be displayed on both the red LEDs and the 7-segment display.
    2. When the push-button is not depressed, the 8-bit word on SW[17:10] should be displayed on both the red LEDs and the 7-segment display.
    3. You are to name your output pins for the HEX0 display H0 through H6. To do this, you will need to append lines to the *.qsf file. (Hint: copy the relevant lines from the assignment_defaults.qdf file, found on the lab web page and make changes as needed.) You may name the red LEDs as you wish.
    The red LEDs should be illuminated so that setting the rightmost switch of a group illuminates the rightmost LED. In the same way, the rightmost switch should illuminate segment 0 of HEX0 (see figure 2, below).

    Figure 2: 7-segment display segment numbers
    Implementation details
    There are two more things you need to know before you can start.
    1. Even though we have yet to study multiplexers in detail, it is not too hard to realize the functionality of SELECTOR with a pair of 74x157 4-bit 2-way multiplexers. This component is available as a library primitive that can be instantiated in the Schematic Editor (In the symbol tool/device library as: others → maxplus2 → 74157). It has two sets of 4-bit inputs (labeled A1-A4 and B1-B4), a 4-bit output (Y1-Y4), a select input S, and an active-low enable input GN. When enabled (GN = 0), this component behaves as follows:
      if(S==0)
        Y[i]=A[i]
      else
        Y[i]=B[i]
      

    2. The HEX outputs are active low. That means that the light comes on when a 0 (low) is driven to it. You'll need to think about how to handle that.

  7. Design Notes and Hints
    1. Despite the fact that the top-level schematic is drawn using busses, you don't have to use busses in your design; simply use single-bit wires. We'll have plenty of practice with busses later on.
    2. A logical 0 is represented as the symbol associated with GND. A logical 1 is represented as the symbol associated with VCC. GND and VCC are available in the device library under primitives → others.

  8. Deliverables
    1. Pre-Lab (15 points)
      • Hardcopy of SELECTOR's schematic and .qsf files. Insert your name, student ID number, and unique name on the schematic by using the "Text Tool" (The big A) to put this information on the top-left of the screen. Use a font size that is readable when printed. (10 points)
      • Hardcopy of SELECTOR's simulation results showing its response on the appropriate 7-segment display and LED outputs to all possible combinations of SW0, SW10 and KEY3. inputs. Do this by providing clocks with a period of 40ns, 20ns and 10ns to SW0, SW10 and KEY3, respectively. Print only the first 80ns of simulation (You can do this by selecting "Options" from the print menu). Write your name, student ID number, and unique name on the simulation print-out (note that, unlike the Schematic Editor, the simulator does not allow you to type your name on the printed sheet). (5 points).

    2. In-Lab (15 points) Generate the .sof file for SELECTOR, download it to the board, and verify that your implementation is working properly. When you are satisfied that you have a correctly- functioning circuit, demonstrate its operation to your lab GSI and have him sign your experiment cover sheet.

    3. Post-Lab (20 points) Prepare your lab report as described in the EECS270 Laboratory Overview handout. Make sure you complete and include all parts of the report including the Cover Sheet, (including your section number) and the Design Documentation section (3 points). In the Post-Lab Questions section, provide answers to the following questions:
      1. Consider a MUX which has a single control line (C) which selects between two inputs (A and B) to generate one output (M). Draw a truth-table for this device. (4 points)
      2. If you were to construct a truth table for SELECTOR, how many rows would it have? How many (input and output) columns? (4 points)
      3. Assuming that SW[7..0] = 0x9E and SW[17..10] = 0x7A (these are hexadecimal values), which red LEDs remain lit regardless of whether the button is pushed or not? (3 points)
      4. Assuming Key3 is 1, which switches should be set to what values if you want a "4" to be displayed on the seven-segment display? What if you wanted a "0" and Key3 was 0? (6 points)