Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
6 views10 pages

Practical 4

Uploaded by

Huey Roberts
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views10 pages

Practical 4

Uploaded by

Huey Roberts
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

CPE206 – Digital Laboratory

CPE206 – Digital Laboratory


Practical 4:Introduction to Altera DE2 and Quartus II Design Software
1. Objectives
 Learn basic operation and functionality of Altera D E 2 and Quartus II software
needed to implement digital circuits.
 Test a binary counter that has been pre-designed.
2. Altera DE2 Board
The laboratory assignments will use the Altera DE2 board shown in Figure 1. DE2 can be
used to implement sophisticated digital circuits, and the Quartus II software that you will use
is a complete design package used even by professional engineers.

Note:
Since you are new to digital design, do not be surprised if it appears intimidating at first. Do
not despair; we will selectively introduce the features as needed while ignoring others
that we do not need. As the semester progresses, you will understand more and more features,
and by the end of the semester, you will be able to design complex circuits using many
features of the Quartus II software.
You would need some pre developed files named Lab0.zip to complete the project. Download
them from the course web page or ask from the Technical Staff.

Figure 1 – Altera DE2 Development and Education Board

1
CPE206 – Digital Laboratory

Note the set of switches SW0 – SW17, and push buttons KEY0-KEY3 that provide the inputs
to circuits you will build, as well as light-emitting diodes LED0-LED17, eight 7- segment
display units, and a LCD display unit that can be used for observing the outputs.
The red switch on the left side is the power switch, and the USB port on top left connects the
board to a computer.

3. A Simple Binary Counter

SW1 (Up/Down) SW0 (Enable)

KEY0
(Pulse)

LED-3 LED-2 LED-1 LED-0

Figure 2 – Schematic diagram of a binary counte)

For this laboratory session we have pre-designed a simple binary counter that you will use. A
schematic diagram of the counter is shown above. It is designed to count and display the
number of pulses that is applied by pressing KEY0 input. The counter has to be enabled by
setting SW0 high. Setting of SW1 decides whether the counter counts up or down.

4. Getting Started with Quartus II Software


This tutorial introduces few basic features of the Quartus II software. It shows how the
software can be used to design and implement a circuit specified by means of a schematic
diagram. It makes use of the Graphical User Interface (GUI) to invoke the Quartus II
commands. Doing this tutorial, the reader will learn about:
 creating a project and importing a pre-designed circuit
 Programming and configuring the FPGA chip on the Altera’s DE2 board

4.1. Creating a project and importing a pre-designed circuit


Step 1: Starting the Quartus II software.
Click All Programs  ECE  Altera  Quartus II 9.0 Web Edition 
Quartus II 9.0 Web Edition from the Windows Start menu to open the Quartus II
software.

2
CPE206 – Digital Laboratory

You should see a display similar to the one in Figure 3. This display consists of several
windows that provide access to all the features of Quartus II software, which the user selects
with the computer mouse. Most of the commands provided by Quartus II software can be
accessed by using a set of menus that are located below the title bar. For example, in Figure
3 clicking the left mouse button on the menu named File opens the menu shown in Figure 4.
Clicking the left mouse button on the entry Exit exits from Quartus II software. In general,
whenever the mouse is used to select something, the left button is used. Hence we will not
normally specify which button to press. In the few cases when it is necessary to use the right
mouse button, it will be specified explicitly.

Figure 3 – The main Quartus II display

3
CPE206 – Digital Laboratory

Figure 4 – An example of the File menu


For some commands it is necessary to access two or more menus in sequence. We use
the convention Menu1  Menu2  Item to indicate that to select the desired
command the user should first click the left mouse button on Menu1, then within this
menu click on Menu2, and then within Menu2 click on Item. For example, File 
Exit uses the mouse to exit from the program. Many commands can be invoked by
clicking on an icon displayed in one of the toolbars. To see the command associated
with an icon, position the mouse over the icon and a tooltip will appear that displays
the command name.
Step 2: Starting a New Project
Each logic circuit, or sub-circuit, being designed with Quartus II software is called a
project. The software works on one project at a time and keeps all information for that
project in a single directory (folder) in the file system. To begin a new logic circuit
design, the first step is to create a directory to hold its files. To hold the design files
for this tutorial, we will use a directory named Lab_0. The running example for this
tutorial is a simple circuit that counts in binary.
To start working on a new design we first have to define a new design project.
Quartus II software makes the designer’s task easy by providing support in the form
of a wizard. Create a new project as follows:
(a) Select File  New Project Wizard to reach the window in Figure 5, which
indicates the capability of this wizard. Click Next to get the window shown in
Figure 6.
4
CPE206 – Digital Laboratory

Figure 5 – Tasks performed by the wizard

5
CPE206 – Digital Laboratory

Figure 6 – Creation of a new project


b) Set the working directory to be C:\CPE314\Lab0; of course, you can use
some other directory name of your choice if you prefer. The project must have
a name, which is usually the same as the top-level design entity that will
be included in the project. Choose binary counter as the name for both the
project and the top-level entity, in creation window shown in Figure 6.
Then click the Next button.
Since we have not yet created the directory Quartus II software displays the
pop-up message asking if it should create the desired directory. Click Yes,
which leads to the window in Figure 7.
Note:
If you do not have an engineering account you may need to save your data on the
Desktop.
Step 3: Importing a design
The wizard makes it easy to specify which existing files (if any) should be included in
the project. These files will be added to your project folder but will not be copied into
that.
Click the button labeled “…” in the File Name: field to open the Select File dialog
box. The files that you need are in the Lab0 folder that you download from the web.

6
CPE206 – Digital Laboratory

Figure 7 – The wizard for including user-specified design files

.
Figure 8 – Choose the device family and a specific device

7
CPE206 – Digital Laboratory

Then from the Select File dialog box select the binary_counter.bdf file and then
click the Open button. Then the path to the file will be displayed on the File name:
text box. Click the Add and file will appear under the File name list.
Similarly add the binary_counter.sof file.
Click Next, which leads to the window in Figure 8.
Step 4: Since Quartus II software is used with different types of boards and devices, we have
to specify the type of device in which the designed circuit will be implemented.
Choose Cyclone II as the target device family. We can let Quartus II software select
a specific device in the family, or we can choose the device explicitly. We will take
the latter approach. From the list of Available devices:, choose the device called
EP2670F896C6 which is the FPGA used on Altera’s DE2 board.
Click Next, which opens a window to select other tools that a designer may use.
Click Next again, since we do not use such tools in this class.
Step 5: A summary of the chosen settings appears in the screen similar to that shown in
Figure 9 but with binary_counter specified as the new project.
Click Finish button, which returns to Quartus II window of Figure 3, with
binary_counter specified as the new project in the display title bar.

.
Figure 9 – Summary of project settings

4.2. Programming and Configuring the Device


The FPGA device must be programmed and configured to implement the designed circuit.
For this lab, we will be using a mode called JTAG Programming to program the device.
Step 1: Flip the RUN/PROG switch into the RUN position.
Step 2: Select Tools  Programmer from the menu to reach the window in Figure 10.

8
CPE206 – Digital Laboratory

Figure 10 – The Programmer Window


Here it is necessary to specify the programming hardware and the mode that should
be used. If not already chosen by default, select JTAG in the Mode box. Also, if the
USB-Blaster is not chosen by default, click the Hardware Setup... button and
select the USB-Blaster in the window that pops up, as shown in Figure 11.

Figure 11 – Hardware setup window


Observe that the configuration file binary_counter is listed in the window
corresponding to Figure 10.
If the file is not already listed, then click Add File… and add the
binary_counter.sof file.
Click on the Program/Configure check box.

9
CPE206 – Digital Laboratory

Make sure that the device is connected to the computer using the USB cable, is
powered on, and the PROG/RUN switch in on the RUN position.
Step 3: Now, press Start button in the window in Figure 10. A Blue LED on the board will
light up when the configuration data has been downloaded successfully. If you see an
error reported by Quartus II software indicating that programming failed, then check
to ensure that the board is properly powered on.

5. Testing the Designed Circuit


Having downloaded the configuration data into the FPGA device, you can now test
the implemented circuit. Flip the RUN/PROG switch to the RUN position. Set SW0
to 1 to enable the counter. Press KEY0 to verify that the counter counts as intended.
Make a Table indicating the pattern of LEDs with each pulse applied. Change the
position of SW1 and repeat.

Note:

You do not need to submit a report for this lab session. However you need to demonstrate
your circuit to the Technical Staff before leaving the lab.

Acknowledgements
This tutorial is based on material (from CDs, website, publications, etc.) published by Altera.

10

You might also like