Quick Quartus: Schematic Entry
← Back to E15 Lab page ←
Please
contact me if you find any errors or other problems (e.g., something is
unclearly stated) in this web page
This document presents a (very) quick introduction to the use of Quartus to
design a system for schematic entry.
The Basics
Automatic Pin Assignment
Adding other parts
Common Problems
- Start Quartus (it is in the "Altera" folder in the Windows Start menu).
- Select "Create a New Project (New Project Wizard)"
- Hit "Next >" to get past
"Introduction" page.
- On the next page ("Directory, Name, Top-Level Entity [page 1 of 5]") choose a working directory (preferably one you can
access from anywhere on campus) and choose a project name. Then hit
"Next >"
- Hit "Next >" (from "Add Files [page 2 of 5]").
- On the next page ("Family and Device Settings [page 3 of 5]"):
- choose Family: "Cyclone II"
- choose Available Devices: "EP2C35F672C6" (the
number on the large chip on the DE2 Altera board). Note, these are
not alphabetical, so you need to scroll through the choices.
- hit "Next >"
- Hit "Next >" ("EDA Tool Settings
[page 4 of 5]")
- Hit "Finish" ("Summary [page 5 of
5]")
- From the Quartus main menu choose "File→New→Block Diagram/Schematic File"
then "OK"
- To add a circuit element, choose the
icon from the menu
bar. Expand the libraries entry and choose "Primitives/logic/or2"
Hit "OK" and place it on the open page. Hit "Esc" after placing one
element.
- Repeat the above with "Primitives/pin/output" (1 of these) and
"Primitives/pin/input" (2 of these).
- Connect the input pins to the input of the or gate (click and
drag to add wires). You should have a diagram something like the one
shown below.

- Save your design.
- From the main Quartus menu go to "Processing→StartAnalysis &
Elaboration." This is the first step in compiling your design and
determines inputs and output to your design. After this is
successfully completed, move on to the next step.
- To demonstrate this circuit in action, we need to assign the
inputs and outputs to physical devices on the DE2 board. To do this,
relabel the inputs as "A" and "B" (it doesn't matter which is which) and
label the output "X". Hit "Processing→StartAnalysis &
Elaboration" again. Now, from the main Quartus menu, go to
"Assignment→Pin Planner. " This shows a rather complicated diagram
representing all of the outputs available on the EP2C35F672C6 device (the
pins are on the bottom of the chip, so you can't see them). Towards
the bottom of the window, your inputs and outputs are defined. We need
to specify the "location" of each of your inputs and outputs on
the chip.
Refer to the file DE2_Pin_Table.pdf for a description of each. We will
connect the inputs to two of the pushbuttons on the DE2 board and the output
to an LED.
- For the input "A" go to the "Location" column and choose "PIN_G26"
which is connected to KEY[0] (the rightmost pushbutton).
- Set "B" to "PIN_N23" (KEY[1]).
- Set "X" to "PIN_U18" (LEDG[4]).
- Close the "Pin Planner" window.
- Your design should show the pin assignments.

- Now let's compile the design, with the pin assignments. Go to
"Processing→Start Compilation". You will get several warnings - ignore
these.
- Make sure the DE2 board is turned on and connected to the computer through the USB port labeled "Blaster" (there are two USB ports on the DE2
board. Go to "Tools→Programmer"
The "Hardware Setup" should show "USB-Blaster". If so, hit "Start".
If not you'll have to setup the hardware.
- Your design is now running, with the inputs connected to KEY[0] and
KEY[1], and the output to LEDG[4]. Note that the buttons are active
low (i.e., they are at a logic high when not pushed, and logic low when
pushed), so you'll have to push
in both buttons to turn the LED off. Make sure the circuit works as
expected.
There is an easier way to define input/output (I/O) pins using the
definitions in the file E15DE2_IO.qsf. This
file predefines all of the pins with the names given in
DE2_Pin_Table.pdf. To see how this
works, copy E15DE2_IO.qsf to your working
directory.
- Change the labels on the inputs to SW[16] and SW[17] (the two leftmost
toggle switches) and the output to LEDR[0].
- Go to "Assignment→Import Assignments..." and choose the
E15DE2_IO.qsf
file. This should automatically assign the proper pins.

- Compile and download the design to verify that it works. Note that SW[16] and SW[17] are on the
far left of the DE2 board. Sometimes the pin assignments don't show up (even though they are there). In this
case just close the schematic file and reopen it - the pin assignments should be visible.
We can also add our own circuits to those supplied by Altera. In
particular, it will sometimes be useful to add a counter so that we can cylce
through multiple inputs.
- Add the files E15Counter1Hz.bsf and
E15Counter1Hz.v to your working directory (note:
we could have added these at the start and included them as part of the project
using the project wizard). You'll learn what's in the .v file
later.
- Go to "Project→Add/Remove Files in Project..." and add
E15Counter1Hz.v to the project.
- Now go the the schematic, choose
and select the part
"E15Counter1Hz" from the "Project" library. This is a counter
with 4 output bits (Q3...Q0, with Q3 being the Most Significant Bit and Q0
the least) that takes a 50MHz input (available on the DE2) and counts at 1 Hz
until the output reaches the number on the inputs (D3...D0).
- Connect as shown below. Note the "Vcc"
(logic 1) and "GND" (logic 0) parts are
found by choosing
, and then going to
"primitives/other" in the Altera library. The pin labeled
"CLOCK_50" (i.e., PIN_N2) is set to a signal (called a clock) that
oscillates at 50 MegaHertz (50 MHz = 50 million times per second).

- Compile and run. Four of the green LED's will count up in binary
for 12 counts (from 0 to 11; D3...D0=10112(binary)=1110(decimal)),
and the red LED should be off only when the two least significant bits (Q0
and Q1) are off.
- You create a new schematic file, but the old one keeps loading onto the
DE2.
Soln: You need to update the highest level entity in your design. In
the "Project Navigator" pane, with the "Hierarchy" tab selected, the highest
level entity is listed (and probably isn't your design). Go to the
"Files" tab in the "Project Navigator," find your file, right-click on it
and set the file as the "Highest level entity." Recompile and program
the device.
- You change the names of input and output pins, but the pin numbers don't
show up on the schematic.
Soln: Make sure you do an "Analysis and Elaboration" (go to "Processing→StartAnalysis &
Elaboration."). Then close the file, and reopen it. The
pin numbers should be visible.
- You get an error message something like "Error:
Net "gdfx_temp0[2]", which fans out to "LEDG[2]", cannot be
assigned more than one value" (important part in
italics). This means that you have two outputs connected to each other
(which is illegal because the value is undefined if the outputs are trying
to output different values). The message gives a hint as to where the
error occurs (LEDG[2] in this case). Look at your schematic carefully
and separate the outputs.
- You get an error message something lik "Error:
Logic function of type E15Counter1Hz and instance "inst" is
already defined as a signal name or another logic function"
(important part in italics). Every part on you design must have a
unique name. In this case there are two things named "inst."
Rename one of them to something unique. Note that "Vcc" and "GND" also
are instances and need unique names. Double click on them to determine
(and change) the instance name.
← Back to E15 Lab page ←
Please
contact me if you find any errors or other problems (e.g., something is
unclearly stated) in this web page