CPSC 220:
Introduction to Computer Architecture
Department of Mathematics and Computer Science Hobart and William Smith Colleges Fall 2022. Instructor: David J. Eck (eck@hws.edu) Course web site: http://math.hws.edu/eck/cs220/ Monday, Wednesday, Friday, 12:10–1:10, Stern 203. Lab: Thursday, 11:50–1:20, Rosenberg 009.
About The Course
Computer architecture studies how computers can be built as complex systems from very simple components. The fundamental question is how to make a physical device that can store and execute programs. Because the structure and function of a computer is intimately tied to the structure of the programs that it can execute, the language in which those programs is written—machine language—is also an important aspect of computer architecture. In fact, the design of the machine language is referred to as the instruction set architecture (ISA) of the computer. Because people cannot, in practice, write machine language directly, a course in computer architecture will also typically study assembly language and the relationships among machine language, assembly language, and high level programming languages. Assembly language refers to low-level programming languages that are much closer to machine language than high-level languages such as Java.
Since this is an introductory course, the goal is to give you a reasonably firm grounding in the basic material, with lab experience to back it up, while at the same time giving you some background in more advanced topics that are central to modern computer architecture, such as pipelining and the memory hierarchy. These advanced topics are generally covered in more detail in a course on operating systems. Topics to be covered include:
- Binary number formats and binary arithmetic. We will study how integers and floating point numbers can be represented in binary, how to do arithmetic on binary integers, and how those arithmetic operations can be performed by computer hardware.
- The Larc model computer. As our first example of an ISA, we will look at Larc. Larc is a very simple 16-bit architecture that was developed by Marc Corliss, a former HWS professor now working for Google. Larc is simple enough that we will be able to understand it completely. You will write machine language programs for Larc, and you will build a working simulation of a Larc CPU.
- Logic gates and logic circuits. The CPU of a computer is built from simple electronic components called logic gates (which are themselves made out of transistors). Logic gates are combined into combinational logic circuits that can perform calculations and sequential logic circuits that can store data and run programs. We will study the design of those circuits.
- Logisim, a logic circuit simulation program. Although we will not work with actual hardware circuits, you will use Logisim to build combinational circuits, sequential circuits, and ultimately a full simulation of the Larc model computer.
- The x86-64 architecture and the Yasm assembly language. x86-64 refers to the ISA used by almost all current Intel and AMD CPUs. We will look at x86-64 programming using the Yasm assembler, which converts assembly language into machine language. A significant part of the course will be writing x86-64 assembly language programs.
- Introduction to some advanced topics. We will finish the course by looking briefly at interrupt handling, multiprocessing, pipelining, and the memory hierarchy.
There is no textbook for this course, but there will be some online readings, including suggested readings from two online free textbooks:
- Computer Organization and Design Fundamentals, by David Tarnoff. This textbook primarily covers low-level details such as binary numbers, logic circuits and how they are used to perform basic computer operations.
- x86-64 Assembly Language Programming with Ubuntu, by Ed Jorgensen. Covers the yasm assembler and its assembly language for the x86-64 ISA.
About the Pandemic
The pandemic is not really over, and it might still disrupt the class. Remember that you should not come to class if you are sick. If you need to miss class because of illness, please consult with me. Similarly, if I am sick, I plan to either try to teach the course remotely or find another professor to substitute for me.
Unless the Colleges or my department mandates otherwise, masks are optional in the classroom. I do not plan to wear a mask while lecturing, but I will probably wear one in lab where I will be working closely with students.
Computer Labs and Assignments
This course has a weekly required lab component. For each lab, there will be one or more exercises for you to turn in, and those exercises will constitute the large majority of homework for the course. On some labs, you will have the option of working in a group of two or three. (In at least one case, group work will be mandatory). For other labs, you will be working on your own.
The first lab will ask you to use Java, but that will probably be the only Java assignment for the course. In the remaining labs, you will work with the Larc model computer, Logisim, and the Yasm assembler. Exercises will include Larc programs, Logisim circuits, Yasm assembly language programs, and written responses to questions. There might also be a few written assignments outside of the labs.
Tests and Final Exam
I plan two in-class exams, to be given on Wednesday, September 28, and Wednesday, November 9. There will also be a final exam, given during the regularly scheduled final exam period for this course, Tuesday, December 6, 7:00 PM. The final exam will be only a little longer than the in-class exams. I will make a study guide available before each exam.
Grading
Here is the weighting for the various components of the course.
First in-class exam: 16% Second in-class exam: 16% Final exam: 18% Assignments: 50%
Attendance and Late Assignments Policies
I assume that you understand the importance of attending class, and you should always plan to be in class, if possible. And of course, if you are sick, you should not be in class. If you do need to miss class, it is a good idea to talk to me about the material that you missed.
Lab attendance is particularly important. I do not take attendance in class, but I do take attendance in lab, and you cannot get credit for a lab unless you are at the lab or discuss your absence with me and make arrangements to complete the work.
If you need to miss an in-class test, you should make arrangements with me in advance if possible. If that is not possible, you should contact me as soon as you can. If you have a sufficient reason for missing the test, we can arrange a make-up test.
I do not in general accept late assignments, but I do try to be reasonable about exceptional cases. If you miss a homework deadline for some reason, you should always discuss it with me.
No Technology During Lecture
I ask that you refrain from using any technology (beyond pen/pencil and paper) in lecture, unless you have a verified need to take notes on computer. This includes laptops, tablets, and cell phones.
There is substantial research showing that taking notes on paper can improve retention of the material, compared to note-taking on computer. My real advice is to take notes in outline form, noting down important ideas and examples, and to make a more formal copy of the notes after class, filling in any missing details. There is also research showing that the multitasking that you are likely to engage in if you have a computer open in front of you is detrimental to learning.
About Office Hours
I expect to hold regular, walk-in hours in my office, Lansing 313. Times will be announced and posted on the course web page as soon as my schedule for the semester is finalized. I can also do some meetings by appointment, and appointments for Zoom meetings are also a possibility.
Of course, email is always a good way to contact me. My email address is eck@hws.edu. I welcome comments and questions by email, and I will usually respond to them fairly quickly.
Teaching Fellows
Teaching Fellows will be available in the computer lab, Rosenberg 009 from 7:00 to 10:00 PM, Sunday through Thursday, starting Sunday, August 28.
Teaching Fellows are not required to be experts in the material covered in this course, but most of them have taken CPSC 220, and they will offer help when they can.
Statement from the Center for Teaching and Learning
Disability Accommodations: If you are a student with a disability for which you may need accommodations and are new to our office, you should self-identify for services by logging into the Accommodate Portal (https://hws-accommodate.symplicity.com/public_accommodation/) and completing the Accommodation Intake Form. Disability related accommodations and services will be provided when the registration and documentation process is complete. The guidelines for documenting disabilities can be found at the following website: https://www.hws.edu/centers/ctl/disability-services.aspx.
Returning students may request accomodations by logging into the Accommodate Portal and requesting a semester accommodation letter. Should you need to meet to add or discuss accommodations, please schedule an appointment in the Accommodate Portal (directions are on the CTL website, should you need them).
Please direct questions about this process or Disability Services at HWS to ctl@hws.edu or x 3351. Jamie Slusser, Disability Services Administrator & Accommodation Specialist, and Christen Davis, Associate Director of CTL for Disability Services, are the main contact staff for Disability Services.
Tentative Schedule
Here is a rough schedule for the course, to give you a general idea of what we will be doing. Although we should cover almost all of the topics listed here, we might depart significantly from the timeline presented here, and we might omit or add some topics. See the course web site for accurate scheduling information, to be posted weekly.
For the readings in this schedule, Tarnoff refers to Computer Organization and Design Fundamentals, by David Tarnoff, and Jorgensen refers to x86-64 Assembly Language Programming with Ubuntu, by Ed Jorgensen. You should not take the tentative readings listed here as assignments; again, see the course web site for weekly details.
Dates | Topics and Suggested Readings | Possible Lab |
---|---|---|
Aug. 22, 24, 26 |
Introduction to the course. Binary and hexadecimal numbers. Tarnoff, sections 2.1–2.4, 2.7 |
Numbers and Bits. |
Aug. 29, 31; Sept. 2 |
Larc machine language basics. Binary arithmetic. Tarnoff, Sections 3.1–3.4 |
Larc ML Programming 1. |
Sept. 5, 7, 9 |
Larc memory, strings, and subroutines. Logic and logic gates. Tarnoff, Sections 4.1–4.4, 5.1 |
Larc ML Programming 2. |
Sept. 12, 14, 16 |
Introduction to Logisim. Circuits for arithmetic. Tarnoff, Sections 8.1, 8.2 |
Arithmetic in Logisim. |
Sept. 19, 21, 23 |
Memory circuits and state machines. Tarnoff, Selections from Chapter 10. |
Memory circuits in Logisim. |
Sept. 26, 28, 30 |
There is a test Wednesday, Sept. 28. Building Larc in Logisim. |
Sequential circuits in Logisim. |
Oct. 3, 5, 7 |
Overview of computer architectures. Introduction to 80x86 and x86-64. Tarnoff, Chapter 16. |
Larc in Logisim 1. |
Oct. 12, 14 |
Fall break, Oct. 10 and 11. Introduction to Yasm and ddd. Jorgensen, Chapters 5 and 6. |
Larc in Logisim 2. |
Oct. 17, 19, 21 | Basic Yasm instructions. Jorgensen, Sections 7.1–7.6, 8.1. |
Programming with Yasm 1. |
Oct. 24, 26, 28 |
Yasm control instructions. Implemeting C/Java control structures. Jorgensen, Section 7.7. |
Programming with Yasm 2. |
Oct. 31; Nov. 2, 4 |
Calling functions and using the stack. Jorgensen, Chapters 9 and 12. |
Programming with Yasm 3. |
Nov. 7, 9, 11 |
There is a test, Wednesday, Nov. 9 System calls and interrupts. Jorgensen, Chapter 13. |
Programming with Yasm 4. |
Nov. 14, 16, 18 |
The memory hierarchy and caching. Tarnoff, Chapter 13. |
Programming with Yasm 5. |
Nov. 21 |
Thanksgiving break, Nov. 22–27. Multicore CPUs and multiprocessing. |
(No lab.) |
Nov. 28, 30; Dec. 2 | Pipelined architectures. | Finish the last Yasm lab. |
Dec. 6 | Final Exam, Tuesday, December 6, 7:00 PM |