Re: Replicate 1 bit 16 times to give a 16 bit bus?
Posted by cadet1620 on Nov 14, 2010; 2:55pm
URL: http://nand2tetris-questions-and-answers-forum.52.s1.nabble.com/Replicate-1-bit-16-times-to-give-a-16-bit-bus-tp1386664p1899360.html
There were a couple times I wanted to expand a 1-bit signal into a 16-bit bus and came up with this one line, but rather inefficient, solution by thinking about strange ways to use the chips already made:
Mux16(a=false, b=true, sel=1-bit-signal, out=16-bit-bus);
This is mostly just a cute trick, though. It would be better to write a chip named something like Bus16 to do this job more efficiently. It also makes the HDL more readable!