This course endedDecember 18, 2018 |

## CPSC 220: *Computer Architecture*

Department of Mathematics and Computer Science Hobart and William Smith Colleges Fall, 2018. Instructor: David J. Eck (eck@hws.edu) Monday, Wednesday, Friday, 10:10–11:05 PM, Room Gulick 2000. Lab: Thursday, 1:30–2:55, Room Rosenberg 009. Course Handout: http://math.hws.edu/eck/courses/cpsc220_f18.html

### First Week: August 27, 29, and 31

Welcome to the course!

The reading for the first week is Chapter 1, Sections 1 through 4, and Chapter 2, Section 4.
(All readings are from the textbook, *Computer Organization and Design ARM Edition*,
unless otherwise noted.) You should read Section 2.4 before the lab on Thursday.
You should also read the lab handout before the
lab, especially the material on Java bitwise and shift operators (if you are not already
familiar with them).

### Second Week: September 3, 5, and 7

We will work mostly on the ISA for the Larc model computer this week, and Thursday's lab will ask you to write some machine language programs for Larc. We will talk about Section 1.6 from the textbook on Friday, and that is the last we will see of Chapter 1.

The reading for the week is Chapter 3 of the Larc manual, which will be handed out in class on Monday, and Section 1.6 in the textbook. You should also read the lab worksheet before the lab on Friday. A link will be posted on this page by Tuesday afternoon.

As announced in class, I have to cancel my 11:15 to 12:10 office hours this week. However, I will have extended afternoon office hours: Monday, Tuesday, Wednesday, and Friday, 1:30 to 4:00.

### Third Week: September 10, 12, and 14

You will start Lab 3 this week. Lab 3 asks you to write a functional simulator program for the Larc computer in Java. We will spend some time on Monday this week talking about what that means. Remember that Lab 2 is due next week, and Lab 3 is due the week after that.

We never did get to Section 1.6 last week, so we will need to spend some more time on Chapter 1, but after that we will move on to Chapter 2 and the ARMv8 architecture and assembly language. The new reading for the week is Sections 2.1 to 2.3.

### Fourth Week: September 17, 19, and 21

Reminder: There is a test coming up next Wednesday, September 26.

We will continue to work on ARMv8 assembly programming, from Chapter 2 in the textbook. The reading for this week is: Section 2.6, Section 2.7, Section 2.8 pages 100 to 103 only, and Section 2.9. [Although it was originally in the assigned readings for this week, we will not cover any part of Section 2.8 at this time; we will come back to it later.] This material covers branches, logical operations, simple function calls, and string representation. Section 2.5, which covers machine language, is optional. I will talk about ARM machine language briefly in class, but you will not be responsible for learning it in detail. You read Section 2.4, on binary numbers, at the beginning of the semester, but you might want to review it now.

Lab 2 is due on Thursday. You should submit your machine language
programs in a folder named *lab2*, and place that folder in your homework directory in */classes/cs220/homework*.
I will not collect or print the files until after the lab, but I will not answer any questions about Lab 2 during
the lab period on Thursday. You should come to office hours if you have questions.
Lab 3 is due next week. There is no new lab this week. You can work on Lab 3
during the lab period on Thursday.

### Fifth Week: September 24, 26, and 28

There is a test on Wednesday, April 26. A study guide was handed out in class.

Because of the test, Lab 3 will not be due until Monday, October 1.

On Monday of this week, we can review for the test and do some of the sample problems from the study guide. If that doesn't fill the period, we will move on to new material.

Starting this week, we will be working on logic circuits and seeing how to use them to implement the basic parts of a computer. We will use a logic circuit simulator program named LogiSim. The eventual goal will be to build a full simulation of a Larc computer in LogiSim. The readings for the next couple of weeks will be from Appendix A in the textbook. You can start by reading Sections A.1 and A.2.

### Sixth Week: October 1, 3, and 5

We will be working on logic circuits all this week. For at least Monday and Wednesday, we will look at combinational logic circuits (which have no feedback loops). The reading on this material is in Appendix A, Sections 1, 2, 3, and 5. On Friday, should move on to sequential circuits, which are used for memory.

Lab 3 is due by noon on Tuesday. You should turn in your Larc simulator in
a directory named *lab3* in your homework folder. Lab 4 is due on
Thursday. You should turn in the file *lab4.S* to your homework folder.

### Seventh Week: October 10 and 12

There is no class on Monday because of Fall Break. On Wednesday and Friday, we will continue out discussion of logic circuits. We will also need to talk about multiplication (and, while we are at it) division of binary numbers.

The reading for the week is Sections A.7, A.8, 3.2, and 3.3.

My solution to the LarcSim programming assignment (Lab 3)
is available in the file */classes/cs220/LarcSimComplete.java*.

### Eighth Week: October 15, 17, and 19

The labs for this week and next week will ask you to construct a simulation of a Larc comptuter in Logisim. We will discuss how to approach that problem on Monday. We will spend the rest of the week discussiong integer division, floating point numbers, floating point arithmetic, and ARM floating point instructions. The reading is Sections 3.4 and 3.5 (but you are not responsible for all of the details in those sections).

### Ninth Week: October 22, 24, and 26

Last week, we only got as far as discussing the IEEE 754 standard for 32-bit floating point numbers. We start this week by looking briefly at floating point addition and multiplication and some issues that arise when using floating point numbers (such as the fact that addition and multiplication are no longer strictly associative). We will spend the rest of the week on ARMv8 assembly. We will cover the "S" and "D" registers and ARM instructions for working with floating point numbers. We will also look at addressing modes and the LDR and STR instructions. And if there is time, we will look in more detail at how to work with 8-bit bytes, 16-but half-words, and 32-bit words, as opposed to the usual 64-bit double-words.

Floating point numbers are covered in the book in Section 3.5, but note that we will not cover circuits for floating point arithmetic. Also note that the "LEGv8" floating point instructions in the textbook differ from the actual ARMv8 instructions by adding an "S" or "D" at the end of the instruction mnemonic that is not present in the ARMv8 instructions. Addressing modes for LDR and STR are discussed in Section 2.19, along with some new integer arithmetic instructions.

There is a test next week, on Wednesday, October 31.

### Tenth Week: October 29 and 31; November 2

There is a test on Wednesday. A study guide was handed out in class.

Aside from the test, we will continue talking about ARMv8 assembly. The next topic is implementing subroutine calls in assembly and using the stack pointer. The reading is Section 2.8.

### Eleventh Week: November 5, 7, and 9

We will continue with ARMv8 assembly this week. The main goal is to fully understand how subroutine calls work, and how the stack is used in their implementation. This includes understanding how recursive functions are actually implemented. We will also discuss the conventions for using the various registers in subroutines.

### Twelfth Week: November 12, 14, and 16

We start the week with a discussion, begun last Friday, of an assembly language and assembler for the Larc model computer. On Wednesday, a handout will be distributed in class about the assembly language, and the lab assignment for Thursday is to begin work on a Larc assembler.

The rest of the week is devoted to pipelining in CPUs. This is an advanced architecture topic, and we will only be studying general ideas about pipelining and pipeline hazards. We will talk a bit about how pipelining could be added to the Larc-in-Logisim project. The reading is Section 4.5 in the textbook, plus the last page of 4.4, the first three pages of 4.10, and the first four pages of 4.11. It wouldn't hurt to look through the rest of the chapter, especially at some of the diagrams (which are about a small subset of ARMv8 but are similar to what would be done with Larc).

There is no class next week because of Thanksgiving break. Have a great Thanksgiving!

### Thirteenth Week: November 26, 29, and 30

We continue our series of brief looks at advanced topics. This week's topic is caching and the memory hierarchy, which is covered in Chapter 5 in the textbook. The required reading is Section 5.1, Section 5.3, and Section 5.7 up through page 453.

You might also be interested in looking at Section 5.2, which talks about the different types of computer memory; Section 5.6, which is a brief introduction to virtual machines; and Section 5.13, which lists some facts about caches and translation lookaside buffers in the ARM Cortex-A53 and Intel Core i7. However, these sections are entirely optional.

We will spend the week looking at caching in general and memory caching in particular. including virtual memory and memory protection.

In lab this week, you will continue work on the Lasm assembler, which was begun in Lab 11.

### Fourteenth Week: December 3, 5, and 7

We have agreed that the final lab this Thursday will not require any new work. You can use the lab period to continue work on the Lasm assembler project. Furthermore, that project is due on the last day of class, Monday, December 10, by 3:00 PM.

We have been looking at some of the ways that modern computers achieve their great speed. So far, we have discussed pipelined instruction execution and the memory hierarchy. In the final segment of the course, we will be looking briefly at parallel processing in multicore CPUs, GPUs, and computer clusters. The material is covered in the book in Chapter 6. However, there is no assigned reading for this material.

### Fifteenth Week and End of Semester

We meet on Monday for the last class of the semester. I will do some problems and answer questions about the final exam.

The exam is at 7:00 PM on Tuesday, December 18. A study guide for the exam was handed out in class on December 7.

Your program for the Lasm project (Lab 11) is due by 3:00 PM on the last day of class, December 10.

Here are my office hours for the rest of the semester:

Tuesday, December 11: 12:00 – 3:00 Thursday, December 13: 12:00 – 3:00 Sunday, December 16: 11:00 – 3:00 Monday, December 17: 12:00 – 3:00 Tuesday, December 18: 11:00 – 3:00