Pat Pannuto


CSE 141: Introduction to Computer Architecture

M3 sensor on a finger
Luxapose image processing pipeline
Signpost platform deployed outside
TotTag ranging platform
Opo interaction tracker clipped to a tie
Powerblade power meter on a plug

Overview

The course covers the basics of modern processor design and operation. Topics include instruction set architectures, computer system performance, machine organization, pipelining, branch prediction, memory-hierarchy design, and an introduction to multiprocessor considerations (and possibly security considerations and/or introduction to low-power design as well).

This course is designed to run alongside CSE 141L. We expect that you are enrolled in both.

If you cannot enroll in both because of scheduling, waitlists, etc, it is more important to complete CSE 141 first. You can succeed in CSE 141 without the partner lab, you very likely cannot succeed in 141L without having the 141 material.

Learning Goals of 141+141L

At the end of the CSE 141 series, students should be able to:

  1. Make or support ISA design decisions with respect to the types of operations, the ways to impact control flow, and the number (and types) of operands.
  2. Apply the Performance Equation and Amdahl's Law to evaluate processor designs.
  3. Design single-cycle and pipelined processors.
  4. Determine cache performance given a particular cache design and an address stream.
  5. Evaluate and optimize program performance on a particular architecture and memory hierarchy.
  6. Describe the role of Virtual Memory and evaluate memory designs (including the Translation Lookaside Buffer and its corresponding caches).
  7. Explain the performance benefits of pipelining, superscalar, and out-of-order execution.


Syllabus

DISCLAIMER

Due to our continued unusual circumstances, the details in this syllabus may change (e.g. schedule, grading policy, assignments, etc.). We will update this syllabus in the event of changes as the course progresses.

Course Staff

Pat Pannuto is the instructor and their office is CSE 3202 (right in the corner). Their email is ppannuto@ucsd.edu; please remember to include CSE141 in the subject line for class issues.

What should you call me?

Most students call me Professor or Professor Pannuto or Dr. Pannuto. I also answer happily to “Prof[essor] P.”

What should I call you?

I should call you by your preferred name, with the correct pronunciation and any honorific or pronouns you choose. Please correct me (in the chat if there is one, out loud in class or in Zoom, or via email/Piazza after the fact – however you are most comfortable) if I ever make a mistake.

TAs

  • Adithya Anand – ananand@ucsd.edu
  • Link Lin – yul065@ucsd.edu
  • Wenshan Luo - w1luo@ucsd.edu
  • Rahul Polisetti – rpolisetti@ucsd.edu

Prerequisites

CSE 140 and 140L are required prerequisites for this course. We expect that you are comfortable with the basics of digital logic, including the fundamentals of logic timing and how 1's and 0's can be used for higher-level operations like addition.

We further expect a basic familiarity with C or C-like code, i.e. you should be comfortable understanding what the following code does:

int twoDarray[256][256];
int sum = 0;

for (int i=0; i<256; i++) {
  for (int j=0; j<256; j++) {
    sum += twoDarray[i][j];
  }
}

printf("%d\n", sum);

Textbook

Computer Organization and Design MIPS Edition, The Hardware/Software Interface, Fifth Edition (Patterson & Hennessy) (ISBN-13: 978-0124077263, ISBN-10: 0124077269)

The textbook is required for this course.

  • Hennessy & Patterson, "Computer Architecture: A Quantitative Approach", Morgan Kaufmann
    • A more advanced treatment of many of the same topics in the textbook, as well as a lot more breadth.
  • Synthesis Lectures on Computer Architecture
    • This contains a number of truly outstanding (and very recent and up-to-date) books on computer architecture, any of which you can download free while in the UCSD domain. In particular, see the books on Processor Microarchitecture (most useful for this class), Performance Evaluation Methods, Memory System, and Multithreading Architectures.

Schedule

Lectures are Tue/Thr from 15:30 to 16:50 US/Pacific, in P416 WEST (the tents between Mandeville Ln and the Library Walk).

Discussion is Wed from 18:00 to 18:50 US/Pacific, in P416 EAST (the tents between Mandeville Ln and the Library Walk).

(A?)Sychronous?, Remote?, Recordings?

This course is designed for synchronous, in-person instruction. That said, life happens, so we will make best-effort attempts to stream the lectures via Zoom and will make these recordings available in Canvas. Please be sure to review the Participation section in detail as well.

Office Hours

Up-to-date office hours are available in Canvas.

Grading

A quick reminder: Effective learning comes from active engagement and re-enforcement. Activities, assignments, and grading are designed to help with this.

You get out of class what you put into it.

15%: Participation (Peer Instruction)

During lectures, we will have interactive question and answer segments. These are opportunities to check your understanding and for us to go back and help explain concepts more thoroughly that may be confusing folks. These in-lecture polls will not be graded for correctness, simply for participation.

Accommodating Missed Lectures via Mini-Quizzes

There's a lot going on lately, and we recognize that this means folks are more often going to need to miss a few lectures. If you are unable to attend class for any reason, you can complete that classes mini-quiz as a make-up up to four times during the quarter. You do not need to contact anyone, simply do the quiz and we will replace up to four participation zero's with quiz completions at the end of the term. (Note: These must "match", i.e. if you have a zero for participation on April 5, then only the April 5 quiz can replace it.) For exceptional situations that require more than four make-ups, please contact Professor Pannuto directly.

These quizzes are primarily for you, to help you stay on track and to check your own understanding. Therefore, we will not grade them for correctness (Canvas sometimes insists on giving you a score; you can safely ignore it). The quiz must be completed by 3:30PM US/Pacific (i.e. before class) the following week. If you complete the quiz, you will earn full points. However, if your raw score on a quiz is low, come to discussion sections and office hours and get help!

Persons who did attend lecture and would just like some extra practice are welcome to complete the quizzes as well.

Mini-Quiz Late Policy

As the purpose of these mini-quizzes is to help you keep up with class, there will be no extensions or late submissions.

30%: Homework

These are longer form assignments, designed to test your individual understanding. You are welcome discuss homework problems with other students or in groups, however, you must complete your final writeup alone.

Homework submission will be via the Gradescope module in Canvas. Regrade requests will also be handled via Gradescope. The window for regrades will be no more than one week after graded homework is returned.

Generally, homework will be released every Thursday and due the following Thursday, before the start of class (i.e. at 15:30). We expect to release a homework assignment every week, with exceptions for the midterm week, final exam week, and possibly holidays, which should result in around 7-8 homework assignments over the quarter.

Homework Late Policy

Homework ever is better than homework never.

The goal of homework is to help you to understand better by working through problems on your own. To that end, we will allow for late submission of homework at any point until the next exam (i.e. once the Midterm starts, you can no longer submit any homework assigned before the Midterm). Late homework will receive 50% of earned points. Late homework is not eligible for regrades and will be graded and returned at instructor convenience. Late homework should take care to add extra details showing how you, personally worked through problems and that your work is your own. Late homework that is "just answers" or otherwise does not clearly show your own work will receive no credit.

25%: Midterm

This course will have one midterm exam.

30%: Final Exam

The final exam will be cumulative over all of the course content.

Midterm, Final Format

Exams will be pen/pencil-only. You may not have a notesheet, calculator, or any other additional resources. We will provide a (possibly slightly modified) copy of the MIPS Green Card with exams.

Most of the exam questions will be very similar to the homework assignments, namely questions with large areas for open-ended free response. Some questions may include (possibly slightly modified) copies of processor diagrams similar to these shown in lecture and in homework. In addition, there may be some “fill-in-the-blank”, multiple choice, and True/False questions.

For purposes of ensuring academic integrity and in accordance with UCSD and UCoP policies, we may video record the examination area for the duration of the exam process.

Some questions may require basic arithmetic. You may leave the answer to any free-response question in fraction form. A calculator will not be necessary for the satisfactory completion of any problem.

Final Grades

I believe in mastery learning. My goal is to teach you the material in 141 and for everyone to learn it. I am most successful if everyone in class earns an A. This class will not be curved. I reserve the right to curve sub-components, in particular exams. The last time I taught this course, I curved the Midterm up very slightly and did not curve the final.

A+
>96.7
A
[93,96.7)
A-
[90,93)
B+
[86.7,90)
B
[83.3,86.7)
B-
[80,83.3)
C+
[76.7,80)
C
[73.3,76.7)
C-
[70,73.3)
D
[60,70)
F
[0,60)

Range notation [90,93) means 90 is included and 93 is not

Extra Credit? Grade Bumps?

There will be no extra credit in this class. I will not “bump” grades up that are “close” to a cutoff (becuase, then someone else is close to the new “bump cutoff,” drawing new arbitrary lines will always be unfair to someone).

CAPEs Incentive

If, at the end of the term, the CAPE response rate is >=90.0%, we will drop everyone's lowest homework grade.

Academic Integrity

In this course we expect students to adhere to the UC San Diego Integrity of Scholarship Policy. This means that you will complete your work honestly, with integrity, and support an environment of integrity within the class.

Cheating WILL be taken seriously. It is not fair to honest students to take cheating lightly, nor is it fair to the cheater to let them go on thinking that is a reasonable alternative in life.

The following is not considered cheating:

  • Discussing homework in groups (with the writeup done separately, later).
  • Discussing additional, unassigned problems (e.g. nearby numbers in the back-of-chapter problem lists) in any way, shape, or form.

The following is:

  • Discussing homework with someone who has already completed the problem, or looking at their completed write-up.
  • Using homework solutions from the web, previous versions of the class, or anywhere else.
  • Receiving, providing, or soliciting assistance from another student during a test.

Homework is not intended to be a grade-maker, but to prepare you for the tests, which are the grade-makers. Cheating on homework just hurts you. If you are choosing between not turning in an assignment, or using somebody's else work, do yourself a favor and just don't turn it in. You are facing a permanent mark on your academic record and a certainty of having to explain it to any future employer or school that you apply to.

If you are caught cheating on any assignment, you will first be flagged with an X course grade, which prevents you from withdrawing from the course for any reason. Any assignment you are caught cheating on will receive a score of negative 100%. This includes exams. (Notice: it is not possible to pass the course if you are caught cheating on an exam.) You will receive no notice that you have been caught cheating until after this course is complete. You will be referred to the Academic Integrity Office, who will contact you after the end of the quarter to discuss next steps. There is no flexibility in this policy.

Outside Tutoring

Individuals are not permitted to approach students to offer services of any kind in exchange for pay, including tutoring services. This is considered solicitation for business and is strictly prohibited by University policy.

Resources for Students

Getting Help

First, try to make sure you help yourself by staying up to date with course material. Nearly half the grade is participation and homeworks, which are not meant to be tricky, simply to give you practice and confidence with the material. We also encourage forming study groups to discuss 141 material. In addition to our homework assigments, there are quite a few good problems at the end of each chapter of the course textbook. Trying extra / similar-looking problems (especially with your study group) is perfectly acceptable, and you may discuss extra problems you work on with no limitations.

Discussion section is an opportunity for additional explanation and guided practice with material from each week. Professor Pannuto did not go to any discussions in their first two years of college becuase discussions were “not required” and no one ever really explained what they were or why they were helpful. Professor Pannuto got dragged to a discussion section for a theory and cryptography course by a friend to whom they are forever grateful at the end of sophomore year, realized how insanely helpful discussions were, and had significantly better grades thereafter.

Office hours are the perfect place for one-on-one support and asking specific questions. Office hours are most useful after you have worked on the problem for a little while yourself (I usually say that you should struggle with a problem for fifteen full minutes, but not more than fifteen minutes before seeking help). You are not interrupting course staff (TAs or the professors) when you come to office hours. It is literally our job to be available to help you during those times. Office hours are also not restricted to content from 141. Folks have asked about research / grad school in CS, how to get jobs in computer architecture, what other classes to take if they like (or hate!) this stuff, the best coffee shops for working accessible by light rail, tips for developing fruit-bearing trees in San Diego, or anything else that you would like to know about.

The IDEA Engineering Student Center, located just off the lobby of Jacobs Hall, is a hub for student engagement, academic enrichment, personal/professional development, leadership, community involvement, and a respectful learning environment for all. The Center offers a variety of programs, listed in the IDEA Center Facebook page at http://www.facebook.com/ucsdidea/ and the Center web site at http://idea.ucsd.edu/. The IDEA Center programs support both undergraduate students and graduate students.

Diversity and Inclusion

We are committed to fostering a learning environment for this course that supports a diversity of thoughts, perspectives and experiences, and respects your identities (including race, ethnicity, heritage, gender, sex, class, sexuality, religion, ability, age, educational background, etc.). Our goal is to create a diverse and inclusive learning environment where all students feel comfortable and can thrive.

Our instructional staff will make a concerted effort to be welcoming and inclusive to the wide diversity of students in this course. If there is a way we can make you feel more included please let one of the course staff know, either in person, via email/discussion board, or even in a note under the door. Our learning about diverse perspectives and identities is an ongoing process, and we welcome your perspectives and input.

We also expect that you, as a student in this course, will honor and respect your classmates, abiding by the UCSD Principles of Community. Please understand that others’ backgrounds, perspectives and experiences may be different than your own, and help us to build an environment where everyone is respected and feels comfortable. If you experience any sort of harassment or discrimination, please contact the instructor as soon as possible. If you prefer to speak with someone outside of the course, please contact the Office of Prevention of Harassment and Discrimination.

Students with Disabilities

We aim to create an environment in which all students can succeed in this course. If you have a disability, please contact the Office for Students with Disability (OSD), which is located in University Center 202 behind Center Hall, to discuss appropriate accommodations right away. We will work to provide you with the accommodations you need, but you must first provide a current Authorization for Accommodation (AFA) letter issued by the OSD. You are required to present their AFA letters to Faculty (please make arrangements to contact me privately) and to the OSD Liaison in the department in advance so that accommodations may be arranged.

Basic Needs/Food Insecurities

If you are experiencing any basic needs insecurities (food, housing, financial resources), there are resources available on campus to help, including The Hub and the Triton Food Pantry. Please visit thehub.ucsd.edu for more information.

Agenda

Reminder: You will get more out of lecture if you have completed the pre-class reading. We try to be clear about what is okay to skim and what will be helpful to read deeply.

Bonus materials are for those interested in learning more about a topic. They are not required in any way and their content will not be tested in quizzes, homework, or exams.

Date Topic Pre-Class Assignment Fifth Ed. Table of Contents Bonus Material

Part 0

Welcome!

Mar 29

Week 1

Introduction and Motivation

What computing looks like

Part I

Instruction Set Architecture

Mar 31

Week 1


HW 1 Assigned

ISA design

Skim 1.1, Read 1.2-1.3


Skim 2.1-2.2, Read 2.3-2.5, Skim 2.10

  • Computers aren't associative? When x*x*x != x*(x*x)
  • x86 Assembly Puzzles“A book of 0x40 short assembly snippets, each built to teach you one concept about assembly, math or life in general.”

  • Topic Videos
  • Branching with slt (FA'20 Video)
  • Still of video with worked example

Apr 5

Week 2

Memory, basic op's

Control flow

RISC vs CISC

Read 2.6-2.8, Skim 2.16-2.18, Read 2.19

Part II

Computer System Performance and Performance Metrics

Apr 7

Week 2


3:30pm– HW 1 Due

HW 2 Assigned

Defining performance, time; Amdahl's law

Skim 1.5, Read 1.6, Skim 1.7-1.8


Skim 1.9, Read 1.10, Skim 2.13

  • Blog series (part 1, part 2) on how hard it is to fairly and accurately measure performance on real-world systems. Note: "VM" here refers to the software virtual machine that Python or Java or JavaScript run on.

Part III

The Single Cycle Machine

Apr 12

Week 3

Execute units (ALUs), building blocks, and introducing organization

Datapaths

Skim 3.1, Read 3.2, Skim 3.3-3.4


Try to get through: Read 4.1-4.3, Skim 4.4

  • Read 3.7-3.9 for real-world designs; performance.

Apr 14

Week 3


3:30pm– HW 2 Due

HW 3 Assigned

Datapaths and control paths

Completing the machine; multicycle machines

If you didn’t before: Read 4.1-4.3, Skim 4.4


Read 4.4 (read this time! It is long and hard, but important!)

Part IV

Pipelines

Apr 19

Week 4

Introducing pipelines

Pipeline datapath


n.b. Ended here; Slide 38

Control in pipelines

Read 4.5 until hazards (p272-277); Skim rest of 4.5

    Topic Videos
  • Stalls and Forwards
  • Still of video end with answer 1 bubble and 5 stalls

Apr 21

Week 4


3:30pm– HW 3 Due

HW 4 Assigned

Hazards

Data Hazards; Stalls; Forwarding

n.b. Ended middle of last forwarding problems; Slide 103

Read 4.5 hazards and data hazards (p277-281); Read 4.7


Read 4.6

Apr 26

Week 5

(probably): Finish forwarding

Control hazards

Simple fixes (stalls; never taken; delay slots)

n.b. Ended just before modern predictors; Slide 136

Read 4.5 control hazards onwards (p281-286); Read 4.8 until prediction (p316-320)

Apr 28

Week 5


3:30pm– HW 4 Due

HW 5 (½ length) Assigned

Branch predictors

Read rest of 4.8 (p321-325)

May 3

Week 6


3:30pm– HW 5 Due

Pipeline catch-up day

Exam Review

None (reading likely slightly ahead of lecture)

Midterm Exam

The midterm covers all material taught up through the end of week 5. “If you have seen the topic on a HW, it is fair game for the midterm.”

A friendly reminder that the readings are required for this class, and the midterm may include (a few, small) questions from the assigned reading that were not explicitly covered or emphasized in lecture.

May 5

Week 6

Midterm exam
  • In-class exam.
  • 80-minute timed exam.

Part V

Advanced Pipelines

May 10

Week 7

Advanced branch predictors

None

May 12

Week 7


HW 6 Assigned

Even more advanced branch predictors

Exceptions and interrupts

Pipelines in Modern Machines

None

May 17

Week 8

Midterm Review

If time: Intro Caches

Read 4.9

Part VI

Caches and Memory

May 19

Week 8


3:30pm– HW 6 Due

HW 7 Assigned

Introducing Caches

Cache designs & tradeoffs

Read 5.1; Skim 5.2


Read 5.3

May 24

Week 9

Cache performance

Advanced Caches

Read 5.4 (focus more on the first ~half)

Read 5.8 (reviews content through here); Skim 5.13 if you are interested

May 26

Week 9


3:30pm– HW 7 Due

HW 8 (½ length) Assigned

Virtual Memory

If time: Branch Predictors are Caches!

Read 5.7 (focus more on the first ~half)

Final Exam

The final is comprehensive and covers all material taught any time this quarter. “If you have seen the topic on any HW, it is fair game for the final.”

A friendly reminder that the readings are required for this class, and the exam may include (a few, small) questions from the assigned reading that were not explicitly covered or emphasized in lecture.

May 31

Week 10


3:30pm– HW 8 Due

Exam Review

Jun 2

Week 10

Final Exam
  • In-class exam.
  • 80-minute timed exam.