Department of Computer Science University of San Francisco


Computer Science 315-01
Computer Architecture
Spring 2013

MWF 3:30-4:35, HR 235


Professor: Peter Pacheco
Office: Harney 540
Phone: 422-6630
Email: domain: cs.usfca.edu, user: peter
Office Hours: MF 1-2, W 12-1, and by appointment

TA: Justin Battles
Email: domain: gmail.com, user: jaybatt88
Office Hours: Thursday 1:30-2:30 in one of the fifth floor labs

Class mailing list: You will be automatically subscribed to the class mailing list. Please note that this list uses your USF email address. If you ordinarily read your email using another account, be sure to forward your USF email to the other account.

Course Syllabus (Here's a PDF Version.)


Homework Assignments


Code Examples

  1. A MIPS assembly language program that reads in two ints, finds their sum, and prints it.
  2. A C program that reads an int prints out whether or not it's negative.
  3. A MIPS assembler program that reads an int prints out whether or not it's negative.
  4. A C program that reads a sequence of positive ints and prints their sum. Input is terminated by a value that's not positive.
  5. A MIPS assembler program that implements the preceding C program.
  6. A C program that uses a function to read an int.
  7. A MIPS assembler program that implements the preceding C program.
  8. A C program that uses one function to read an int and another to print it.
  9. A MIPS assembler program that implements the preceding C program.
  10. A C program that implements selection sort.
  11. A MIPS assembler program that implements the I/O functions in the preceding C program.
  12. A MIPS assembler program that implements selection sort.
  13. A C selection sort program that uses a dynamically allocated list.
  14. A MIPS assembler program that implements the preceding C program
  15. A MIPS assembler program that uses "dynamic" allocation on the stack
  16. A C program for converting between decimal, binary, and hexadecimal
  17. A program that adds 100,000 to a user-input value. Illustrates how to handle immediates that require more than 16 bits.
  18. Pseudo-code that shows how to implement a lock with atomic exchange.
  19. Code that shows how to implement an atomic exchange with ll and sc.
  20. Prof Cruse's implementation of hello, world in x86 assembler.
  21. Linux Assembly Howto implementation of hello, world in Intel x86 assembler.
  22. Linux Assembly Howto implementation of hello, world in AT&T x86 assembler.
  23. A 32-bit x86 assembly function that adds two ints. A C main function.
  24. A 64-bit x86 assembly function that adds two longs. A C main function.
  25. A 64-bit x86 assembly function that adds two ints. A C main function.
  26. An x86 assembly function that implements a two-way branch. A C main function.
  27. An x86 assembly function that computes n-factorial. A C main function.
  28. An x86 assembly function that computes the nth Fibonacci number. A C main function.
  29. x86 assembly code that implements insertion sort. A C main function.
  30. MIPS assembly programs that use the multiplication operators:


Other Information

  1. Brief Introduction to Subversion
  2. David Patterson's article, ``The Trouble with Multicore''
  3. Moore's Law Plot
  4. MARS MIPS simulator home page.
  5. Sourceforge download page for QtSpim and PCSpim.
  6. MIPS Reference Data (the ``Green Sheet'') (Copyright 2009 by Elsevier, Inc.)
  7. Summary of some MIPS instructions (Copyright 2009 by Elsevier, Inc.)
  8. SPIM system services (Copyright 2009 by Elsevier, Inc.)
  9. 0 - 15 in different bases
  10. 4-bit two's complement integers
  11. n-bit two's complement integers
  12. A list of possible topics for the first midterm
  13. A key to the first midterm
  14. Two calling conventions for x86 assembly.
  15. x86-64 Instructions and ABI (from the University of Chicago)
  16. Debugging Assembly Code with gdb (from Roskilde University)
  17. Algorithm for decimal addition
  18. Algorithm for decimal subtraction
  19. Algorithm for decimal multiplication
  20. Algorithm for binary multiplication
  21. Examples of binary multiplication using the two different hardware configurations:
  22. Algorithm for decimal division
  23. First algorithm for binary division
  24. Textbook's algorithm for binary division
  25. Example showing textbook's algorithm for binary division
  26. Algorithm for binary division using textbook's improved hardware
  27. Example showing algorithm for binary division using improved hardware
  28. Example showing two different conventions for signed integer division
  29. Example showing pipeline forwarding
  30. Topics for the second midterm
  31. A key to the second midterm
  32. Loop unrolling example
  33. Topics since the second midterm



Peter Pacheco 2013-05-06