/2/ZN.hdl
http://github.com/happy4crazy/elements_of_computing_systems · Unknown · 12 lines · 10 code · 2 blank · 0 comment · 0 complexity · 76d1cb172a9873076b0d1adcfdac6e63 MD5 · raw file
- CHIP ZN {
- IN in[16], z, n;
- OUT out[16];
- PARTS:
- // first decide whether to zero input
- Mux16(a=in, b=false, sel=z, out=zout);
- // then decide whether to negate possibly zeroed input
- Not16(in=zout, out=notzout);
- Mux16(a=zout, b=notzout, sel=n, out=out);
- }