UNIVERSITY OF CALIFORNIA, DAVIS
Department of Electrical and Computer Engineering
DIGITAL SYSTEMS I
Quartus II Tutorial
This tutorial illustrates several advanced topics that were not covered in Lab 1.
include creating symbols for use in a hierarchical design, using Altera parameterized modules,
such as a ROM, and initializing ROM contents.
In this tutorial, you will design a circuit that computes the Fibonacci sequence using an adder
(The Fibonacci sequence is 0, 1, 1, 2, 3, 5, 8, .
The data path will be 8-bits wide
so that the circuit can be easily tested using the Altera Education Board. (If you thought a
sequence of numbers could never be very interesting or have any applications, read up on the
Fibonacci sequence—google it or check out
USING PARAMETERIZED MODULES
File>New Project Wizard…
in order to create a new project. On page 1 of the dialog
boxes, select a new project directory, and name the project and the top level entity “
page 3, select ‘
’ as the device family, select ‘
Specific device selected in ‘Available
’ for the target device, and select ‘
’ from the list of available
devices. You can click ‘
’ to see the remaining pages and configuration summary. Finally,
Open a new schematic and save it as ‘
’. You will be designing the schematic shown in
Figure 1. First, select the component
from the megafunctions/arithmetic library.
The MegaWizard Plug-In Manager should come up to allow you to configure the parameters and
ports. If given the option, select the type of output file that will be created to describe your lpm
modules as Verilog. Check the box that says “
Don’t ask me for an output file name or the
output file format again.
” On page 1, select
as the currently selected device family
(or make sure the “
” box is checked). Also select the data buses to be
bits wide and the operating mode to be “
”. On page 2, allow both ‘dataa’ and
‘datab’ to vary and select ‘
for the type of addition/subtraction. On page 3, select
Create a carry input
’ and ‘
Create a carry output
’. On page 4, accept the default
configuration that the module will not be pipelined. Finally, select “Finish” on the last page to
complete the configuration. Place the
component near the middle of your
schematic page as shown in Figure 1.
If you need to change any parameters or port declarations after you have closed the wizard,
double-click on the lpm_add_sub component on your schematic. This will re-open the wizard so
that you can make corrections.
The adder will be used to add the last two numbers in the sequence to produce the next number.