KBone12 / nand2tetris-rs

I try doing [Nand to Tetris](https://www.nand2tetris.org/) in Rust.
https://kbone12.github.io/nand2tetris-rs/
1 stars 0 forks source link

Xor の実装を最小 Nand にする #14

Closed KBone12 closed 3 years ago

KBone12 commented 3 years ago

配線を分配できないという条件を考えても、次の実装の方が Nand の数が少なくなるので、実装を変更する。

fn xor(a: bool, b: bool) -> bool {
    nand(nand(a, not(b)), nand(not(a), b))
}