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

ECE/COMPSCI 250D: Computer Architecture

Section 001, Fall 2021


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 Hall 115AWed 1:45pm - 3:00pmAaric HanMorgan Feist
02+05Hudson Hall 207Wed 3:30pm - 4:45pmThomas ButlerSravan Parimi
03Hudson Hall 115AWed 5:15pm - 6:30pmAlex ChaoSasamon Omoma
04Hudson Hall 207Wed 1:45pm - 3:00pmJamie KramerTommy Pratt

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/24 Intro/Overview Chapter 1 R01. Unix, text editing, and basic C, part 1
2 Thu 8/26 C programming (See Resources below)
3 Tue 8/31 C programming (See Resources below) R01. Unix, text editing, and basic C, part 2 (Due Tue 8/31)
Homework 0
(hw0part2 binary)
4 Thu 9/2 C programming (See Resources below)
5 Tue 9/7 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/9 From C to binary Sec 2.1-2.4, 3.2, 3.5
7 Tue 9/14 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/16 Assembly Sec 2.5-end
9 Tue 9/21 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/20)
Homework 1
- prog.c
- C debug guide
- Tool intro
10 Thu 9/23 Combinational logic Sec 4.1-4.2, B.1-B.3, B.5,
basic_logic_ev.circ
11 Tue 9/28 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 9/30 Sequential logic Sec B.7-B.11
- Tue 10/5 Fall Break R04. Digital design with Logisim
- input_output.circ
13 Thu 10/7 Midterm review session
14 Tue 10/12 Midterm exam
- Study guide,
- Practice midterm
  (blank version)
- Live solutions
R05. Using Logisim for larger projects, part 1
(Due Mon 10/11)
Homework 2
- prog_part.c
- MIPS debug guide
- Structs
- Data structures
- Calling conventions
- strlen
- Loop/sort tips
15 Thu 10/14 Finite state machines Sec B.7-B.11,
combo_lock_ev.circ
^ Link fixed 10/19
16 Tue 10/19 Datapath design Sec 4.3-4.4, 4.9 R05. Using Logisim for larger projects, part 2
- FSM walkthrough with Andy He
17 Thu 10/21 Datapath design Sec 4.3-4.4, 4.9 (Due Sun 10/24)
Homework 3
- Logisim debug guide
- Logisim tips
  ^ Video shows older Logisim,
      but it's still valid

18 Tue 10/26 Caches
Sec 5.1-5.5 R06. Register file and ALU, part 1
19 Thu 10/28 Caches
Sec 5.1-5.5
20 Tue 11/2 Caches
Sec 5.1-5.5 R06. Register file and ALU, part 2
21 Thu 11/4 Virtual Memory
Sec 5.6-5.9
22 Tue 11/9 Virtual Memory
Sec 5.6-5.9 R07. Caching and virtual memory, part 1
23 Thu 11/11 I/O Sec A.8 (Due Fri 11/12)
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/16 Pipelined cores Sec 4.5-end R07. Caching and virtual memory, part 2
25 Thu 11/18 Pipelined cores Sec 4.5-end
26 Tue 11/23 Multicore Chapter 6 Thanksgiving break
- Thu 11/25 Thanksgiving break
27 Tue 11/30 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/2 Review for final (Due Fri 12/3)
Homework 5
- virt2phys example
- cachesim example
- Cachesim Guide

(Due Tue 12/7, *optional*)
Extra credit
- Tar files
Sun 12/12 Final exam (2pm-5pm) 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