---
# System prepended metadata

title: 研究所 計算機組織2

---

# 研究所 計算機組織2

:::info
* ***virtural memory 用 write back*** 不用 write through
* 用write back ***read miss will produce write*** 

* RISC allow designer to ***increase register set***
* RISC 較適合 pipeline
:::
![image](https://hackmd.io/_uploads/By78r_xrke.png)




## ==R-type、I-type、J-type==
:::danger
1. R-type : slt 、 **jr** 、 sll
2. I-type : lw 、 sw 、 sll
3. J-type : j 、 jal
:::
![image](https://hackmd.io/_uploads/r1nI7kXLJe.png)
![image](https://hackmd.io/_uploads/By78r_xrke.png)
![image](https://hackmd.io/_uploads/SkxN4JmIyg.png)
![image](https://hackmd.io/_uploads/By78r_xrke.png)



## ==branch和jump可跳的範圍==
![image](https://hackmd.io/_uploads/S1u6ZJQU1l.png)
![image](https://hackmd.io/_uploads/By78r_xrke.png)

![image](https://hackmd.io/_uploads/rJceM1X8Jx.png)
![image](https://hackmd.io/_uploads/ryH-MkXUJx.png)
![image](https://hackmd.io/_uploads/By78r_xrke.png)

## ==multiprogramming、multitasking、degree of multiprogramming==
:::danger
multiprogramming : 

    1. 如果用不到CPU就給別人用
    2. 提高CPU利用率
    3. 讓CPU盡量忙碌

multitasking :

    1. multiprogramming的延伸
    2. 加上在***多個process間經常切換***

degree of multiprogramming : 

    1. mem 中 process 的數量
:::


## ==long term、short term、mid term scheduler==
:::danger
* med term會將低多工度
* med term會在mem不夠時swap out、mem夠時在swap in

:::
![image](https://hackmd.io/_uploads/HknFGrgLye.png)
![image](https://hackmd.io/_uploads/By78r_xrke.png)

## ==process記憶體結構==
![image](https://hackmd.io/_uploads/BJpxTEl8ke.png)
![image](https://hackmd.io/_uploads/By78r_xrke.png)

## ==各種指令必經的路徑==

![image](https://hackmd.io/_uploads/SJnlHdgrkx.png)
![image](https://hackmd.io/_uploads/By78r_xrke.png)

## ==k級管線可提速k倍==
![image](https://hackmd.io/_uploads/HJDkcDaHJe.png)
![image](https://hackmd.io/_uploads/By78r_xrke.png)


## ==single cycle multi cycle clock cycle time 比較==

![image](https://hackmd.io/_uploads/ByNaHulSyl.png)
![image](https://hackmd.io/_uploads/By5cIdxHJe.png)

![image](https://hackmd.io/_uploads/By78r_xrke.png)

![image](https://hackmd.io/_uploads/BkkmU_lSJx.png)
![image](https://hackmd.io/_uploads/By78r_xrke.png)

![image](https://hackmd.io/_uploads/ByloSulH1g.png)
![image](https://hackmd.io/_uploads/By78r_xrke.png)



# ==control hazard==
## ==static branch prediction==
![image](https://hackmd.io/_uploads/r13ka_gSyl.png)
![image](https://hackmd.io/_uploads/By78r_xrke.png)

## ==dynamic branch prediction==
![image](https://hackmd.io/_uploads/rkvzaOlrkg.png)
![image](https://hackmd.io/_uploads/By78r_xrke.png)

![image](https://hackmd.io/_uploads/HykraOgHye.png)

![image](https://hackmd.io/_uploads/By78r_xrke.png)

![image](https://hackmd.io/_uploads/r1L12ueS1g.png)
![image](https://hackmd.io/_uploads/By78r_xrke.png)

## ==branch target buffer 、branch prediction buffer、branch histary table==

![image](https://hackmd.io/_uploads/rkKNWP6ryx.png)
![image](https://hackmd.io/_uploads/By78r_xrke.png)

![image](https://hackmd.io/_uploads/rkE7bPpSke.png)
![image](https://hackmd.io/_uploads/By78r_xrke.png)

![image](https://hackmd.io/_uploads/SJrG-Dprkl.png)
![image](https://hackmd.io/_uploads/By78r_xrke.png)
![image](https://hackmd.io/_uploads/H1mnGwTSkg.png)
![image](https://hackmd.io/_uploads/By78r_xrke.png)
## ==kernal thread的數量與idle關係==
![image](https://hackmd.io/_uploads/ryA3SExI1e.png)
![image](https://hackmd.io/_uploads/By78r_xrke.png)

# ==incresase ILP==
![image](https://hackmd.io/_uploads/Bku_mB9B1g.png)
![image](https://hackmd.io/_uploads/By78r_xrke.png)

## ==increase pipeline depth==

![image](https://hackmd.io/_uploads/HJjY7H9H1l.png)
![image](https://hackmd.io/_uploads/By78r_xrke.png)

## ==multiple issue==
![image](https://hackmd.io/_uploads/SkbJVrqr1g.png)
![image](https://hackmd.io/_uploads/By78r_xrke.png)


## ==static multiple issue、dynamic multiple issue==
![image](https://hackmd.io/_uploads/HkzXEH9ryl.png)
![image](https://hackmd.io/_uploads/By78r_xrke.png)


## ==各種提升ILP的方法==

![image](https://hackmd.io/_uploads/rJa4LuB81x.png)
![image](https://hackmd.io/_uploads/By78r_xrke.png)

## ==speculation==
![image](https://hackmd.io/_uploads/HJ6SPOBLyl.png)
![image](https://hackmd.io/_uploads/By78r_xrke.png)

## ==loop unrolling==
![image](https://hackmd.io/_uploads/Syzh8uSIkl.png)
![image](https://hackmd.io/_uploads/By78r_xrke.png)
