Aug 26

Lecture Overview

Computer Architecture

The following is an idealized picture of how a computer works. The reality is much more complicated, but the following model provides a good foundation to understanding the computer.

This is enough for now. Later we will fill in more details in this picture like how the data/instructions are actually stored, what kind of instructions are available, where the operating system fits, and so forth.

Python

Our task as programmers is to set up a list of instructions so that when the CPU goes through our instructions with its fetch-decode-execute cycle, the CPU carries out the task we have in mind. The CPU can only execute what are called machine instructions. Directly writing machine instructions is time consuming and difficult. Instead we write instructions in what is called a high-level programming language of which Python is just one example. Python then translates the instructions we have written into the format expected by the CPU. Despite this, we are still thinking of our program as a list of instructions we set up before hand so that when the CPU goes through its fetch-decode-execute cycle the task we have in mind is accomplished.

The tool which carries out this translation is called the Python Interpreter. The python interpreter has two modes: it can read instructions one by one as you type them in which is called interactive mode or it can read them from a file. We will be using both methods of entering instructions this semester.

Data Storage in the computer

Exercises

For Problems 1 through 3, there is no python programming. Instead, you should type the problems and your answers into a text file and submit that.