MUX IMPLEMENTATION

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

MUX IMPLEMENTATION

SpartanHalo
Hi guys,

I'm looking to build MUX with Notepad++, this is my code:

CHIP Mux {
     IN a,b,sel;
     OUT out;
     PARTS:
     Not(in=sel, out=notsel);
     And(a=a, b=sel, out=And1);
     And(a=b, b=notsel, out=And2);
     Or(a=And1, b=And2, out=out);
}

What do you think?


Thank you
Reply | Threaded
Open this post in threaded view
|

Re: MUX IMPLEMENTATION

dolomiti7
I think you should test your code. For example in the web-based Hardware simulator. Then compare the truth table with the expected result and you will see that your code is not correct.
Reply | Threaded
Open this post in threaded view
|

Re: MUX IMPLEMENTATION

WBahn
Administrator
In reply to this post by SpartanHalo
Definitely should test it against the test script. But before you do that, you should sanity check it yourself. If sel=0, which signal should survive getting through one of the And gates? Which signal does survive?