A computer can be viewed at four levels of abstraction:
Each level can be viewed as an abstract machine consisting of:
1. An instruction set (IS)
2. A data set (DS)
3. A processor unit (PU)
4. A memory unit (MU)
5. An optional user interface (UI)
IS consists of all possible instructions the machine can execute.
Instructions manipulate data, the MU, and the PU.
DS consists of all possible data that can be stored in MU and manipulated by IS.
PU executes the instructions in IS.
MU stores the data in DS.
A virtual machine is an abstract machine implemented in software. A physical machine is implemented in hardware.
PC, Mac, Mainframe
Machine language instructions is binary word consisting of several fields:
The opcode encodes the operation to be performed. The operands contain the addresses in memory where the inputs to the operations are stored. Typical hardware level operations include arithmetic, logic, and MU read and write.
Hardware level data consists of binary words of lengths 1 (bit), 8 (byte), 16, 32, 64, etc. These words can be interpreted as Booleans, characters, and numbers.
The PU perpetually execute the fetch-execute cycle:
1. Fetch the next instruction from the MU
2. Fetch the required data from MU
3. Execute the instruction
4. Store the result in MU
5. goto 1
The MU can be viewed as a large array of cells. Each cell contains one byte. Each cell has a unique address, which is its distance from the beginning of the array. Cells can be read and written.
None
The OS level adds to the hardware level
Windows and UNIX
files
the file system = a tree of directories and files
Shells and desktops
Java, C, C++, LISP
A rich collection of instructions for data and sequence control.
A rich collection of primitive and programmer defined data types
language processor = Interpreter
or compiler
named variables
An IDE?
word processors, browsers, spread sheets, etc.
Listed under the
application menus
documents and pieces
of documents