Re: Usefulness of internal pins which are (implicitly) buses?

Posted by neophyte on
URL: http://nand2tetris-questions-and-answers-forum.52.s1.nabble.com/Usefulness-of-internal-pins-which-are-implicitly-buses-tp4035549p4035561.html

Thanks.  I do see how internal buses are useful--as I think you indicate--for routing different chunks of an output outward to different destinations (and chunks from different sources inward into the same, larger multi-bit part).  This much is clearer gestured at in the example from A.5.3:

Foo(in[2..4]=v, in[6..7]=true, out[0..3]=x, out[2..6]=y)

[Where v has already been fixed as a 3-bit internal bus and is fed into Foo as part of the input, and x and y are fixed by this line of code as 4-bit and 5-bit internal buses, respectively, and fed out as separate chunks, presumably to different destinations.]

I gather internal buses can be valuable for routing entire outputs, not just pieces, between parts as well (e.g., one n-bit part's output into the input of another n-bit part).  [Though, I guess this is just a degenerate case of the preceding.]

But, I now take it, internal buses do not obviate the necessity of separate input statements for each bit of an n-ary external input bus, or the necessity of a separate output statement for each bit of an n-ary external output bus.  I gather this is the mistake I made in my chip FlipAnd16.