/3/1/Bit.hdl
http://github.com/happy4crazy/elements_of_computing_systems · Unknown · 20 lines · 16 code · 4 blank · 0 comment · 0 complexity · 089f9f0d1016e30eda8e9deaef006f66 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/03/1/Bit.hdl
-
- /**
- * 1-bit memory register.
- * If load[t-1]=1 then out[t] = in[t-1]
- * else out does not change (out[t] = out[t-1])
- */
-
- CHIP Bit {
-
- IN in, load;
- OUT out;
-
- PARTS:
- Mux(a=dffOut, b=in, sel=load, out=dffIn);
- DFF(in=dffIn, out=out, out=dffOut);
- }