[02] HalfAdder done

This commit is contained in:
Nemo 2020-05-20 15:22:50 +05:30
parent de816a702f
commit 67e8249e7e
2 changed files with 8 additions and 2 deletions

View File

@ -9,9 +9,10 @@
CHIP HalfAdder {
IN a, b; // 1-bit inputs
OUT sum, // Right bit of a + b
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);
}

View File

@ -0,0 +1,5 @@
| a | b | sum | carry |
| 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 1 |