John Mavrick's Garden

Search IconIcon to open search

Last updated Unknown

Links: Computer Gates - Nand2Tetris Project 1

Mux Gate

Notes

Code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
CHIP Mux {
    IN a, b, sel;
    OUT out;

    PARTS:
	Not(in=sel, out=nandSel);
    And(a=a, b=nandSel, out=aAndSel);
	And(a=sel, b=b, out=bAndSel);
	Or(a=aAndSel, b=bAndSel, out=out);
	
}

Truth Table

a b sel out
0 0 0 0
0 1 0 0
1 0 0 1
1 1 0 1
0 0 1 0
0 1 1 1
1 0 1 0
1 1 1 1

Interactive Graph