CSC270 Lab #9
Experiment #1: Observing the execution of 6800 instructions
You should have the code of the small program you had to write for last lab. You will be using this program today.
To complete this lab, make sure you also have available the handouts titled "7-14|Unit Seven --- Microprocessors" with the timing diagram of a small program (LDAA #7, ADDA #21, STAA 01), and "Appendix B, Summary of cycle by cycle operation".
The goal of the series of steps below is for you to reconstruct the timing diagram of the execution of the program, while observing only a couple of signals at a time with the oscilloscope.
Probing Signals:
Step 0
Get the microprocessor kit and an oscilloscope and a case of wires.
Step 1
Enter the hex values produced in the tasm listing of your program,
using the procedure from lab8.
Start the program running (using the D or Do command). Do not forget
to hit RESET to return to the kit's "Command Level."
Step 2
The first signal we want to probe is ø2 (Phi-2). It is one of several signals generated by the processor that are available from wiring blocks on the kit. ø2 can be picked up on a small 8-hole block, just above the row of 8 LEDs, next to circuit U4, as shown in Figure 1 below. (Note: By the way, LINE is a digital (0 to 5V) signal that is extracted from the power supply of the kit, and that beats at 60Hz, the same frequency as the 110V current distributed by the AC outlet.)
The second signal we'll watch along with ø2 is R/W'. Connect ø2 to one probe of the scope and R/W'to the other probe, and observe them. R/W' is located on the top right hole of the small 8-hole block that is way on the left above the small breadboard. Make sure you select R/W' as the source for the trigger, otherwise your display will not be stable. (Why should you set R/W' as the source and not ø2?)
Use the timing diagram shown on the last page of this lab to record ø2 and R/W'.
Can you recognize the infinite loop of your program? What element of the display unequivocally defines the loop?
How long does your loop last (use the scope time-cursors or a function from the time menu to measure this time)?
How often does your loop repeat in one second (here again make the scope give you the answer)?
Side step:
benchmark programs and MIPS ratings
If we were to assume that your loop is representative of most programs running on 6800 processors, then we can use your program as a benchmark. A benchmark is a test program that can be used as a yard stick for measuring the average performance of a comp uter system. The performance we are interested here is the MIPS rating of the 6800. MIPS stands for Million Instructions Per Second.
The idea here is to count the number of instructions executed in 1 second, and to use this number as a measure of how powerful the processor is. Since you know how many instructions are executed in your loop, along with the number of loops that execute in 1 second, you can compute how many million instructions execute in 1 second. What is the MIPS rating of the 6800? Compare it to the MIPS rating of the following computers:
Computer | MIPS |
---|---|
Motorola 6800 (1 MHz) | |
PS/2 Model 50 (80286) | 2 |
80386DX computer | 11.4 |
80486DX4 computer | 70.7 |
Pentium 66MHz | 112 |
Pentinum 133MHz | 218.9 |
Cray Y-MP (supercomputer) |
2,600 (2.6 GFlops, or Giga floating-point operations/sec) |
Impressed?
Step 3:
The next signal you need to observe is VMA. VMA will be 1 whenever the processor is accessing memory, and will be 0 when the processor is involved with an internal operation. Because you can only observe 2 signals at a time, you will have to observe VMA with R/W', then VMA with ø2, and record it in the timing diagram so that the relationship between all three signals is reported accurately. VMA is located in the same 8-hole block as ø2.
Step 4:
The next step is to observe the behavior of the address bus during the loop. There are 16 bits of addresses, but since your program fits in only a few bytes of memory, most of the memory address bits remain the same during the program. Only the low-sign ificant bits change. For this reason we can simplify our task by monitoring the one that changes most: A0. (Find A0 over between the 4 and 7 of the hex keypad). A0 is the least significant bit, and will be 0 when the processor accesses an even address, and 1 otherwise.
Connect one probe of the scope to A0. What other signal do you need to monitor at the same time to get a clear picture of when A0 changes during the loop?
Record the behavior of A0 on the timing diagram.
Step 5:
We will use the same technique to record the behavior of the data bus: We will only observe D0. Connect a probe to D0 and record its behavior in the timing diagram.
Make sure you get to see R/W' and D0 at the same time. Why is D0 both high and low during the short time that R/W' is low?Putting it all together
Once the timing diagram is complete, isolate the cycles corresponding to individual instructions, and reconstruct the execution of the instructions on your timing diagram. Indicate in each cycle what is happening with the processor-memory system.
You can use the diagram below if it fits your needs, or another one with more cycles, and clearly block the cycles corresponding to each instruction of your program, and write at the bottom of each column what happens during the cycle (e.g. "op code fetch", "1st byte operand fetch", "internal cycle", etc.)