1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

論理演算のNAND表現

Last updated at Posted at 2024-05-02

はじめに

ここ半年ほどTuring Completeにハマっています。
Turing Completeは論理回路を自分で設計して、最終的にCPUの完成を目指すゲームです。私はこのゲームでNAND演算とシフト演算、それとメモリにアクセスすることだけできるCPUを作りました。

本題

NANDだけで演算するための変換式を備忘録として残しておきます。
便宜上、NAND演算子は|とします。

a = b

a = (b|b)|(b|b)

NOT

\bar a = a | a

AND

a \cdot b = (a | b) | (a | b)

OR

a+b=(a|a)|(b|b)

XOR

a \oplus b=(a | (a|b))|(b | (a|b))

おわりに

覚えておきたい式を発見したら追記します。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?