Adds MUX
This commit is contained in:
parent
627d56f1eb
commit
2cfa691be3
|
@ -14,5 +14,8 @@ CHIP Mux {
|
|||
OUT out;
|
||||
|
||||
PARTS:
|
||||
// Put your code here:
|
||||
Not(in=sel, out=n);
|
||||
And(a=a, b=n, out=x);
|
||||
And(a=b, b=sel, out=y);
|
||||
Or(a=x, b=y, out=out);
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
| a | b | sel | out |
|
||||
| 0 | 0 | 0 | 0 |
|
||||
| 0 | 0 | 1 | 0 |
|
||||
| 0 | 1 | 0 | 0 |
|
||||
| 0 | 1 | 1 | 1 |
|
||||
| 1 | 0 | 0 | 1 |
|
||||
| 1 | 0 | 1 | 0 |
|
||||
| 1 | 1 | 0 | 1 |
|
||||
| 1 | 1 | 1 | 1 |
|
Loading…
Reference in New Issue