A block you plug
onto the main road
一块能接上
主干道的积木

No hardware background needed. About five minutes to read. 不需要硬件基础。这一页大约 5 分钟讲明白。

寄存器接口 register port CLK RST
Three kinds of port cross the case. The plug on top reaches the chip's main road — that road is called the bus. Goods go in one side and out the other. CLK is the clock, the chip's beat; RST is reset, back to a known state at power-up. The violet crate is the one being handed over. 三类接口穿过外壳。上面那个插头接到芯片的主干道上(那条路叫总线)。货从一头进,另一头出。CLK 是时钟,芯片的节拍;RST 是复位,一上电先回到已知状态。紫色那件是正在被交出去的货。

What is this block? 这块积木是什么?

IP coreIP core a ready-made circuit block you drop into your own chip 别人做好的一块电路,买来直接装进自己的芯片

A vending machine has three parts: panel, coil channels, control board. This block has the same three. 一台自动售货机分三部分:面板、货道、控制板。这块积木也是这三样。

It's like…就像……

A vending machine: you press the panel, one coil turns, a bottle drops. Whether it turns at all is the control board's call. 一台自动售货机:面板上按一下,里面的货道转一格,一瓶水掉下来。转不转,由里面的控制板说。

自动售货机 a vending machine 这块积木 this block 寄存器块 register block 数据通路 data path 控制板 control board
Layer for layer: panel to register block, coil channels to data path, control board to control board. The panel never touches the goods; it only tells the control board what to do. The violet bottle is the item on its way. The three circles are the control board's states. Where the goods enter and leave is drawn on the next two screens. 一层对一层:面板对寄存器块,货道对数据通路,控制板对控制板。面板不碰货,它只告诉控制板要什么。紫色那瓶就是正在被交出去的那件货。三个圈是控制板的几个状态;货从哪进哪出,后面两屏画。

The CPU only talks through this panel CPU 只能从这块面板说话

寄存器 registerregister one slot on that panel: write it, the block acts differently 面板上的一格:写一下,这块积木就换个做法

The panel has three slots: one starts it, one says how much, one is read-only. Reading that one asks whether it is busy. 面板上有三格:一格按下就开始,一格写一次做多少,一格只能读。读那一格,是问它忙不忙。

CPU write read 开始 start it 一次多少 how much 忙不忙 busy or not
The road across the middle is the bus, the chip's own main street. CPU is the core running your program; the violet chit is the value it just wrote. Write and read are two separate lines, one direction each. The thick belt below the panel is the data port. Goods use that door; it never enters the panel. The three slots are start it, how much, and busy or not. 中间那条街就是总线,芯片自己的主干道。CPU 是跑你程序的那颗核;紫色那张条子,是它刚写下去的值。写和读是两条线,各走一个方向。面板下面那条粗带子是数据口:货走那扇门,不经过面板。三格分别是开始、一次多少、忙不忙。

Goods on the thick line, orders on the thin one 粗线走货,细虚线发令

Goods come in on the left, pass through both work blocks, leave on the right. The control board carries nothing; it only says when to move. 货从左边进来,穿过两个处理块,从右边出去。粗线是数据通路,细虚线是控制通路:只发令,不走货

从总线来 from the bus 寄存器块 register block 控制板 control board 控制通路 control path 数据通路 data path CLK RST
The port moves 4 bytes a beat — 32 bits. Say the clock beats a hundred million times a second. With neither side waiting that is 400 MB a second — a 4 GB film in ten seconds. The far end of that belt usually goes to memory. The busy lamp is lit by the control board. This block has its own port, so goods skip the panel. Some blocks have none: a serial port sends one byte at a time. Its transmit register THR is one such slot, and its goods really do cross the panel. 数据口一次搬 4 个字节,也就是 32 位。时钟比如一秒一亿拍。两边都不等的时候就是一秒 400 MB —— 一部 4 GB 的电影十秒搬完。这条带子的另一头通常接着内存。忙不忙那一格,由控制板点亮。这块积木有自己的数据口,货不穿过面板。也有的积木没有数据口。串口(一次一个字节收发的那种口)的发送寄存器 THR 就是这样一格。那种积木的货真的要穿过面板。

Why does each side raise a hand? 为什么两边都要举手?

The two sides run at different speeds, so the ready one waits with its hand up. 两边快慢不一样,先准备好的那边举着手等,货就不会丢。

It's like…就像……

The same machine: the coil says "one is ready", the bin says "I have room". Only then does the bottle drop. 还是那台售货机:货道说「这瓶好了」,取货口说「我这空着」。两句都出来,瓶子才掉。

1

Room to take, nothing to give 收的有空,送的没货

2

A hand up, but the taker is busy 送的举着手,收的忙着

3

Both hands up — it moves 两个都举着手 —— 成交

valid ready giver taker
The flag on each pole is that hand: flying means up, furled means down. The upper line leaves the giver: valid, "I have one, take it." The lower one comes back from the taker: ready, "I have room." The giver never waits for the taker. The taker may wait for the giver's hand. A raised hand and its bottle stay put until the handover beat. 两根杆上的小旗就是那只手:展开是举着,垂下是放下。上面那条线从送的一边出发,叫 valid:我这有一件,拿去。下面那条从收的一边回来,叫 ready:我这有空,来吧。送的从不等对方先举,收的可以等看见对方举手再举。举了手没成交,瓶子和手都不许放下。