+/TECS
git clone https://git.julia.blue/+/TECS
5e97a3a
master
1/** 2 * 4-way demultiplexor: 3 * {a, b, c, d} = {in, 0, 0, 0} if sel == 00 4 * {0, in, 0, 0} if sel == 01 5 * {0, 0, in, 0} if sel == 10 6 * {0, 0, 0, in} if sel == 11 7 */ 8 9CHIP DMux4Way { 10 IN in, sel[2]; 11 OUT a, b, c, d; 12 13 PARTS: 14 Not(in=sel[1],out=w1); 15 And(a=in,b=w1,out=w2); 16 DMux(in=w2,sel=sel[0],a=a,b=b); 17 And(a=in,b=sel[1],out=w3); 18 DMux(in=w3,sel=sel[0],a=c,b=d); 19}