Lab 1: Number Sequencing Computer

This lab covers some basic concepts in computer architecture by creation of a Number Sequencing Computer (NSC), which is a stored program machine that displays a number sequence. This write-up covers the NSC implementation compatible with Quartus 10.1 or higher. The student is expected to have Quartus already installed. This write-up also assumes the reader is already familiar with the basic operation of the NSC from the class lecture.

The tasks in this lab are:

As always, read through the entire lab and scan the supplied files before starting to work.

If you have not installed Intel Quartus and Modelsim, visit the Lab 0 page to download them.

Pre-lab (20 points)

Follow along with the video tutorial and complete the pre-lab checkoff requirements below before you enter the lab. Note that Quartus and ModelSim should already be installed on your computer and tested. If you experience technical difficulties, notify a TA well before the lab begins so these issues can be resolved ahead of time. Waiting until lab time to discover that your software has become inoperational or that you cannot view the video means that you will forfeit your pre-lab points. Please see the lab policy summary for further details. 

The tutorial video walks you through the prelab, (which is also Task 1 and the first part of Task 2). The video, while still relevant, is from 2011, and uses slightly older software. Note the following:

Checkoff:

(Note: There is nothing to hand in for this or any pre-lab. The TA checks it off at the beginning of lab.)

Task 1: Modify the NSC to display your number (20 points)

Open the myrom.v file within Quartus. Edit the Verilog code in the case statement to alter the contents of the ROM so that it contains a program that displays your 7-digit phone number. You should also alter the comments to reflect your code changes: If you change a digit from 0011 to 0111, the comment next to it should say "3" not "7". Save your file after the edits are finished, recompile the design, and re-simulate. Verify that the displayed number is now your 7-digit phone number. 

Checkoff: Show a TA the ModelSim simulation displaying your phone number. If there's no TA around (i.e. you're doing the lab at home) and you're already on Task 2, you'll get the checkoff for Task 1 as long as you show that you've edited myrom.v with your own number.

Task 2: Modify the NSC to support 32 locations (40 points)

Expanding the NSC design to support 32 memory locations requires several changes. 

Modification of myrom.v

Double left click on myrom.v to open the text editor on the Verilog file.

Once the edits to myrom.v are finished, save the file and create/update the symbol in nsc.bdf as shown in the video. 

Modification of mycounter.v

The counter has to be changed from a 4-bit counter to a 5-bit counter.

Verify that the file analyzes without any errors (Processing -> Analyze Current File), then re-create the symbol for this component as you did for myrom.v and update the symbol on the schematic.

Modification of nsc.vt

You will need to edit the test bench in the file nsc.vt (Verilog testbench file) to change its width from 4 bits to 5 bits. This will allow you to see the entire 5 bit address within ModelSim.  

Other modifications

Resimulate the design and verify that your program is executing from locations in the top half of the memory (memory locations 16 to 31) and that the correct number sequence is displayed. Make certain that your addresses 0-31 are written in decimal in the simulation - if necessary, right-click on the variable name and change the radix.

Checkoff: Show the TA your ModelSim simulation performing properly. It should look like the following, except with your number, not Jenny's:

Tips

Report

See Lab Policy Summary for formatting guidance and a sample brief report.

Before

After

Just like in the original program, next to each line of machine code (the binary) should be a comment containing the correct line number and assembly code that accurately states what the machine code does.

Comments wrong/missing and line numbers wrong

Comments and line numbers are correct

2. Include a screenshot of your schematic (nsc.bdf) for Task 2. Make it large enough to be legible and crop unnecessary portions of the Quartus screen.

3. Briefly discuss the changes made to the number sequencing computer for Task 2 and the reasoning behind the changes.

4.  Assume a new instruction is needed called 'INC' that will increment the current value in the OUTPUT register. What changes are required to the decode logic and overall design to implement this? Show a sketch or rough schematic of the necessary modifications. There is more than one correct solution.