Re: Trouble with an error in hardware simulator
Posted by ybakos on
URL: http://nand2tetris-questions-and-answers-forum.52.s1.nabble.com/Trouble-with-an-error-in-hardware-simulator-tp66599p189558.html
Noam or Shimon,
Could you please explain the reason for this? Is it due to the way internal pins are instantiated by the simulator in Java, or is there an actual hardware reason?
This behavior is considered a little 'inconsistent' by my students, and here is why:
Assume that you have a chip within input interface in[16]. I can subscript in...
Or8Way(in=in[0..7], out=x);
But I can never subscript internal pins.
// assume Add16(a=z,b=y,out=sum); where sum is a 16-bit bus but an internal pin
Or8Way(in=sum[0..7], out=x); // DISALLOWED
Again, I understand the rules (and how to properly subscript a multibit output) but why?
(forgive me, but I've only just started diving into the simulator source code)