Sillu
Instruction decoder: lesson 11, 23 gatesInstruction decoderZero detector: lesson 10, 10 gatesZero detectorIncrementer: lesson 9, 15 gatesIncrementerALU: lesson 15, 92 gatesALU4-bit adder: lesson 8, 42 gates4-bit adderFull adder: lesson 7, 9 gatesFull adderFull adder: lesson 7, 9 gatesFull adderFull adder: lesson 7, 9 gatesFull adderFull adder: lesson 7, 9 gatesFull adderSILLU-4 COMPUTER · CIRCUIT 19 · 168 GATES · X LAYER 196

A chip school on TapeOut

TapeOut 上的芯片学校

Sillu

Learn to design real chips, from one gate to a working computer. Each lesson ends with a chip you made, live on X Layer.

从一个逻辑门到一台能运行的计算机,学会设计真正的芯片。每节课的结尾,都是一颗你亲手做出、运行在 X Layer 上的芯片。

Build your first chip做出你的第一颗芯片

Lesson 1 starts in your browser. No wallet needed.

第一课在浏览器里开始,不需要钱包。

Sillu is a course for people new to TapeOut. You wire a chip from NAND gates in your browser and tape it out, and the chain itself checks that it works. Pass a lesson and the next one opens. In the last one you build a small computer out of the chips you made on the way.

Sillu 是为 TapeOut 新手准备的课程。你在浏览器里用 NAND 门连出一颗芯片,把它流片上链,由链本身来检查它是否正确。通过一课,下一课才会打开。最后一课,你会用自己一路做出的芯片,搭出一台小计算机。

The chip above is the Sillu-4 computer, circuit 19 on the Sillu processor, drawn from its netlist on X Layer.

上面这颗芯片是 Sillu-4 计算机,Sillu 处理器上的第 19 号电路,按它在 X Layer 上的网表画出。

01The only part唯一的零件

It starts with one gate.一切从一个门开始。

This is a NAND gate. It has two inputs and one output, and it does one thing: the output goes off only when both inputs are on. Press A and B and watch.

这是一个 NAND 门。它有两个输入、一个输出,只做一件事:只有两个输入都开着,输出才会关。按一按 A 和 B 看看。

TapeOut gives you this part, and one more that remembers a single bit. Everything else in the course, you build.

TapeOut 给你这个零件,外加一个能记住一位数据的零件。课程里其余的一切,都由你自己搭出来。

A1B01out

The output is on.输出为开。

02Lesson 6第 6 课

Five gates can add.五个门就能做加法。

Wire five NAND gates this way and they add two bits. Turn both inputs on: one plus one is two, which in binary is 10. One lamp is the sum, the other the carry.

把五个 NAND 门这样连起来,它们就能把两位数相加。把两个输入都打开:一加一等于二,写成二进制就是 10。一盏灯是和,另一盏是进位。

This is the half adder. The drawing is the chip itself: circuit 9 on X Layer, running here from the same wiring that is stored on chain.

这就是半加器。这张图就是芯片本身:X Layer 上的第 9 号电路,在这里按链上保存的同一份连线运行。

A1B01sum0carry

1 + 0 = 1

03Lesson 8第 8 课

Chain four and they add real numbers.连起四个,就能算真正的数。

A chip you have passed becomes a block you can drop into the next one. Four full adders in a row add two four-bit numbers, each handing its carry to the next.

你通过的芯片,会变成下一颗芯片里可以直接使用的模块。四个全加器排成一排,就能把两个 4 位数相加,每一个都把进位交给下一个。

Change the numbers. Every lamp is worked out by the same 42 gates that sit on chain.

改一改这两个数。每一盏灯的结果,都由链上那 42 个门算出来。

Full adderFull adderFull adderFull adderA 10A 21A 41A 80B 11B 21B 40B 80carry011020418016
A6B3

6 + 3 = 90110 + 0011 = 01001

04Lesson 14第 14 课

Give it a memory and it counts.给它记忆,它就会数数。

The second part, the LATCH, holds one bit from one beat to the next. Feed a chip's own answer back into its memory and it can count.

第二个零件 LATCH,能把一位数据从这一拍保存到下一拍。把芯片自己的输出送回它的记忆里,它就能数数了。

Press Tick to give it a beat. Reset sends it back to zero.

按“走一拍”给它一个节拍。按“清零”让它回到零。

Incrementerreset101020408

00000

05The last lesson最后一课

Then it runs a program.然后,它开始运行程序。

Put an adder, a decoder and nine bits of memory together and you have Sillu-4, a small computer. It reads one instruction a beat.

把加法器、译码器和九位记忆放在一起,就得到一台小计算机:Sillu-4。它每一拍读入一条指令。

This program counts down from five. Step through it. Nothing here is a recording: your browser is running the 168 gates of circuit 19.

这段程序从五倒数到零。一步一步走走看。这里没有任何录像:你的浏览器正在运行第 19 号电路的 168 个门。

  1. 0LDI 5put 5 in the accumulator把 5 放进累加器
  2. 1ADD 15add 15, which in four bits takes 1 away加 15,在 4 位里等于减 1
  3. 2JZ 4if the accumulator is 0, jump to line 4如果累加器为 0,跳到第 4 行
  4. 3JMP 1jump back to line 1跳回第 1 行
  5. 4JMP 4stay here: the program is done停在这里:程序结束
Accumulator累加器
0
0000
Next line下一行
0
Carry进位
0
0 beats已走 0 拍

You will build every one of these, starting with the gate.

上面的每一颗,你都会亲手做出来,就从这个门开始。

Build your first chip做出你的第一颗芯片