2015-04-01から1ヶ月間の記事一覧

Not16.hdl

/** * 16-bit Not: * for i=0..15: out[i] = not in[i] */ CHIP Not16 { IN in[16]; OUT out[16]; PARTS: Not(in=in[0],out=out[0]); Not(in=in[1],out=out[1]); Not(in=in[2],out=out[2]); Not(in=in[3],out=out[3]); Not(in=in[4],out=out[4]); Not(in=in[…

Or16.hdl

// This file is part of www.nand2tetris.org // and the book "The Elements of Computing Systems" // by Nisan and Schocken, MIT Press. // File name: projects/01/Or16.hdl /** * 16-bit bitwise Or: * for i = 0..15 out[i] = (a[i] or b[i]) */ CHI…

And16.hdl

// This file is part of www.nand2tetris.org // and the book "The Elements of Computing Systems" // by Nisan and Schocken, MIT Press. // File name: projects/01/And16.hdl /** * 16-bit bitwise And: * for i = 0..15: out[i] = (a[i] and b[i]) */…

DMux.hdl

// This file is part of www.nand2tetris.org // and the book "The Elements of Computing Systems" // by Nisan and Schocken, MIT Press. // File name: projects/01/DMux.hdl /** * Demultiplexor: * {a, b} = {in, 0} if sel == 0 * {0, in} if sel ==…

Mux.hdl

// This file is part of www.nand2tetris.org // and the book "The Elements of Computing Systems" // by Nisan and Schocken, MIT Press. // File name: projects/01/Mux.hdl /** * Multiplexor: * out = a if sel == 0 * b otherwise */ CHIP Mux { IN …

Xor.hdl

// This file is part of www.nand2tetris.org // and the book "The Elements of Computing Systems" // by Nisan and Schocken, MIT Press. // File name: projects/01/Xor.hdl /** * Exclusive-or gate: * out = not (a == b) */ CHIP Xor { IN a, b; OUT…