[計算機概論] 第四講、Data Manipulation (1)
reference
[計算機概論] 第四講、Data Manipulation (1)臺大科學教育發展中心CASE
課後感想
我們可以使用高階語言,是件幸福的事
簡記課程內容
Computer Architecture
CPU
Registers
Memory
Bus
Motherboard
Motherboard
Machine Instructions
Data transfer
- 主記憶體與 CPU,皆通過 registers 暫存器
- LOAD
- STORE
- 週邊裝置:滑鼠、Mass storage, 鍵盤
Arithmetic/Logic
- AND, OR, ADD, SUB, etc
- SHIFT, ROTATE
Control
- JUMP, HALT
CPU 現在分兩類
CISC
- x86, x86-64 intel 的 CPU
RISC
嵌入是系統如手機
CPU 組成
機械指令 156C
組合語言 LOAD, 5, 6C
高階語言 c = a + b: a 的 pointer 在 6C
Compile 編譯
把高階語言轉成機械指令
不完整,還有 Link
完整流程:
C/C++ ---compile----> object (c out)
還缺 library (函式庫)
人家寫好可以執行的東西
object + library = exe (可執行檔)
這個過程叫 Link
Program Execution
CPU 執行指令的過程
Instruction register (IR): 執行指令 2 bytes
program counter(PC): cell 記憶體位置 1 bytes
Machine Cycle
- fetch:根據 PC 從 main memory 拿資料到 IR
- decode:根據執行指令,知道要幹嘛
- execute:執行
clock 時脈: 1 秒鐘可以執行多少個 cycle (3 * 10^9)
Shift/Rotation
- Logic shift
- Arithmetic shift
- Rotation
Controller
CPU 跟 MM 透過 bus 溝通
周邊系統存取也透過 bus
CPU 再跟某裝置溝通,無法同時跟別人溝通
為了避免同時,因此需要 Controller (小型 CPU )
buffer 可暫存並整理資料,待適當時機再跟 CPU 溝通
Comments
Post a Comment