Pages created and updated by Terry Sturtevant Date Posted: May 12, 2017


PC/CP220 Digital Electronics Lab

Introduction to Quartus II Software Design using Test Benches for Simulation

(Note: If you have done the previous task which involves "forcing" the inputs for simulation, the first several sections of this document are identical. If you saved your previous work, you can skip to the testbench section where the changes begin.)

In this tutorial, we will show you how you capture the schematic design for the automatic door opener circuit using Altera Quartus II software.

The Problem

We are designing a circuit for an automatic door like those you see at supermarkets. The door should open only when a person is detected walking through or when a person presses a switch (such as the wheelchair button) to have the door open. The door should only operate if it has been unlocked.

I: Drive

During Labs you will need to save all your work under a directory called CP220 in your Home Directory (drive I:)

To get to your I: or your Home Directory double click on My Computer icon on the desktop.

Under I:\CP220 create the following folders

schematic

Copy this directory from the I drive to the E drive. There are currently probelms saving files directly to the I drive. Be sure to copy your files back to the I drive after you are done.

Getting Started with Altera Quartus

Launch the Altera Quartus software. You should see a screen such as this:

opening screen

Creating a New project

Select the File New Project Wizard; a window like the following will appear.

To select the working directory use the button to browse and select E:\CP220\intro.
Name the project DoorOpener. (Note that the next field gets filled in automatically.) Select Finish.
Don't uses spaces in file or directory names.

new project wizard

Creating a new Schematic design

Select File New - A window as seen in the following picture will open.

Select 'Block Diagram/Schematic File' and press OK.

block diagram

This should open a palette where you will design your circuit. This palette is designated Block1.bdf. Save this graphic design file as DoorOpener in your "intro" directory. The file will be given the bdf extension; bdf stands for block design file and contains schematics, symbols or block diagrams.

Adding text

  1. Select the A below the arrow to the left of your Block Diagram/Schematic File window (also known as the palette).
  2. Select a point near the top left in the window with the left mouse key.
  3. Type your name and then hit the Enter key.
  4. Type your project name and then hit the Enter key.
  5. Type the following equation, f = hc' + pc' , and then hit the Enter key.
  6. Hit the Esc (escape) key to end text additions.

adding text

Adding a Component

  1. Click the library icon.

    library icon

    The Symbol dialog box will appear. This window lists the available Altera libraries as seen in this image.

    adding component

  2. Expand the /altera/quartus10.0sp1/quartus/libraries folder, expand the primitives folder and then expand the logic folder.
  3. In the logic folder, select the and2 component by double clicking on it (or by selecting it with a single click, then selecting OK).
  4. Click the pointer at the desired location in the Block Diagram/Schematic Editor window to insert the AND symbol into the design file.

Repeat these steps to enter an OR (or2) gate and a NOT (not) gate.

(If you wanted to add multiple NOT gates, you could select the Repeat-insert mode box.)

In the same manner that you placed a gate onto the palette, add three input pins and one output pin from the Symbol libraries. Input pins can be found under primitives | pin | inputs. Output pins can be found under primitives | pin | outputs.

Name your input and output pins as you name them in your equation. Double click on the pin name to change its name.

Rearrange your devices in approximately the placement you would like for the logic diagram you are trying to construct. You can move a component by selecting it with your mouse, holding down the left button and moving it to another location on the palette.

Save your design. It is a good idea to save your design often, just in case something bad happens . Save the bdf file with the same name as the project.
Don't use spaces in any file names.

saving bdf file

Wiring your circuit

Select the orthogonal node tool. Orthogonal Node Tool Place your pointer on the output of one of the input pins and hold the left mouse button down. You should see a cross-hairs or + appear at the output.

Drag your pointer to the input of the AND gate. Every time you release the mouse key, the line (wire) ends. If your wire did not reach the AND gate, you can add to the wire by putting your mouse over an end of the wire and again selecting it with your left mouse button and dragging your mouse to another position.
Don't run wires along the edge of a device. This can cause simulation problems.
Don't leave inputs and outputs right next to the chips. Make sure you can actually see some wire between them, otherwise you may have simulation problems.

Note: Make sure you do not make the wire too long. If you drag it too far you will see an x; and this is considered an open connection and your design will not compile.

To delete a wire or a portion of a wire, simply click on it (it should change color to indicate selection) and press the delete key.

If wires are connected to the component as you are moving it, the wires will drag and stay connected to the component. This is referred to as "rubber banding" and is a feature of all major schematic entry design packages. (You can turn rubberbanding on and off using the rubberbanding tool.Rubberbanding Tool )Add the rest of the wires needed to connect the logic diagram.

The window should look something like image below. Save your design.

finished circuit screen shot

Printing

We will not print today. But you will need to know how for your project.

To print, go to File | Print. If you want to change what appears on the printout or how it appears, go to File | Page Setup change print settings. Before printing, you can view what the print will look like by selecting File | Print Preview

Choosing a Device

The programmable device which we'll use for our design can be chosen now.

Select Assignments | Device from the pull-down menu.

assigning a device

Select MAX7000S from the "Family" pull-down list. Select the "Specific device selected" and then choose EPM7064SLC44-10, which is the device we are using in our lab. Select "OK."

choosing the 7064slc

Circuit Compilation

You will need to compile your design to ensure you do not have any errors in your circuit (e.g. you do not have any open connections, etc.)

Click on Processing | Compiler Tool to start compilation. Then click start.

compile menu

Circuit Simulation

Before simulating, some preparation is required.

Configure NativeLink settings:

more nativelink settings

Convert the schematic diagram into VHDL code for simulation.

Add the VHDL file to the project and compile for simulation.

Library Compilation

It may be necessary to compile the libraries for your device family before you simulate.
Click on Tools | Launch EDA Simulation Library Compiler.

library 
compile

The MAX7000S family should already be selected, so click Start Compilation.

compile MAX7000 
family

Don't worry if you get any error messages.

Create a testbench to automate your simulation.

Launch the ModelSim simulator.

Open waveform window and add signals to be simulated.

Demonstrate the circuit to the lab demonstrator before you leave.

Copy your directory from the E drive to the I drive. Delete them from the E drive and empty the Recycle Bin so they don't get used by someone else later.

Resources

To view pdf documents, you can download Adobe Acrobat Reader .
get Acrobat Reader
If you need to update a browser, you might try Firefox which is Get Firefox!
Since this page uses cascading style sheets for its layout, it will look best with a browser which supports the specifications as fully as possible.

If you are looking for an office package, with a word processor, spreadsheet, etc., you might try LibreOffice which is Get LibreOffice!

Go to the main page for the Department of Physics and Computer Science.

Valid XHTML 1.1

Valid CSS!

WCAG 2.0
(Level AA)

Wilfrid Laurier University