We will get some answers to that question by examining the layering in a modern computer, which looks like this:
Language Translator/Interpreter --------------------- --------------------- High Level Language level C, Fortran, Lisp, etc Compiler Assembly level Assembly Assembler OS level OS "Instructions" Operating System Machine level Machine language Instruction cycle Digital Logic level Gates and Wires Physics (? :)
Each level is implemented in terms of the level immediately below it, except the Assembly level which is implemented in terms of both the OS level and the Machine level.
Software vs. Hardware - which should we use? Hardware is faster, but harder to modify. Software is slower, but easier to modify. The important thing is that they're interchangeable - anything one can do, can be done by the other one too.
The Software vs. Hardware distinction is the first example of a tradeoff - to get one thing, you have to give up another. Making tradeoffs is a basic part of computer design, and we will encounter a number of tradeoffs. The important thing is that the decision made about a tradeoff must be justified. In this case, we use hardware for the Digital logic level, and software for the levels above that. The justification for this tradeoff is that all programs are eventually executed at the Digital logic level, so we need that to be hardware to make it fast. However, all the higher levels are subject to frequent change, as when a new program or new operating system is run on the computer, so those levels need to be software.
The machine level interpreter that current machines use was designed by John von Neumann and implemented by Maurice Wilkes in 1949; it is called the von Neumann architecture.
Von Neumann architecture: Programs are encoded and stored in memory along with data. Machine model is memory + CPU. Program counter is a location within the CPU that stores an address. Memory is set of locations, each has an address and each stores a data item ("number").
Instruction cycle. Discussed in more detail later in the course.
Assembler. The assembler is the program that translates assembly language to machine language. It turns out that the assembler has a fairly simple task. It takes each line of the assembly language program and translates it to one machine language instruction.
Compiler. The compiler is the program that translates a high level language (HLL) to assembly. It translates each HLL instruction, like a loop or an "if" statement, into a large number of assembly language instructions.
However, below the HLL layer all the rest of the levels are machine dependent. For example a program written in SPARC assembly language will not run on a Pentium or a PowerPC or anything other than a SPARC machine.
So to study the lower levels of the machine hierarchy we have to pick a particular architecture to study. In this course we will use the SPARC architecture. SPARC CPUs are used in machines built by Sun Microsystems (as well as some other manufacturers). In this course we'll use the SPARC as our example of all the lower layers of the machine hierarchy.
You should also realize that the details of SPARC assembly language are not the same as the details of Pentium assembly language or PowerPC assembly language. However, in this course you'll learn the common principles behind all assembly languages so that if you have program in a different assembly language in the future, you will be able to pick it up quickly.