chapter 1
Idea 1: All computers are capable of computing exactly the same things if they are given enough time and enough memory.
Idea 2: It is necessary to transform our problem from the language of humans to the voltages that influence the flow of electrons. This transformation should be done by computer itself.
2. How Do We Get the Electrons to Do The Work?
Problems |
Algorithms |
Language |
Machine Architecture (ISA) |
microarchitecture |
Circuits |
Devices |
level of transformation |
2.1 problems
problems usually be described in "natural language" at first. It is what we want to solve.
2.2 Algorithms
Since "natural language" has ambiguity, it is not suitable for computer, we should transform the natural language description into step-by-step procedure that is guaranteed to terminate. And this is what we called Algorithms. it has three properties :
1. definiteness(确定性):each step is precisely stated.
2. effective computability(可计算性): each step can be carried out by a computer.
3. finiteness(有限性): procedure terminates.
2.3 Language
I have metioned that "natural language" has ambiguity, it is not suitable for computer. So we need to describe algorithms in a way that computer can recognize. computer language is invented to do that. Of course it has no ambiguity.
What we should do in this level is describe algorithms by computer language, this is what we called program. But until now, what we create is still some English words, although it follows certain law. it still can not be executed by computer.
2.4 ISA
As I mentioned, the program we write still can not be executed by computer. So in this level of transformation, What we should do is to transform our program into the instructions computer can recognize. ISA is invented to do that. ISA include four parts:
1. set of instructions : What operations the computer can perform and what data is needed by each operation
2. operand : individual data values.
3. data types : a legitimate representation for an operand such that the computer can perform operations on that representation.
4. addressing modes : How to find operand.
A question here is how can we transform higher-level language into ISA instruction set. The answer is we should follow some certain laws(map), and this job is done by complier.
2.5 Microarchitecture
ISA is still in the area of software(or half-software), if we want our computer work, we must do some things on hardware. The Microarchitecture is the first step into the world of hardware.
In this step we transform the ISA into an implementation. The detailed organization of an implementation is called its microarchitecture. So in some cases, ISA just like a bridge between program and hardware.
note: usually, a ISA can be implemented in many ways, ie: infinte microarchitectures could exist for a single ISA. Conversely, a single microarchitecture can only implement one ISA.
2.6 The Logic Circuit
The next step is to implement each element of the microarchitecture out of simple logic circuits. Here, also, there are choices, as the logic designer decides how to best make the trade-offs between cost and performance. So, for example, even for the simple operation of addition, there are several choices of logic circuits to perform this operation at differing speeds and corresponding costs.
2.7 The Devices
Finally, each basic logic circuit is implemented in accordance with the requirements of the particular device technology used. So the devices differ among different circuit.
3. summary
In summary, from the natural language description of a problem to the electrons running around that actually solve the problem, many transformations need to be performed. A vital skill is abstraction, in each level of transformations, what we should pay attention to is the two level participate in transformation. After each transfomtion, we throw it away (or we just use the level before as black box), this will be important in many subjects.