CptS 260: Introduction to Computer Architecture

WSU Tri-Cities
Fall, 2021

Document Update History

Date Update
11/9 added Veteran's Day holiday
11/1 shortened cybersecurity unit
10/28 clarified contact information for IT
10/24 added Final Exam date and time
10/14 moved due date for HW5 from 10/26 to 10/28
9/22 pushed back due date for HW3
9/17 included information on printing hard copy listings from campus and a clarification on resumbissions
9/16 updated results on homework submission
9/14 altered schedule for weeks 4 and 5
8/23 initial publication

Instructor

Bob Lewis
Associate Professor, WSU TC
Office: Floyd 134D
Campus Phone: 2-7178
Off-Campus Phone: (509) 372-7178
Cell Phone: (509) 374-7520
Personal Zoom: https://wsu.zoom.us/j/5635500668
Email: bobl@wsu.edu (Be sure to include "cpts260" in the subject line of all course-related correspondence.)
Web Page: http://www.tricity.wsu.edu/~bobl
Office Hours: W 3-5pm, or by appointment (personal Zoom will be available)

System Administration

Our systems are administered by the campus Information Technology group. Their contact information is:

Office: CIC 225
Phone: (509) 372-7334 (on campus: 2-7334) (M-F 8am-5pm)
Email: tchelp@wsu.edu (any time)

Contact IT if you have questions regarding your CSLab account.

Also inform IT if you are unable to log into the elec or mips systems (see below).

Lecture

TuTh 2:55-4:10pm, Collaboration 202

Goals

The goals of this course are to provide Computer Science students with the knowledge of computer hardware they need to design and implement effective, efficient, and safe software and to de-mystify computers in general.

Objectives

Students who complete this course should be able to perform the following tasks:

Course Description (from catalog)

260 Introduction to Computer Architecture 3 Course Prerequisite: CPT S 223 with a C or better or concurrent enrollment. Computer systems architecture; logic, data representation, assembly language, memory organization and trends.

Prerequisites

The official prerequisite (which may also be a co-requisite) for the class is CptS 223 (Advanced Data Structures). It is also highly recommended that students have either taken or be concurrently enrolled in CptS 224 (Programming Tools) or had considerable experience with a command line interface prior to this class. Familiarity with the gdb debugger is particularly useful. Although little high-level programming will be done in the class, analogies will be drawn that assume a knowledge of C or C++.

The course makes use of the binary and hexadecimal number systems. Most students have encountered these in previous math classes, but it is highly recommended that all students review this material. An excellent resource for this is available at no cost from the Khan Academy The number systems lectures are here .

Resources

Text

Harris and Harris, Digital Design and Computer Architecture (2nd. ed.), Morgan Kaufman, 2013.

This is available at the WSU Tri-Cities Bookstore.

Reference

Patterson and Hennessy, Computer Organization and Design MIPS Edition, (6th. ed.) Morgan Kaufman, 2020.

The authors are the 2017 recipients of the ACM A. M. Turing Award, the Computer Science equivalent of the Nobel Prize.

Web Page

http://www.tricity.wsu.edu/~bobl/cpts260

Programming Resources

The course will be taught using the Linux (e.g. Ubuntu) operating system.

Most programming assignments will be in MIPS assembly language. We have several MIPS virtual machines available for remote login, so you can access them from your laptop. To do this:

  1. Remotely log in to the compute server elec.tricity.wsu.edu (hereafter elec) via ssh(1), MobaXterm, or putty. (This system runs Ubuntu Linux.)
  2. Log in to the mips system via ssh.

The mips virtual machine is slow. Login takes several seconds. Since your directory is shared on both mips and elec, you may want to open a second ssh session on elec for editing files.

See http://www.tricity.wsu.edu/cs/connecting for additional information on remote login.

We also have several properly-configured Lubuntu/Xubuntu Linux workstations in CSLab (East 118). You can remotely log in from one of them to the mips system via ssh.

Note: CSLab is moving and is under renovation but should be open soon.

If you do not already have a CSLab login, contact the System Administrator . This will allow you to log in to both elec, mips, and the CSLab systems.

Home directories on both systems are shared via NFS (Network File System), so files you edit on elec are immediately available to assemble and run on mips.

Test this now so you'll be ready for the first homework.

MIPS Hardware Emulation: The mips System

We will be learning the MIPS assembly language. mips is actually a collection of virtual machines ("VMs"), each one emulates MIPS 32-bit processor hardware and runs a subset of the Debian Linux distribution.

As noted above, you may log into it from any campus system (including elec) with ssh (e.g. "$ ssh mips").

We will demonstrate how to use this system in class and provide "makefiles" to simplify assembly and linking. During grading, your homework will be assembled, linked, and run on the mips system.

mips supports the gdb(1) debugger. Here is a short PDF guide on using the gdb with assembly language. (Be careful: This guide was not written for the MIPS, so things like register names are different.) There's more information here . By default, gdb runs in conventional scrolling terminal mode, but it also has a "text user interface" (TUI) mode that displays code and registers in-place. It's documented here . Using gdb (with or without TUI) is optional, but if you come to instructor, one of the first questions he will ask is "What do you see in gdb?"

You may find some on-line references to programming the MIPS with an software-only emulator such as spim, QtSpim, or MARS.

Do not use them.

Software-only emulators provide some pseudoinstructions that won't work on the mips and, more importantly, mips lets you do many things that the emulators cannot do. (This may be a unique feature of this course.)

You are specifically cautioned against using MIPS code from on-line repositories. This code is often designed for an software-only emulator and the grader can usually detect this. Using code that you did not write yourself is a violation of academic integrity and will be dealt with as described below. If you get stuck, contact the instructor.

Lecture Notes and Supplemental Materials

In the schedule below, there are hypertext links for each unit which will take students to a directory of supplemental materials for each lecture, including the notes as marked-up in class (as a "notes.pdf" file).

These directories are initially non-existent. They will be created and material will be added to them shortly before or after the corresponding lecture(s).

If you are unable to access materials, please contact the instructor.

Outline

These are the units we will cover in the course together with the approximate number of weeks we will spend on them.

  1. Introduction (0.5 week)
  2. Machine Instructions (2 weeks)
  3. Computer Arithmetic (1 week)
  4. Digital Logic and Digital Systems (2 weeks)
  5. Processor Architecture (2.5 weeks)
  6. Memory System Organization and Architecture (2 weeks)
  7. Interfacing and Communication (1 week)
  8. Multiprocessing (1 week)
  9. Cybersecurity (1 week)
  10. Alternative Architectures (0.5 week)

The amounts of time indicated are approximate and may vary slightly from term-to-term, depending on holidays.

Readings are in Harris and Harris unless otherwise indicated. ``--'' means a continuation of the previous topic. This schedule will be revised as the course progresses. Note that due to the instructor's absence, some classes may be rescheduled. ``HWn'' refers to Homework #n.

Week Tuesday Topic Thursday Topic
1 1. Introduction
Section 1.1-1.3 (read after class)
2. Machine Instructions
Sections 6.1-6.2
Quiz #1
2 --
Section 6.3
Quiz #2
--
HW1 assigned (due )
3 --
Section 6.4
Quiz #3
--
Sections 6.5-6.7, 6.9
Quiz #4
HW2 assigned ( due )
A Quick Summary of MIPS Assembler Directives
4 -- 3. Computer Arithmentic
Section 1.4
Quiz #5
5 --
Section 5.3
Quiz #6
HW3 assigned ( due )
4. Digital Logic and Digital Systems
Sections 1.5, 1.9, 2.1-2.3
Quiz #7
6 --
Sections 2.4-2.7
Quiz #8
HW4 assigned ( due )
--
Sections 2.8-2.10
Quiz #9
Midterm Review
Study Guide
7 Midterm 5. Processor Architecture
Sections 5.1-5.2
Quiz #10
8 --
Sections 7.1-7.3
HW5 assigned ( due )
--
9 --
Sections 7.4-7.5
Quiz #11
--
10 6. Memory System Organization and Architecture
Section 3.1-3.2
Quiz #12
--
11 --
Quiz #13
HW6 assigned ( due )
--
Section 5.5-5.6
Quiz #14
12 --
Sections 8.1-8.4
Quiz #15
Veteran's Day -- University Holiday
13 7. Interfacing and Communication
Sections 8.6-8.7
MIPS++ Project (optional) assigned (due at 5pm, NO LATE SUBMISSIONS)
8. Multiprocessing
Section 7.8
14 - : Thanksgiving Week, no classes
15 -- 9. Cybersecurity
Ken Thompson: "Reflections on Trusting Trust"
16 10. Alternative Architectures
Harry Porter's (PSU) Relay Computer (video)
Final Review (Study Guide)
Microsoft Research "Quantum Computing for Computer Scientists" (here are the slides)
Quantum Pong -- Programming on Quantum Computers (S1E1)
17 - : Finals Week
Class Final: , 1-3pm, TCOL 202

Grading

The grade will break down as follows:

20% Midterm
30% Final
35% Homework
10% Quizzes
5% Class Participation

Percentage-to-Letter Grade Mapping

The numerical grade is mapped to a final letter grade based on the instructor's subjective evaluation of the overall difficulty of the course, with the following constraints:

A numerical grade
in this range...
... guarantees a
letter grade which
is at least...
90 ≤ grade ≤ 100 A-
80 ≤ grade < 90 B-
70 ≤ grade < 80 C

As the course progresses, the instructor is free to revise these criteria downwards so that, for example, 87% might still result in an A-, but the lower limit of these ranges will not be raised.

Quizzes

There are a series of 15 Canvas quizzes (possibly more) based on the readings. Take them after you have done the assigned reading but before class on the date indicated.

If done in time and all questions are answered, full credit is 100%, regardless of whether the answers are correct or not. Quizzes taken after the indicated date will receive half credit.

These are mainly for self-assessment, but some questions on the midterm and final (which will be graded normally) will be drawn from the quizzes, possibly with slight variations, so knowing the correct answers will be to your benefit.

Homework

There will be several homework assignments in this class, requiring 1-2 weeks to complete. Some of them will require programming with the MIPS assembler. As stated above, a "makefile" template will be provided on the first such assignment to compile, link, and provide a listing (file) of your assignment. Copy and modify that template for later programming assignments.

Makefiles and make(1) are covered in CptS 224. If you have not taken that course and want some help, inform the instructor. We may arrange a group tutorial.

Homework assignments that require code should include your name, course, and semester in a comment at or near the start of the source file. If extra credit is possible and you are attempting it, the extra credit feature(s) you're attempting should also be listed there. In this class, all assignments requiring code are turned in as follows:

  1. Put the source code (*.s) file(s) and the makefile in a "tarball" (we'll demonstrate this in class). The name of the file should include "cpts260", the abbreviated name of the assignment, and your login. As with most tarballs, it should have a ".tgz" or ".tar.gz"extension. For example, the user "ghopper" submitting Homework 3 would submit a tarball named "cpts260_hw03_ghopper.tgz".
  2. Upload the tarball to Canvas as an assignment.
  3. Turn in a hard copy printout of the listing (*.lst) file (produced by the makefile) in class on the due date. (This is so the instructor has something to mark up and return.) It should have the date of submission written on it. Multiple pages should be stapled together. (No paper clips or origami, please!)
  4. You can print hard copies from your own computer to campus printers using the wepa print driver, downloadable from http://wepanow.com/software .

All submitted code will be assembled and linked using the makefile you provide in an otherwise empty directory and run on mips system by the instructor. It is recommended that you try this yourself before submitting the tarball.

Homework turned in after it has been collected, even if due to a late arrival on the same day, counts as late. (This is to discourage skipping class to work on your homework.)

Late homework may be turned in up to one week (exactly) after the original due date. The late penalty is a 10% point deduction.

If a homework assignment is turned in on time and receives a score of 50% or less, the student has a one-week period from the day the homework is returned to resubmit it before the start of class on that date. It will then be graded with a 20% point deduction. The assignment grade will be the maximum of the two grades.

Class Participation

The class will be more participatory than the usual lecture form. There may, for instance, be some group problem solving.

In addition, during class the instructor will pose questions to specific students in a round-robin style. If the chosen student attempts to answer (and, if incorrect, responds to any hints or clarifications from the instructor), they will receive a tally mark. If they do not respond or say "pass" or "I don't know", they will not receive a mark.

Your class partipation grade will be based on your relative number of tally marks.

COVID-19 Policy

Per the proclamation of Governor Inslee on August 18, 2021, masks that cover both the nose and mouth must be worn by all people over the age of five while indoors in public spaces. This includes all WSU owned and operated facilities. The state-wide mask mandate goes into effect on Monday, August 23, 2021, and will be effective until further notice.

Public health directives may be adjusted throughout the year to respond to the evolving COVID-19 pandemic. Directives may include, but are not limited to, compliance with WSU’s COVID-19 vaccination policy, wearing a cloth face covering, physically distancing, and sanitizing common-use spaces. All current COVID-19 related university policies and public health directives are located at https://wsu.edu/covid-19.

Students who choose not to comply with these directives may be required to leave the classroom; in egregious or repetitive cases, student non-compliance may be referred to the Center for Community Standards for action under the Standards of Conduct for Students.

Academic Integrity Statement

All members of the university community share responsibility for maintaining and promoting the principles of integrity in all activities, including academic integrity and honest scholarship. Students are responsible for understanding the full Academic Integrity Statement . Students who violate WSU’s Academic Integrity Policy (identified in WAC 504-26-010(3) and -404) will, at a minimum, fail the assignment, will not have the option to withdraw from the course pending an appeal, and will be reported to the Center for Community Standards. If you have any questions about what is and is not allowed in this course, ask your course instructor.

Students with Disabilities:

Reasonable accommodations are available for students with documented disabilities or chronic medical or psychological conditions. If you have such a condition and need accommodations to fully participate in this class, please visit your campus’ Access Center/Services website to follow published procedures to request accommodations. Students may also contact their campus offices to schedule an appointment with a Disability Specialist. All disability related accommodations are to be approved through the Access Center/Services on your campus. It is a university expectation that students connect with instructors (via email, Zoom, or in person) to discuss logistics within two weeks after they have officially requested their accommodations.

For more information, contact a Disability Specialist on your home campus:

Accommodation for Religious Observances or Activities

Washington State University reasonably accommodates absences allowing for students to take holidays for reasons of faith or conscience or organized activities conducted under the auspices of a religious denomination, church, or religious organization. Reasonable accommodation requires the student to coordinate with the instructor on scheduling examinations or other activities necessary for course completion. Students requesting accommodation must provide written notification within the first two weeks of the beginning of the course and include specific dates for absences. Approved accommodations for absences will not adversely impact student grades. Absence from classes or examinations for religious reasons does not relieve students from responsibility for any part of the course work required during the period of absence. Students who feel they have been treated unfairly in terms of this accommodation may refer to Academic Regulation 104 – Academic Complaint Procedures.

Safety and Emergency Notification

Classroom and campus safety are of paramount importance at Washington State University, and are the shared responsibility of the entire campus population. WSU urges students to follow the “Alert, Assess, Act,” protocol for all types of emergencies and the “Run, Hide, Fight” response for an active shooter incident. Remain ALERT (through direct observation or emergency notification), ASSESS your specific situation, and ACT in the most appropriate way to assure your own safety (and the safety of others if you are able).

Please sign up for emergency alerts on your account at MyWSU. For more information on this subject, campus safety, and related topics, please view the FBI’s Run, Hide, Fight video and visit the WSU safety portal .

Full details can be found at https://provost.wsu.edu/classroom-safety