Topic | Reading | Recommended Exercises |
---|---|---|
Assembly Programming | DDCA 6.2, 6.4-6.4.5 | Exercises 6.1, 6.3, 6.11-6.12 After the lab: Questions 6.1, 6.2, and 6.4 (and the others, if you want practice) |
Machine Code | DDCA 6.3 | Exercises 6.7-6.10 |
Last week, I told you we'd be looking into pipelining this week, but after some thought, I've changed the plans. We'll be looking at assembly in lab next week, and I think it would be helpful if the readings for assembly were to happen first. Also, this will get you a week or two to catch up if you are behind. The pipelined design builds very directly on last week's material, so delaying the topic will get you some extra time to review the single cycle design. Also, we can use the topic of assembly itself to review the single cycle hardware.
So, for this week and next week, we will shift focus away from the hardware and toward the interface with software. We'll be studying two kinds of software: assembly, which is human readable and usually created from a higher-level language like C, and machine code, which is represented in binary (usually not human readable ...) and usually generated from assembly.
Next week, we'll continue to delve into assembly programming. We will look at functions and their relationship to compilers (via compilation) and the operating system (as system calls). The study of architecture really ties together the systems disciplines, and we'll see that when we study the interaction between hardware, code (compiler), and operating system.
The reading about assembly is split into two pieces, with a section about machine code in the middle. Section 6.2 provides a high-level description of assembly instructions. 6.4 uses assembly to build higher level constructs, like branches and loops, using assembly.
Much of 6.2 should look familiar (particularly after last week), so don't read in detail: just look at the Code Examples to get a feel for the important points. (Code Examples 6.7 and 6.8 are particularly important, since they introduce syntax for accessing memory.) By the end of Section 6.2, you should be able to look at an arbitrary assembly instruction and know what it is supposed to accomplish, what values it uses to do so, and where the result will be stored. After you have a sense of what assembly looks like, find the 4 design principles the section introduces in the text and reflect on how they are demonstrated in the MIPS architecture.
We're only reading the first half of Section 6.4 (through 6.4.5, arrays) this week. We'll complete this section next week by talking about functions. Like Section 6.2, the Code Examples are particularly important. Don't read the text. Instead, spend start with the Code Examples (especially 6.16-6.22) and use the text, where necessary, to help you understand what each example is demonstrating.
Section 6.3 explains how MIPS instructions are encoded into binary -- and how the regularity of that encoding lends itself to a easy decoding in hardware. We introduced this idea in lecture last week, when we identified the signals that would be produced by the decoder for each signal. Now, your job is to see how the instruction format simplifies the design of the decoder.
Make sure that you can name the three instruction formats and, given a description of their format, that you can encode an assembly instruction as machine code (and vice versa). This MIPS reference card provides all of the tables that you need to do these translations in one convenient location.