ECE 250 / CS 250

Computer Architecture

Spring 2016

Professor Daniel J. Sorin




The objective of this course is to learn how computers work, focusing on how the computer hardware executes the software. 

The course focuses on: instruction sets, assembly language programming, basic digital logic design, processor design, memory system design, and input/output.  

Prerequisites: CompSci 201 


Class Location and Hours


Class meets Monday/Wednesday/Friday from 10:20am - 11:10am at Schichiano Auditorium (in CIEMAS)

Recitations are on Thursday.

 Instructor, Teaching Assistants, and Answering Questions


This is a very large class, which means that students should contact other sources of information before, if necessary, contacting the professor.

* The first option for finding help is this website.

* Then check the course's Sakai and Piazza sites.

* The third option for finding help is the outstanding group of teaching assistants for this course.  Either email them (via the Piazza forum) or go to their office hours. Questions on the Piazza forum may get answered by a TA, a fellow classmate, or the professor.

* Please contact the professor only for those issues that cannot be handled by anyone else.

Graduate Teaching Assistants:  

Xavier de Gunten

Bryan Prosser

Alfredo Velasco

Undergraduate Teaching Assistants:



* If you need to contact the professor, please email him or come to his office hours:

Professor Daniel J. Sorin

Office: 209C Hudson Hall

Office Hours: TBD  --- email me if you have class at both of these times and wish to meet with me

Email: sorin AT ee DOT duke DOT edu 

Required Textbook


David A. Patterson and John L. Hennessy. Computer Organization and Design: The Hardware/Software Interface, 5th edition, Morgan-Kaufmann.

Please do not get the "ARM" edition or the "Revised Printing" -- for some reason, the publisher has created several flavors of this book.


 Assignments and Grading


This course will require readings from the textbook, pencil and paper problems, programming assignments, and digital logic designs.

Students are responsible for:

Late homework policy -- NO exceptions, NO extensions (except in case of dean's excuse)

    0-24 hours late: Take earned score and multiply by 0.9
    24-48 hours late: Take earned score and multiply by 0.8
    >48 hours late: NO CREDIT

Late penalty will be applied to the entire assignment.  That is, if you turn in half of the assignment on time and half late, we assign the late penalty to all.

Start assignments and projects EARLY so that you don't get stuck at the end!

Academic Misconduct: I will not tolerate academically dishonest work.  This includes cheating on the homework and exams.  

I will refer all suspected cases of cheating to Duke's Office of Student Conduct.

Refer to the Duke Community Standard or to the instructor if you have any questions about misconduct.


 Topics, Lecture Notes, and Reading Assignments


I will post lecture notes (in PDF format) shortly before I cover them in class.  Please bring them to class. Click on topic title for link to notes.

Do not think that you can read the notes instead of attending class.  You will miss a LOT of course material if you miss class.


Reading Assignments

Course Introduction and Overview

Chapter 1

Instruction Sets and Assembly Programming

Chapter 2

Digital Logic Design

Appendix B

Processor Core Design: Datapath and Control

Chapter 4: 4.1-4.4

Memory and Caches

Chapter 5


somewhat covered in Appendix A.8 

Pipelined Processor Cores

Chapter 4: 4.5-end

Parallel Processors (time permitting)

Chapter 6





Remote access to Linux machines.
We will use the Duke OIT Linux machines for portions of this course. Please read this document on how to remotely access these machines.

Unix Tutorial
You should also go through this short tutorial on Linux

File Access
You can use CIFS to access the files in your home directory. Please see the OIT documentation on CIFS.

Tools -- Text Editors
-- nedit is a fairly simple GUI-based editor on the linux machines.
-- If you want to become a more sophisticated user of Linux editors you can explore gvim, vim, or emacs on your own. (I prefer emacs.)

Tools -- Compilers (gcc)
-- compilation: gcc -o newApp test.c
-- generate compile time warnings: gcc -Wall test.c
-- include debug symbols into the application: gcc -g -o newApp test.c
-- Introduction to gcc

Tools -- Debugger (gdb)
-- Documentation -- GDB essentials

C Programming Language
-- Video snippets by Prof Drew Hilton (Duke ECE)
-- This is an MIT OpenCourseWare set of lectures that does a good job of covering the basics for C programming.

C Programming Examples
-- C Memory Layout Example array as list
-- C Bit Manipulation bit manipulation of Hex to extract float fields or for a float input with casting via pointers extract float fields from float input .

MIPS Instructions
-- Assemblers, Linkers, and the SPIM Simulator (PDF).
-- A two page MIPS quick reference guide from MIPS is here.
-- A three page document from me with MIPS instructions is here.

SPIM: A MIPS32 Simulator
Download the appropriate binary for your platform from the SPIM web site.

Assembly Programming Examples
-- sum = sum + i*i is here.
-- sum array is here.
-- recursive sum array is here.
-- recursive sum i*i is here.

Logic Design Online Book
Pragmatic Logic by William J. Eccles

Logic Design Tool
Logisim is a convenient tool that runs on any platform (Mac, Windows, Linux). You will use Logisim to design and test circuits. Click through the download links until you arrive at the site and then look for the green download button. Click download and it should autodetect your system so you get the right version.



This is a VERY tentative schedule which may change depending on time constraints and which days the instructor will be out of town.




Thursday Recitation 


Jan 11


Unix, text editing

C programming

Jan 18


C programming

Intro to writing C programs

C programming

Jan 25

From C to binary

From C to binary

C programming: Pointers and memory management

From C to binary

Feb 1



HW#1 due

Assembly programming examples & using SPIM


Feb 8

Combinational logic

Combinational logic

Assembly programming examples:  focus on calling conventions

Sequential logic

Feb 15

Sequential logic

HW#2 due

Sequential logic

Digital design examples & using Logisim


 Midterm #1 (C and assembly)

Feb 22

Datapath design

Datapath design

Using Logisim for larger projects


Feb 29

Memory hierarchies


HW#3 due

Cache operation examples


Mar 7



Virtual memory examples

Virtual Memory

Mar 14


Mar 21

Virtual Memory

Virtual Memory

review for midterm #2

Midterm #2 (does not include memory systems)

Mar 28



HW#4 due

Cache+virtual memory examples


Apr 4

Pipelined cores

Pipelined cores

Pipelined operation examples

Pipelined cores

Apr 11

Pipelined cores

Pipelined cores



HW#5 due

Apr 18



review for final exam


Apr 25

Sun's Niagara multicore processor

review for final exam


May 2