计算组

type
status
date
slug
summary
tags
category
icon
password
网址

一. 计算机系统概述

notion image
notion image
notion image
notion image
notion image
notion image
notion image
notion image
notion image
notion image
notion image
notion image
notion image

二. 数据的表示和运算

notion image
notion image
notion image
notion image
notion image
真值: 人类习惯的数 -8
机器数: 1 1000
源码 正数 反码 补码 一致
负数 反码取反1 补码+1 移吗 补码基础上 符号位取反
 
notion image
notion image
notion image
notion image
 

2.1.4

数据扩展, 无符号的, 直接补0
带符号的 , 正的 补0 负的 符号 数据分开 中间补1
 

2.2.1 加法器

notion image
notion image
notion image
notion image
notion image
notion image
notion image
notion image

2.2.4 乘除

notion image
notion image
notion image
notion image
notion image
notion image
notion image
notion image

2.3.1 浮点数

notion image
notion image
notion image
 
notion image

2.3.2

notion image

三 存储器

3.1

notion image
 
DRAM芯片:使用栅极电容存储信息
SRAM芯片:使用双稳态触发器存储信息
核心区别:存储元不一样3.3
notion image
notion image
notion image
notion image
notion image
notion image
notion image
译码器0 接了两个16K*4位的

3.4 存储器

notion image
notion image
notion image

3.5 cache

 
性能分析 先访问 或同事访问
 
cache 和内存映射方式
 
notion image
notion image
notion image
全相联 和 分组需要替换算法
  1. 随机
  1. 先进先出 FIFO (按照顺序放 轮流替换) 没局部性 刚被换出立马访问 抖动
  1. LRU 近期最少使用 计数器
notion image
做题往前看
notion image
notion image
写回法, 先写cache 淘汰的时候写回主存, 用标志位标志是否脏位
全写法: 同时都写, 写缓冲
 
写不命中:
写分配法:调到cache, 修改cache, 再写回法
非写分配法: 写到主存
notion image

四 指令系统

notion image
notion image
一地址指令 ACC +
notion image
notion image
notion image

4.1 扩展操作码

指令=操作码+若干个地址码
 
定长操作码 可变长操作码
根据前面是否全1111 判断是几地址指令
notion image
notion image
notion image

4.2 指令寻址

跳跃, pc 指明
 

4.2.2 数据寻址

notion image
直接寻址:2次访存
立即寻址 load #985 立即数 不需要寻址
notion image
notion image
notion image
notion image
 
相对寻址 是程序内部的浮动
基址寻址 是整段程序的浮动

4.2.1

notion image
notion image
notion image
notion image

4.3.4 函数调用

  1. call <函数名>指令
      • 作用
        • 将当前程序计数器(IP,指令指针)的旧值(返回地址)压入栈顶,保存于调用者栈帧顶部。
        • 无条件跳转至被调用函数的第一条指令(IP 新值为被调用函数起始地址)。
      • 本质:实现函数调用的跳转,并记录返回位置。
  1. ret指令
      • 作用
        • 从栈顶取出 IP 旧值(返回地址),恢复 IP 寄存器,返回调用者函数继续执行。
      • 依赖:返回地址需提前由call指令压栈保存。
notion image
mov ebp, [esp]
记录上层新旧顶基地址
notion image
notion image
notion image

五. cpu 功能结构

5.1 结构

notion image
notion image
notion image
notion image

5.2 执行过程

notion image
 

5.3.2 专用数据通路

5.4 控制器 cu

notion image

5.4.1 硬布线控制器

notion image
notion image
notion image
notion image
notion image
notion image
 
硬布线 一般risk 指令
notion image
 

5.4.2 微程序控制器

notion image
notion image
notion image

5.6 指令流水线

notion image
notion image
notion image
notion image
 
上一篇
下一篇
kyziliao
Loading...