summaryrefslogtreecommitdiff
path: root/tools/builtInChips/HalfAdder.hdl
blob: 1591b96f10325124011b68d8f86e22ebc93e77a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// This file is part of www.nand2tetris.org
// and the book "The Elements of Computing Systems"
// by Nisan and Schocken, MIT Press.
// File name: tools/builtIn/HalfAdder.hdl

/**
 * Half adder. Computes sum, the least significnat bit of a + b,
 * and carry, the most significnat bit of a + b.
 */

CHIP HalfAdder {

    IN  a, b;
    OUT sum,   // LSB of a + b
        carry; // MSB of a + b

    BUILTIN HalfAdder;
}