The "sub bus of an internal node may not be used" error is an annoying limitation of HDL. All buses must be created at their full width when connected to a part output. You can connect multiple wires and buses to a part output so you can create multiple narrower buses from a wide output, but you cannot connect multiple part outputs to make a bus. Your code would need to read something like
Assuming that you have a working Mux.hdl, why are you replicating its low-level implementation 16 times? The layers-of-abstraction thinking that TECS encourages would have you think about how you can use what you've already built to build your Mux16.And(a=notsel, b=a[0], out=x0); And(a=notsel, b=a[1], out=x1); And(a=notsel, b=a[2], out=x2); ... Or16(a[0]=x0, a[1]=x1, a[2]=x2,...
The easiest way to make a single signal a bus-wide signal is
but that doesn't help much in making a Mux16.Mux16(sel=signal, a=false, b=true, out=signal16);
--Mark
Free forum by Nabble | Edit this page |