.
This commit is contained in:
Executable
+17
@@ -0,0 +1,17 @@
|
||||
|
||||
/**
|
||||
* Multiplexor:
|
||||
* out = a if sel == 0
|
||||
* b otherwise
|
||||
*/
|
||||
|
||||
CHIP Mux {
|
||||
IN a, b, sel;
|
||||
OUT out;
|
||||
|
||||
PARTS:
|
||||
Not(in=sel,out=notsel);
|
||||
And(a=a,b=notsel,out=out1);
|
||||
And(a=b,b=sel,out=out2);
|
||||
Or(a=out1,b=out2,out=out);
|
||||
}
|
||||
Reference in New Issue
Block a user