CIS-77 Home http://www.c-jump.com/CIS77/CIS77syllabus.htm
While programming in high level languages, we need to understand
How does underlying hardware works?
How does computer memory work?
How to debug our programs after they were translated into machine language?
How embedded systems are programmed?
By the time we get to C/C++ programming, we already understand the layers below.
Number systems
Digital logic
Computer organization
Machine language
Function calls and recursion
Stack operations
Activation records (stack frames)
Pointers, data structures, linked lists
Electronic equipment is connected by wires.
High and low voltage: zero and one.
Combinations of 0 and 1 produce sequences like 00100011
Such sequences are binary encodings of numbers.
For example, binary encoding 00100011 corresponds to the decimal number 35.
|
|
|
|
|
|
Called Turing machine, 1937.
Turing provided description, but first computers were built in 1946.
For example,
one Turing machine could add two integers;
another could multiply, and so on.
Black box models provide no information how operation is performed:
|
|
Turing was first to provide us description of what computers do.
Universal Turing machine is programmable.
Disadvantages:
ambiguity of natural languages.
dependency on the context.
Bottom line: computers require exact instructions.
An algorithm is a step-by-step procedure that is guaranteed to terminate.
Each step is precisely defined and stated.
Since procedure will terminate, we call it finite.
Note: there could be more than one algorithm to solve a particular problem.
Programming language allows to specify a sequence of instructions to a computer.
There are more than 1000 programming languages.
For example, C, C++, Java, COBOL, ...
High-level languages are machine-independent.
Low-level programming languages are tied to the computer on which programs will execute.
For each system there is one such low-level language: it is called assembly language.
ISA is a set of instructions that can be carried out by the CPU.
ISA includes instructions and operands.
When we say instruction, it could be
assembly instruction mnemonic, describing the operation: jmp initialize
disassembly instruction showing an address: jmp 0040106E
machine-level instruction encoding: hex EB 21 (binary 1110101100100001)
microcode that implements the correcponding operation inside the CPU.
Instruction operands describe data values manipulated by the instruction.
In this course we will see parts of Intel x86 microarchitecture and its instruction set.
Data can have different sizes.
Data can be of different types.
Data needs to be located and loaded to/from computer memory before an instruction can execute.
All of the above becomes part of addressing the operands in each instruction.
|
|
Translation of the Instruction Set to its CPU implementation is called microarchitecture.
The microarchitecture is unique to the model of the CPU.
The microarchitecture is implemented by wired logical circuits inside the CPU.
The CPU microarchitecture is made of simple logic circuits.
Particular implementation is usually a number of tradeoffs between cost and performance.
Each basic logic circuit is implemented as a device specific to the technological platform on which the implementation is based.
Transistors are combined to form logic circuits.