Re: is my DMux4Way solution inelegant?
Posted by
Loafers on
URL: http://nand2tetris-questions-and-answers-forum.52.s1.nabble.com/is-my-DMux4Way-solution-inelegant-tp4025906p4025918.html
Welp, I incorporated DMux in the implementation this time and it works, but I'm not quite sure if it was the cleanest solution possible:
Xor(a=sel[1], b=sel[0], out=xor1);
Not(in=xor1, out=not1);
And(a=true, b=sel[0], out=and1);
And(a=not1, b=in, out=and2);
DMux(in=and2, sel=and1, a=a, b=d);
And(a=xor1, b=in, out=and3);
DMux(in=and3, sel=and1, a=c, b=b);
I think I'll take ybakos advice to not get too hung up on this :)