###### tags: `110-2學校上課`
# 計算機組織期末
## ALU control
| 第幾個bit | 功能 |
| ------------ |:---------------- |
| first | aniver |
| second | bne |
| third+fourth | 0:or 1:and 2:add |
## Lookhead
gi = ai*bi
pi = ai+bi
ci = gi + pi * Ci-1
## Multiplication


## Booth's Algorithm
00 nothing
01 +1
10 -1
11 nothing
## Wallace Tree Multiplier
3 數 = sum + array up
先不考慮進位,最後再考慮
## Divide

## Float



## float add

## Round

## Stall
前後stage有使用上衝突,要pipeline stall (bubble)
## Hazards
### Structure Hazards
解決: reg and data mem split
### Data Hazards

#### forwarding
ex to ex
1. Don’t wait for it to be stored in a register
2. Requires extra connections in the datapath
#### Load-Use
mem to ex
lw form mem send to ex
### Control Hazards
##### Delayed branch
把可能會執行的指令搬移到分支指令之後,即delay branch slot
delay branch slot: 分支跳轉指令後的一個時間片段,選擇塞
入一條與分支判斷無關指令(不管分支發生與否均會執行) 。
#### R-type;s Wirte

