PageRenderTime 511ms CodeModel.GetById 226ms app.highlight 2ms RepoModel.GetById 174ms app.codeStats 0ms

/1/DMux4Way.hdl

http://github.com/happy4crazy/elements_of_computing_systems
Unknown | 22 lines | 17 code | 5 blank | 0 comment | 0 complexity | ca02c7b69145363def36289c0e8bc855 MD5 | raw file
 1// This file is part of the materials accompanying the book 
 2// "The Elements of Computing Systems" by Nisan and Schocken, 
 3// MIT Press. Book site: www.idc.ac.il/tecs
 4// File name: projects/01/DMux4Way.hdl
 5
 6/**
 7 * 4-way demultiplexor.  The 2-bit sel input selects the output to which 
 8 * the in input will be channeled: 00 to a, 01 to b, 10 to c, 11 to d.
 9 * The other outputs are set to 0.
10 */
11
12CHIP DMux4Way {
13
14    IN  in, sel[2];
15    OUT a, b, c, d;
16
17    PARTS:
18    DMux(in=in, a=ab, b=cd, sel=sel[1]);
19    DMux(in=ab, a=a, b=b, sel=sel[0]);
20    DMux(in=cd, a=c, b=d, sel=sel[0]);
21}
22