# Introduction
# 计算机架构的方向
- security
- energy-efficient
- low latency, predictable
- architectures for AI
我们通常设计整个系统,而不是某一层
# 课程关于
计算机是怎样工作的。
作为科学家,应该了解它是怎样工作的,否则没有其他人知道。
Focus on learning experience.
# 内存
内存存取的延迟比计算更高。现代计算机系统的问题更多是关于内存的 。
对于简单的计算,内存访问消耗 6400 倍能量
# Rowhammer attack
在内存里,当我们不断存取一个 row 的时候,相邻的 row 会产生 bit flip.
原因是: electrical interference. 当一行电压高的时候,相邻的行损失电能。
大多数 DRAM Modules 存在漏洞
# Goals of Course
- Enable you to think critically
- Enable you to think broadly
# Preparation
If you're prepared to see something, you can see something.
If you don't have an background to see an opportunity, the opportunity comes to you will just miss it.
# Architecture
Architecture based on principle, and not upon precedent.
# Combinational Logic
# Transistors
计算机由很多个小结构组成:晶体管
# Mos Transistor
结合
- Conductors (Metal)
- Insulators (Oxide)
- Semiconductors
我们有 2 种 MOS Transistor, n-type
和 p-type
它们像开关一样工作。
# N type MOS Transistor
如果 Gate 被施加高电压,Drain 和 Source 就会被导通。
和技术相关,高电压值可能在 [0.3V, 3V]
如果在临界值,开关的结果可能是随机的。
p-type transistors are good at pulling down the voltage
# P type MOS Transistor
和 N type 工作相反。当 Gate 被施加高电压的时候,会形成断路。
p-type transistors are good at pulling up the voltage
# Logical Gates
我们用 MOS Transistor 构造基本的逻辑门,它们实现了基本的逻辑运算。
# CMOS (NOT Gate)
Complementary MOS 技术。现代计算机普遍使用 CMOS.
nMOS + pMOS=CMOS
<img src="https://nerdsdostuff.com/wp-content/uploads/2024/03/CMOS-Inverter-Circuit-Image.png" alt="CMOS Inverter: Basics, Working and Applications - Nerds Do Stuff" style="zoom:33%;" />
它实现了 not 的逻辑。
逻辑门里圆圈的意思是区反。
# NAND
# AND
# Common Logic Gates
# Power Consumption
- 动态功耗:电能被用来存储,当信号转换的时候 (0,1 转化)
- 静态功耗:当 signal 不变的时候的功耗,因为漏电
# Enabling Manufacturing:EUV
制造芯片的技术
# 逻辑运算
# 1bit 全加器
+
是或, *
是 AND
# Duality
每个式子有一个 dual 的,转换方法
- AND 和 OR 转换
- 常数 0 和 1 转换
# 简化定理
# DeMorgan's Law
# Standard Function Representation
Sum of Pruducts (SOP)
Product of Sums(POS)
Implicant: producto of literals
Minterm: product that include all literals
Maxterm: sum that include all literals
可以写成
就算 Minterm 二进制是 3 的 literal
大写 M 是 Maxterm
# Combinational Building Blocks
# Decoder
input pattern decoder
把数转换成下标
用处:可以把 A 当作内存地址,那么 Y 就知道要激活哪一行。也可以是 opcode 解码
# Multiplexer (MUX), or Selector
如果 S 是 0 那么就是 的输入,否则就是 的输入
MUX 可以被用作 Look Up Table
# Programmable Logic Array
左边是 Minterm, 我们要设置 connection (编成), 是的右边的 Or 连接正确的 Minterm.
如果 minterm 在 SOP 里出现,那我们连接对应的 AND Gate 到 OrGate 上.
# Equality Checker
可以用 XNOR Gate 实现相等检查
# Tri State Buffer
# Sequencial Logic Design
输出还和过去的输入有关
# Storage elements
# Cross Coupled Inverters
# SRAM
# The Big Picture: Storage Elements
- Latches and Flip-Flops
- Very fast, very expensive (1 bit costs 10s of transistors)
- SRAM
- expensive (1 bit costs 6 transistors)
- DRAM
- Cheap
- hard disk
- very cheap
# RS Latch
Reset-Set Latch