2021 Computer Architecture Midterm review
====
## Ch1,2
Morre's law: the number of transistors on a microchip doubles every two years.
Technology node: essentially the physical size of the transistor, the smaller it is, the more transistors in the smae area.
Response time: how long it takes to do a task
Throughput: Total work done per unit time
Performance = 1 / Execution time
$\frac{Performance_x}{Performance_y}=\frac{Execution time_y}{Execution time_x}=n$
### CPUtime
_______
$CPUTime = CPU\ Clock\ Cycles \times Clock\ Cycle\ Time=\frac{CPU\ CLock\ Cycles}{Clock\ Rate}$
$Clock\ Cycles = instruction\ Count\times Cycles\ per\ instruction$
$\Rightarrow CPUTime=Instruction\ Count\times CPI\times Cycle\ Time=\frac{IC\times CPI}{CR}$
### Power
___
$Power=Capacitiveload\times Voltage^2\times Frequency$
設計要追求高響應(Frequency)而低功耗(Power),便須下調前兩者的影響,然而在2004年後,降低電壓與冷卻的技術飽和而停滯,在功率挑戰中形同撞上了一面高牆(Power wall),為了執續強化處理器的效能,技術便轉往多核心發展。
Cost per die = $\frac{cost\ per\ wafer}{Dies\ per\ wafer\times Yield}$
Dies per wafer $\approx$ $\frac{Wafer\ area}{Die\ area}$
$SpecRatio=\frac{CPU\ time_{reference}}{CPU\ time_{rated}}\propto Performance$
SPEC Power Benchmark
- power consumption of server at different workload levels
- divided into 10% increments
==Amdahl's law==
$T_{improved}= \frac{T_{affected}}{improved factor}+T_{unaffected}$
Make the common case faster!!
MIPS = million of instructions Per second
## CH3
### linker & loader
```graphviz
digraph hierarchy {
nodesep=1.0 // increases the separation between nodes
node [color=Red,fontname=Courier,shape=box] 1 [label="C program"]
3 [label="Assembly language program"]
5 [label="Object:Machine language module"]
6[label="Object: Library routine"]
8[label="Executable"]
10[label="Memory"]
node [color=Blue,fontname=Courier,shape=egg]
2[label="Compiler"]
4[label="Assembler"]
7[label="Linker"]
9[label="Loader"]
edge [color=Blue, style=dashed] //All the lines look like this
1->2->3->4->5
{5 6}->7->8->9->10 // Put them on the same level
}
```
Object file for Unix system contains six distinct pieces
- Object file header: size and position of the other pieces of the object file
- text segment: machine code
- static data segment: data allocated for the lifetime
- relocation information: instuctions and data words that depend on absolute addresses when the program is loaded into memory
- symbol table: remaining labels thath are not defined, such as external references
- debugging information