计算机结构 -- week 4

指令集: CPU可以理解的完整的指令集合 形式: 机器代码,二进制, 汇编代码 assembly codes

 

最后一个 operand 是 ans的存放地址 

操作数(数据)的存放地址 : Main memory •  CPU register (or registers) •  I/O device

指令表示representations: 通过汇编语言(assembly language), 比如 add a,b 而机器表示就是 01 字符串

指令类型: Data processing •  Data storage (main memory) •  Data movement (I/O) •  Program flow control. 

各种各样的数据类型格式啥的. 

仔细看他是如何表达的:

3个地址: 需要很长的位去储存, 不常见

2个地址 : 何时的位去储存, 需要 寄存器 , 

1个地址, 有隐含的地址去搞, 在早期机器常见

0个地址, 地址都是隐藏的 implicate, 用stack去存

地址的越多, 指令集种类越多, 一个程序就需要的指令就少, 而调用指令就满, 反之就反

指令类型:

  • tansfer
  • Arithmetic
  • logical 二进制的操作
  • conversion 数据类型转化
  • input/ouput
  • Systems control (指令所属的环境)
  • Transfer of control : instruction 指令的控制(下一个指令的地址) (类型:分支, skip,Subroutine call(子程序调用))

字节顺序: 大端和小端

不管是哪一个, 地址存放时, 都是小地址到大地址,

比如向内存地址为0X1000的地址写入0X12345678这个四字节16进制数,

大端: 就是小地址存放最大有效位,

小端: 就是小地址存放最小有效位

 

CUP结构:

The CPU must • Fetch instructions • Interpret instructions (解释指令)• Fetch data • Process data • Write data

Register: 寄存器, 临时用来工作的空间, 有不同的数量和功能, 是很重要的概念:

相应结构: 

PC Program counter
IR Instruction register
MAR Memory address register
MBR Memory buffer register

general purpose register : 数量通常8-32, Fewer = more memory references , Large enough to hold a full address Large enough to hold a full word (often by two)

Program status word registe :Zero (when result is zero) • Carry • Overflow • Interrupt enable/disable 

 

Data flow (instruction fetch)

This depends on the precise CPU design. In general, the fetch consists of 1. PC contains address of next instruction 2. Address is moved to MAR 3. Address place on address bus 4. Control unit requests memory read 5. Result place on data bus, copied to MBR, then to IR 6. Meanwhile PC is incremented by 1

Indirect cycle 包含在其中. 

Prefetch: ewe can fetch the next instruction at the same time as executing the current instruction

Pipelining : FI Fetch instruction DI Decode instruction CO Calculate operands (effective addresses) FO Fetch operands EI Execute instructions WO Write result

Pipelining means overlapping these operations.

Multiple streams: Multiple branches lead to further pipelines being needed

 

posted @ 2022-11-04 15:48  VxiaohuanV  阅读(13)  评论(0编辑  收藏  举报