これが私が何を意味するかを示す例です。myALU
に以下を含めると、無効になります。
chip ALU {
// ...
PARTS:
// out4 is the output of some internal chip
Or8Way(
in[0..7]=out4[0..7],
out=outa
);
Or8Way(
in[0..7]=out4[8..15],
out=outb
);
Or(a=outa, b=outb, out=out);
}
しかし...そのコードブロックを独自のOr16Way
チップにすると、
CHIP Or16Way {
IN in[16];
OUT out;
PARTS:
Or8Way(
in[0..7]=in[0..7],
out=out0
);
Or8Way(
in[0..7]=in[8..15],
out=out1
);
Or(a=out0, b=out1, out=out);
}
でそれを使用しALU
、
ALU {
// ...
Parts:
Or16Way(in=out4, out=or);
}
すべて順調。どうしてこれなの?あるケースでは入力ピンにインデックスを付け、別のケースでは内部ピンにインデックスを付けました。一方が許可され、もう一方が許可されないのはなぜですか?