Fall 2018: Computer Architecture
ECE/CPS 250, TuTh 11:45PM - 1:00PM
Biological Sciences 111

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.


Professor Benjamin Lee
Office Hours: TuTh 4:00-5:00PM
Office: Hudson 210

Graduate Teaching Assistants

Siddhartha Nalluri (siddhartha.nalluri@duke.edu)
Dan Sun (dan.sun@duke.edu)

Head Undergraduate Teaching Assistant

Joseph DeChicchis (joseph.dechicchis@duke.edu)

Office Hours

See Piazza post.

Register and/or Login Here

Discussion Forum

We will use Piazza for class discussion. This system is designed to get you help, fast and efficiently, from your classmates, the TAs, and myself. Rather than emailing questions to teaching staff, you should post your questions on Piazza.

Register and/or Login Here


D.A. Patterson and J.L. Hennessy. Computer Organization and Design: The Hardware/Software Interface, 5th Edition, Morgan-Kaufmann.

Kernighan and Ritchie. The C Programming Language, 2nd Edition (optional)

This course will require readings from the textbook, problem sets, programming assignments, and digital logic design. Grades are assigned based on homework (50%), midterm-1 (12.5%), midterm-2 (12.5%), and final (25%). You are expected to complete the homework individually unless otherwise stated. However, you may discuss topics covered in the class. Late homework submissions incur a 10% penalty when <24 hours late, incur a 20% penalty when 24-48 hours late, and receive no credit when >48 hours late.

Academic Policy
The discussion of ideas and design strategies is an integral part of the learning experience. However, cheating and plagiarism is not. Practically, you violate academic integrity when (1) you obtain solutions and code from others, or (2) you provide solutions and code to others. The Duke Undergraduate Honor Code, will be strictly enforced with zero tolerance for cheating and/or plagiarism. If a student is suspected of academic dishonesty (e.g., cheating on an exam, copying code, collaborating inappropriately on an assignment), the instructor will report the matter 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.

Approximate Schedule


Introduction and Overview


C Programming


C to Binary


Assembly Programming


Basics of Logic Design: Logic Gates


Basics of Logic Design: Sequential Logic


Basics of Logic Design: Finite State Machines


Processor Design: Datapath and Control


Caches and Memory Hierarchies


Main Memory and Virtual Memory








Modern Processors


Visit the Duke Sakai webpage for homework assignments.


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.

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 very nice tool that runs on any platform (MAC, Windows, Linux). You can use this to design and test circuits. Click through the download links until you arrive at the sourceforge.net site and then look for the green download button, click that it should autodetect your system so you get the right version.

-- 8-bit Register File: compsci250.jar
-- Instruction memory initialization file: d_mem.hex
-- 8-bit ALU: ALU.circ