16bit Mux

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

16bit Mux

NanD
I am not sure how to approach this one.

    Not(in=sel, out=notsel);
        And16(a[0..15]=a, b[0..15]=notsel, out[0..15]=out1);
        And16(a[0..15]=b, b[0..15]=sel, out[0..15]=out2);
        Not16(in[0..15]=out1, out[0..15]=notout1);
        Not16(in[0..15]=out2, out[0..15]=notout2);
        And16(a[0..15]=notout1, b[0..15]=notout2, out[0..15]=out3);
        Not16(in[0..15]=out3, out[0..15]=out);

That was my attempted solution, but HDL tells me that I can't put the value of the single bus 'sel' and 'notsel' into all 16 buses of the 16bit gates.

Does this just mean I have to expand everything out? Or is there a way to turn 'sel' into 16 bits of the same value?

Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: 16bit Mux

NanD
Never mind, I just realized that I can use 16 1bit versions for all of these.
Reply | Threaded
Open this post in threaded view
|

Re: 16bit Mux

cadet1620
Administrator
In reply to this post by NanD
How did you build Not16?  Same idea -- use 16 of something you already have.

--Mark
Reply | Threaded
Open this post in threaded view
|

Re: 16bit Mux

NanD
Ha, I wished I realized that. I used Nand gates for that one and others.