| Overall Reading | |
|---|---|
| Brookshear: | Ch. 2.1-2.3 |
| Decker/Hirshfield: | pp. 207-214; Mod. 7.4 |
Outline:
What is nice is that you can generally mix and match various components when configuring a system.
[CPU] -------[bus]------- [Main Memory]It is possible that many components share the same bus for communications. In this case, they must cooperate when sending messages from one device to another, so that the communication is clear.
CD Drive Modem
| |
[CPU] --------[bus]-------- [Main Memory]
| |
Monitor Disk
For example, the CPU is separate from the main memory. However it is often convenient for the CPU to have a minimal amount of its own memory (sort of like 'scratch paper'). Often, cells of the CPU's memory are called register and a collection of such memory is called a cache. The advantage is that the CPU can access this memory much quicker than passing a message down the bus to the main memory and waiting for a response. The disadvantage of increasing the amount of memory on the CPU is that more memory would make CPUs physically larger and more complicated. Worse yet, referencing more memory cells would require more bits per address.
You might even see computers with multiple levels of cache (e.g. a "second level cache"). These provide a tradeoff between the amount of memory and the efficiency of accessing the memory. (Analogy: organizing my desk, drawers, file cabinets, closets, boxes).
The first key may be in thinking about how we would even represent a computer program. Babbage envision punched cards, based on the technology of the time. For electrical computers, the intuition credited to John Von Neumann, is to represent instructions using bits so that program instructions could be stored in memory using the same technology used for other types of information. This basic idea is still used in all modern computer.
If we think about the bit patterns as binary numbers, we are essentially assigning unique numbers to each operator. (e.g. addition is operator #0, subtraction is operator #1)
Operands can be specified in various ways, depending on the CPU design.
If a CPU is designed which allows data to be specified in more than one way, instructions like addition will usually have several distinct op codes, one for each form.
The number of bits used as part of the operand field depends on the maximum value allowed for absolute operands, or the number of memory cells which can be referenced indirectly.
An instruction is performed using the following general cycle of events (though some variations exist):
Fetch-Decode-Execute cycle