CPR E 210  Lab 13

A Simple Computer

13.0Objectives

In this lab, we will be constructing a very simple computer based on the components we designed since Lab 10. The block diagram of the computer is shown in the figure below.

Figure 13.1: Block Diagram of a Simple Computer

The main objective in this lab is to construct the computer as shown in the diagram above and test that it works.

13.1A Simple Computer

Before we go any further, let’s first restore the files we zipped from Lab 12. Un-zip the zip files into C:\CprE210\Lab13\Lab13Step1\. After all the files are in the correct folder, open the file COMPUTER.gdf and set the project to current file. If the design has been done correctly, it should consist of IMEM, RegFile, 4bALU, and a 4b2x1MUX. Refer back to your previous lab to complete them if one or more symbols are missing.

In this file, first insert a Program Counter (PC) symbol that was created in Lab 10. The output of PC should be connected to the Address of IMEM. Then 4 additional input pins are to be created for the PC, and named accordingly.

Once this is done, run a simulation waveform for this design. Note that two previous waveform was generated based on this design in Lab 12. Make use of the previous waveform and save it with a different name. The new signals are to be added and the old one is to be removed from the waveform. Print out a copy of the waveform for reference in the next step.

Next, a Controller is to be created using a state machine. This Controller should supply all the control signals to the computer. The only signals that the Controller will take as inputs are CLK, and CLEAR. The Controller should be looping at its final state and maintain the result. In order to do this, the PC should NOT be incrementing upon the last state. Connect the Controller into the computer design, and run a waveform editor. Demonstrate the waveform to your lab instructor.

The final step is to program this computer onto the UP1 Board. To do this, add a seven-segment display to the output. Next, compile the design, run the Floorplan Editor, and complete the pin assignment. Upon completion of this, download the design to the board. Make sure that proper inversion are done for all input and output pins. Demonstrate the working circuit to your lab instructor. The correct result is to see a value “5” upon power up. The CLEAR pin does not reset the computer; it only reset the state machine. To reset the computer, disconnect the power supply and reconnect it.

13.2Application (Fibonacci Computer)

Fibonacci Series is a series of number where Ni = Ni-1 + Ni-2. The first few numbers of the series are: 1, 1, 2, 3, 5, …, etc.

Modify the IMEM and Controller so that it will load a number “1” and compute the corresponding number in Fibonacci Series before the series exceed the value 15 (Maximum value represented by a 4-bits binary number). The computer should stop at the biggest number in the series before 15 and loop by itself, showing the biggest Fibonacci number that can be computed using this Computer. Manually decide when a number will be greater than 15, and loop the result by itself. The controller should only have 8 states in total: S0 ... S7.

After modifying the IMEM and Controller, add a SlowCLK symbol from the library and compile the design. There should be an extra STEP pin for SlowCLK. Download the circuit to the UP1 Board and demonstrate it to your lab instructor.

13.3Finishing Off

Close MAX+PLUS II Software, delete the folder C:\CprE210\Lab13\ completely and empty the recycle bin. Then, extract the file C:\Download\CprE210\210Lab13.ZIP to the folder C:\CprE210\ for the next lab use. Sign and turn in the answer sheet for Lab 13. This completes the lab session for the whole semester. (Note: 13.2 are optional )

You have earned the first step towards a successful computer engineer. Bravo! 

1