De-bus pins?
Posted by
mmiller7 on
URL: http://nand2tetris-questions-and-answers-forum.52.s1.nabble.com/De-bus-pins-tp2802816.html
I'm working on the CPU and I wonder if there's any easy way to reference a sub-bus without using lots of extra gates?
For example, instead of typing "instruction[11]" over and over I want to type "c1" to reference the bit.
I came up with this but it seems ridiculously inefficient adding over a dozen extra And-gates:
//Rename the pins
And(a=instruction[11], b=true, out=c1);
And(a=instruction[10], b=true, out=c2);
And(a=instruction[9], b=true, out=c3);
//...and so on
P.S. I don't think this hdl is giving anything away, it's just the definition of the C-Instruction bits directly from the book, I'm not really doing any logic.