目次
ベン図で表す「AND・OR・ NOT」
コンピュータの演算装置は,0 か1のみで表現される 。そして、これを2 進数で扱えるように設計されている。その基本的な演算は四則演算とは異なり AND,OR,NOT の3つである。0 を「なし」,1 を「あり」と考え,ベン図と表で表現すると以下のようになる。
![](https://looplearning-community.com/wp-content/uploads/2022/03/A-and-B.png)
![](https://looplearning-community.com/wp-content/uploads/2022/03/A-not-B.png)
![](https://looplearning-community.com/wp-content/uploads/2022/03/A-or-B.png)
![](https://looplearning-community.com/wp-content/uploads/2022/03/B-not-A.png)
![](https://looplearning-community.com/wp-content/uploads/2022/03/not-A.png)
![](https://looplearning-community.com/wp-content/uploads/2022/03/not-B.png)
論理演算「AND・OR・ NOTの計算」
A or B の場合(論理和)
![](https://looplearning-community.com/wp-content/uploads/2022/03/A-or-B-1.png)
0 or 0 = 0
0 or 1 = 1
1 or 0 = 1
1 or 1 = 1
A or B の計算式
![](https://looplearning-community.com/wp-content/uploads/2022/03/Screen-Shot-2022-03-12-at-11.39.22-PM.png)
A and B の場合(論理積)
![](https://looplearning-community.com/wp-content/uploads/2022/03/A-and-B.png)
0 and 0 = 0
0 and 1 = 0
1 and 0 = 0
1 and 1 = 1
A and B の計算式
![](https://looplearning-community.com/wp-content/uploads/2022/03/Screen-Shot-2022-03-12-at-11.34.31-PM.png)
not A の場合
![](https://looplearning-community.com/wp-content/uploads/2022/03/not-A.png)
not 0 = 1
not 1 = 0
not B の計算式
![](https://looplearning-community.com/wp-content/uploads/2022/03/Screen-Shot-2022-03-12-at-11.53.37-PM.png)
not B の場合
![](https://looplearning-community.com/wp-content/uploads/2022/03/not-B.png)
not 0 = 1
not 1 = 0
not B の計算式
![](https://looplearning-community.com/wp-content/uploads/2022/03/Screen-Shot-2022-03-12-at-11.54.11-PM.png)