/1/DMux8Way.hdl
http://github.com/happy4crazy/elements_of_computing_systems · Unknown · 22 lines · 17 code · 5 blank · 0 comment · 0 complexity · 3dcc57fb6e76a72f79263986c0348e5c 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/DMux8Way.hdl
-
- /**
- * 8-way demultiplexor. The 3-bit sel input selects the output to which
- * the in input will be channeled: (000 to a, 001 to b, ..., 111 to h).
- * The other outputs are set to 0.
- */
-
- CHIP DMux8Way {
-
- IN in, sel[3];
- OUT a, b, c, d, e, f, g, h;
-
- PARTS:
- DMux(in=in, a=abcd, b=efgh, sel=sel[2]);
- DMux4Way(in=abcd, a=a, b=b, c=c, d=d, sel=sel[0..1]);
- DMux4Way(in=efgh, a=e, b=f, c=g, d=h, sel=sel[0..1]);
- }