/1/DMux.hdl
http://github.com/happy4crazy/elements_of_computing_systems · Unknown · 19 lines · 15 code · 4 blank · 0 comment · 0 complexity · 6a374a92bd8c14660d065a3304d22c59 MD5 · raw file
- // This file is part of the materials accompanying the book
- // "The Elements of Computing Systems" by Nisan and Schocken,
- // MIT Press. Book site: www.idc.ac.il/tecs
- // File name: projects/01/DMux.hdl
-
- /**
- * Demultiplexer. If sel = 0 then {a = in; b = 0} else {a = 0; b = in}
- */
-
- CHIP DMux {
-
- IN in, sel;
- OUT a, b;
-
- PARTS:
- Not(in=sel, out=notsel);
- And(a=in, b=notsel, out=a);
- And(a=in, b=sel, out=b);
- }