This is an archive of a course I taught Fall 2022, preserved here as a resource for future students.

ECE/COMPSCI 250D: Computer Architecture

Section 001, Fall 2022


Fig. 1: This computer costs more than your car.
Quick links: Overview · Schedule · Syllabus · Resources

Overview

Lecture location: Wilkinson 021 + Zoom for authorized remote attendees
Lecture time: Tue/Thu 10:15am - 11:30am

Instructor: Dr. Tyler Bletsch
Email: Tyler.Bletsch AT duke.edu
Office Hours:

Recitations:

SectionRoomTimeLeads
01Hudson 139Wed 1:45pm-3:00pmSravan ParimiVincent Huang
04Hudson 115AWed 1:45pm-3:00pmAllan GuoJincheng He
05Hudson 222Wed 1:45pm-3:00pmAndrew LiuLucy Huo
06Hudson 207Wed 1:45pm-3:00pmEmily SunMichael Li
02Hudson 139Wed 3:30pm-4:45pmEthan YuHeidi Smith
07Bio Sci 154Wed 3:30pm-4:45pmTrevon HelmBrandon Bae
03Hudson 115AWed 5:15pm-6:30pmMayari MerchantDominic Martinez

Additional teaching staff:

UTA Office Hours: See forum thread

Course Textbook: David A. Patterson and John L. Hennessy. Computer Organization and Design: The Hardware/Software Interface, 5th edition, Morgan-Kaufmann.
Available free online from Duke Library here! (Physical copy from Amazon, AddAll) — Not the "ARM" edition or the "Revised Printing"

Links:

Schedule

#DateLectureReadingRecitation
(Wednesdays)
Homework due
(11:59:00pm)
1 Tue 8/30 Intro/Overview Chapter 1 R01. Unix, text editing, and basic C, part 1
2 Thu 9/1 C programming (See Resources below)
3 Tue 9/6 C programming (See Resources below) R01. Unix, text editing, and basic C, part 2
4 Thu 9/8 C programming (See Resources below) (Due Thu 9/8)
Homework 0
5 Tue 9/13 From C to binary Sec 2.1-2.4, 3.2, 3.5 R02. Pointers and memory management, part 1
- Q1-2 with Aaric Han
6 Thu 9/15 From C to binary Sec 2.1-2.4, 3.2, 3.5
7 Tue 9/20 Assembly Sec 2.5-end R02. Pointers and memory management, part 2
- Code: leaky.c
- Q3-7 with Aaric Han
  ^ Minor variation from your version: Missing Q6.
8 Thu 9/22 Assembly Sec 2.5-end
9 Tue 9/27 Assembly Sec 2.5-end R03. Assembly programming with SPIM, part 1
- SPIM intro
   - Code: simple.s
   - Solution: printint.s
- C to MIPS 1: basic manual compiling
   - Code: squares.c
   - Solution: squares.s
- Assembly: strlen function by Yi Chen
(Due Mon 9/26)
Homework 1
- prog.c
- C debug guide
- Tool intro
- Sorting tips
10 Thu 9/29 Combinational logic Sec 4.1-4.2, B.1-B.3, B.5,
basic_logic_ev.circ
11 Tue 10/4 Sequential logic Sec B.7-B.11 R03. Assembly programming with SPIM, part 2
- Assembly: sum function by Maverick Chung
   - Solution: foo_function.s
- C to MIPS 2: caller saved registers
   - Code: squares-with-call.c
   - Solution: squares-callersaved.s
- C to MIPS 3: callee-saved registers
   - Solution: squares-calleesaved.s
- Updated recusion example from Jerry Wang
12 Thu 10/6 Sequential logic Sec B.7-B.11
- Tue 10/11 Fall Break Doing HW2?
➥ Homework 2 help clinic
Done with HW2 (with an all-green hwtest output)?
➥ R04. Digital design with Logisim (head start)
13 Thu 10/13 Midterm review session
14 Tue 10/18 Midterm exam
Study guide,
Practice midterm
  (blank version)
Live solutions
R04. Digital design with Logisim
- input_output.circ
15 Thu 10/20 Finite state machines Sec B.7-B.11,
combo_lock_ev.circ
^ Link fixed 10/19
(Due Thu 10/20)
Homework 2
- prog_part.c
- MIPS debug guide
- Structs
- Data structures
- Calling conventions
- strlen
- Loop/sort tips
16 Tue 10/25 Datapath design Sec 4.3-4.4, 4.9 R05. Using Logisim for larger projects
- FSM walkthrough with Andy He
17 Thu 10/27 Datapath design Sec 4.3-4.4, 4.9 (Due Sun 10/30)
Homework 3
- Logisim debug guide
- Logisim tips
  ^ Video shows older Logisim,
      but it's still valid

18 Tue 11/1 Caches
Sec 5.1-5.5 R06. Register file and ALU, part 1
- Regfile demo
- ALU demo
19 Thu 11/3 Caches
Sec 5.1-5.5
20 Tue 11/8 Caches
Sec 5.1-5.5 R06. Register file and ALU, part 2
21 Thu 11/10 Virtual Memory
Sec 5.6-5.9
22 Tue 11/15 Virtual Memory
Sec 5.6-5.9 R07. Caching and virtual memory, part 1
23 Thu 11/17 I/O Sec A.8 (Due Fri 11/18)
Homework 4
- TA Guide to HW4
- Processor tips guide
- Logisim Evolution
- HW4 tool intro
- Logisim tips
- ALU/Control tips
- Tracing/debugging
- TTY/Keyboard tips
- Dramatic intro (alt)

24 Tue 11/22 Pipelined cores Sec 4.5-end Thanksgiving break
- Thu 11/24 Thanksgiving break
25 Tue 11/29 Pipelined cores Sec 4.5-end
26 Thu 12/1 Multicore Chapter 6 R07. Caching and virtual memory, part 2
27 Tue 12/6 Intel x86 Example code,
Intel developer manual
(pages 1..3908)
R08. Pipeline exercises and
R09. Intel x86 and free exploration (time allowing)
- memdance.c
28 Thu 12/8 Review for final (Due Fri 12/9)
Homework 5
- virt2phys example
- cachesim example
- Cachesim Guide

(Due Tue 12/13, *optional*)
Extra credit
- Tar files
12/19 Final exam (2pm) Study guide
Practice final
Reference sheet
Live solutions

Syllabus & policies

Course synopsis

Computer structure, machine language, instruction execution, addressing techniques, and digital representation of data. Computer systems organization, logic design, microprogramming, and interpreters. Symbolic coding and assembly systems.

Prerequisite: Computer Science 201 or consent of instructor.

Grading breakdown

This course will require readings from the textbook, problem sets, programming assignments, and digital logic design. Grading breakdown:

Category%
Homework55%
Midterm exam15%
Final exam25%
Recitation5%

Homework grading

You are expected to complete the homework individually unless otherwise stated. However, you may discuss topics covered in the class.

Late homework submissions incur penalties as follows:

NOTE: If you feel in advance that you may need an extension, contact the instructor. We can work with you if you see a scheduling problem coming, but extensions cannot be granted at or near the due date!

Your homework grade will be based on what you submit to Sakai and when you submit it. The common excuses listed below will be rejected for the reasons shown:

ExcuseThing you could have done which invalidates excuse
My internet was slow or flaky so my submission was late.Submit with plenty of margin. There's no reason the assignment can't be submitted HOURS OR DAYS in advance.
I meant to submit, but I forgot to click the submit button.After submission, leave and re-visit the submission page to make double-sure your file is uploaded properly.
My computer broke and I lost my work!It's the modern era. Use one of the dozens of data mirroring or backup services: Dropbox, Google Drive, Box (free at Duke!), Crashplan, or just good old fashioned local backups. You should be able to set your laptop on fire and lose zero bytes of work.
I submitted the wrong file, let me send you the right file!After submission, re-download your files from Sakai to verify it's correct. Test it from scratch to ensure it's what you expect.
One tiny thing was wrong, and I can fix it! Let me get a regrade!The time to find those bugs is before submission. When you've built your program/circuit, you're not done...that's when testing begins! Test your solution under a variety of conditions. See here for a primer on software testing.
I didn't understand the requirements, let me fix my program and get a regrade!If you're the slightest bit unsure if your program meets the requirements, ask for clarification in lecture, recitation, or Piazza. If you're worried your submission won't pass our testing, run through it with a TA or the instructor.

I'm not trying to be a jerk, but this is the part of your academic career where we build individual competence, and as in the real world, oversights can be costly.

Recitation grading

Recitation is where you'll learn concrete skills to complement the lecture's theoretical material, and is essential. Recitation grading works as follows:

Grade appeals

All regrade requests must be in writing. Email the TAs with your questions. After speaking with the TAs, if you still have concerns, contact the instructor

All regrade requests must be submitted to the instructor no later than 1 week after the assignment was returned to you.

Academic integrity

I take academic integrity extremely seriously. Academic misconduct will not be tolerated, and all suspected violations of the Duke Undergraduate Honor Code will be referred to the Office of Student Conduct. A student found responsible for academic dishonesty faces formal disciplinary action, which may include suspension. A student twice suspended automatically faces a minimum 5-year separation from Duke University.

In addition to the measures taken by the Office of Student Conduct, the affected assignment(s) will receive zero credit, or possibly -100% in egregious cases.

If you are considering this course of action, please see me instead, and we can work something out! I want every student in my course to be successful.

Resources