0

当我Not16Not门实现时:

CHIP Not16 {
    IN in[16];
    OUT out[16];
  
    PARTS:
        Not(in=[0], out=out[0]);
        Not(in=[1], out=out[1]);
        Not(in=[2], out=out[2]);
        Not(in=[3], out=out[3]);
        // ...
        Not(in=[15], out=out[15]);

我在第一部分收到错误“[0]:可能无法使用内部节点的子总线”。

然而,用 16 个 Nand 门来实现这个是很好的:

Nand(a=in[0], b=in[0], out=out[0]);
// ...

有人可以指出问题和区别。

ps 使用Nand2Tetris 中的 HardwareSimulator

4

2 回答 2

2

I believe you have typos in your Not components. The in should be in the form in=in[x], not in=[x] as you have it currently.

Conversely, your Nand components are properly formatted.

于 2021-11-20T14:19:31.757 回答
0

您的格式是正确的,但请尝试 in = in[0] 而不是 in = [0]

于 2022-02-19T03:42:04.270 回答