CSE 140L Lab 1 HW-SW intro

CSE 140L Lab 1, Part 2 – Hardware and
Software Introduction Tutorial
Fall 2010, Professor CK Cheng, TAs Gopi Tummala, Shams Pirani, Vikram Murali
In this introduction, you will install the Quartus II software on your machine. You will also
review the hardware board that is included in your kit.
Step 1 - Download and install Quartus II Software
1.1. Go to http://www.altera.com/products/software/quartus-ii/web-edition/qts-weindex.html This is the webpage for the Quartus II software from Altera. Feel free to read
through some of the links to get better acclimated with the program and what it offers. Click on
the download link, and download the Quartus II Web Edition (v10.0) software for Windows. You
will need to fill out that form. Note, you might as well make an account with them, as this helps
when you are applying for the Quartus II license. Note it does take a while for them to email
you, less than an hour. Do not install the version on the CDROM because that is an older
version of Quartus II.
1.2. Install Quartus II software. Go through the installation procedure and install the complete
program. This takes a while so feel free to surf the web and procrastinate on your other
homework while you wait.
1.3. Run the program. When it prompts you for Look & Feel, choose Quartus II. You should then
see a pop up screen asking you to create a new project, or open interactive tuturial. Feel free to
check out the tutorial. You can close that screen too.
1.6. Connect board to your computer using the USB cable. Your computer should automatically
install the drivers for the USB Blaster. If you need to manually specify the location for the
driver, it should be in your quartus II folder under drivers, so when Windows propmts you to
add the new hardware, go to c:\altera\90\quartus\drivers\usb-blaster\. Check out DE1
installation tutorial if you have problems with this part.
Step 2 - Hardware Review
Let's review the hardware board. Please browse through the included instructional booklet. In
particular, you will want to read over the pages describing the CycloneII FPGA and the pages
describing the 4 push buttons, the 10 input switches, and the 4 digit 7 segment display. The DE1
board has the CycloneII EP2C20F484C7N, and the DE2 board has the CycloneII EP2C35F672C6N.
What's the difference? Not much really, the DE2 FPGA is a little bit more powerful but it's the
same family of FPGAs.
Here is a picture of the board:
For this project, these are the parts we care about. We have 14 inputs (push button 0, push
button 1, push button 2, push button 3 and each of the 10 input switches), and we have 28
outputs (each of those segments is an output, so we have 4 digits * 7 segments). Please review
the instruction booklet to see what these inputs and outputs are actually named. This is
important, as when you start designing your own combinational logic, you will refer to these
inputs and outputs when you want to target the specific line segment or switch.
Here is a basic logic diagram of the board.
Let's look at the push button. In it's normal state (that is, when you don't touch it), the push
button sends an input of 1 to the FPGA. When you push down on it, the input becomes a 0.
Note: this is kind of opposite to what you would think it should be (i.e. you would think that
pressing down should send a "1"). The board is designed this way though so you will just have
to get used to how it works.
Let's examine the 10 input switch now. When the switch input is "up" it sends a value of 1 to
the FPGA, and when you push down on the switch input, it sends a value of 0 to the FPGA.
Let's also look at the outputs. There are four digits (digit0 to digit3) but we will only look at
digit0 here.
You see there are 28 outputs in all, from Digit 0 Segment A to Digit 3 Segment G. What does
that mean? Well let's look at the display segments. The segment display is your typical display
for numbers. Your cheap alarm clock will have this format. So let's say we want to turn on
certain segments and turn off the others. Well, when the output to that particular segment is 1,
nothing will be shown, but when the output is 0, that segment will light up red! So let's say you
want to display 5 on digit 1, and nothing on digit 2, digit 3, and digit 4.
So what do we do? We simply need to set all segments to high, except Digit 1 Segment A, F, G,
C, and D. Those segments we set to 0. Thus, we get the 5! This is of course very basic and
simple. You will learn how to control these outputs, depending on the inputs, by making
combinational logic circuits. Okay that is our quick review of the board. You will learn mode in
detail as we go along, such as what it means exactly to set something to low, and to set
something to high. But if you are already lost, please review this section until you have a decent
idea of what we are talking about.
Note: You might be confused as to why you set the segment to high to turn it off, and to low to
turn it on. It just happens to be the way the board is set. This is why it is important to read
datasheets, since many times things are reversed from what you think is logical. It would make
more sense to have an output of low equal to "off" but in this board, it just happens to be
opposite.
At this point, you should be pretty familiar with the hardware. Please refer to the instruction
booklet for more details on your board. In the next tutorial, you will learn to use the Quartus II
software with the FPGA board.