From d3a0cc3a8ba6dfeb64d3faeffdeb6845b60e5840 Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Sat, 20 Jan 2018 15:41:49 +0100 Subject: rearranged the dir for github - removed tools and pdfs - rearranged the projects dirs - added md files - other minor changes --- chips/HalfAdder.hdl | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 chips/HalfAdder.hdl (limited to 'chips/HalfAdder.hdl') diff --git a/chips/HalfAdder.hdl b/chips/HalfAdder.hdl new file mode 100644 index 0000000..0b40509 --- /dev/null +++ b/chips/HalfAdder.hdl @@ -0,0 +1,19 @@ +// 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/02/HalfAdder.hdl + +/** + * Computes the sum of two bits. + */ + +CHIP HalfAdder { + IN a, b; // 1-bit inputs + OUT sum, // Right bit of a + b + carry; // Left bit of a + b + + PARTS: + // Put you code here: + Xor (a=a, b=b, out=sum); + And (a=a, b=b, out=carry); +} -- cgit v1.2.3