Last active
April 14, 2019 22:02
-
-
Save dance2die/562a0e63f8451de351ec3d3a4eb5c494 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function addOneBit(v1, v2) { | |
return halfAdder(v1, v2); | |
} | |
[[0, 0], [0, 1], [1, 0], [1, 1]].map(v => | |
console.log(`addOneBit(${v[0]}, ${v[1]})`, addOneBit(v[0], v[1])) | |
); | |
// result | |
// addOneBit(0, 0) { c: 0, s: 0 } | |
// addOneBit(0, 1) { c: 0, s: 1 } | |
// addOneBit(1, 0) { c: 0, s: 1 } | |
// addOneBit(1, 1) { c: 1, s: 0 } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment