Logic Circuits, Axioms for Basic Logic

(論理回路, 基本論理の公理化)

Discrete Mathematics I

5th lecture, October 19, 2018

http://www.sw.it.aoyama.ac.jp/2018/Math1/lecture5.html

Martin J. Dürst

AGU

© 2005-18 Martin J. Dürst Aoyama Gakuin University

Today's Schedule

 

Summary of Last Lecture

 

A Note about Attendance

If lecture attendance continues to be low, there may be an unannounced minitest.

 

Last Week's Homework

If you have a problem with accessing the course's web site or submitting your homework, please contact me immediately by email.

Grading is mostly manual and will take some time.

 

Homework Problem One

List all the possible Boolean functions of two variables A and B in a table. Use one row for each Boolean function. Find the/a simplest formula (using ¬, ∧, and ∨).

Solution (logical operators that we will look at from now on are given in []):
A = F
B = F
A = F
B = T
A = T
B = F
A = T
B = T
F F F F F
F F F T AB
F F T F A ∧ ¬B
F F T T A
F T F F ¬AB
F T F T B
F T T F ¬ABA∧¬B; (¬A∨¬B) ∧ (AB) [AB, XOR]
F T T T AB
T F F F ¬(AB) [AB, NOR]
T F F T (A∨¬B) ∧ (¬AB); ¬A∧¬BAB [AB]
T F T F ¬ B
T F T T A ∨ ¬B
T T F F ¬ A
T T F T ¬AB [AB]
T T T F ¬(AB) [AB, NAND]
T T T T T

 

Last Week's Homework: Problem Two

The solution is different for each student!

 

XOR, NAND, and NOR

Boolean functions other than AND, OR, and NOT used frequently in programs and electronic circuits:

 

Truth Tables for XOR, NAND, and NOR

XOR NAND NOR
A B AB AB AB
F F F T T
F T T T F
T F T T F
T T F F F

Logic Circuits

 

Gates Used in Logic Circuits

NOT gate AND gate OR gate
 

 

 

 
XOR gate NAND gate NOR gate
 

 

 

   

 

Example Logic Circuit: Half Adder

Half adder (to add two binary numbers, two half adders and an OR gate per binary digit (bit) are necessary)

inputs outputs
A B C (carry) S (sum)
0 0 0 0
0 1 0 1
1 0 0 1
1 1 1

 

How to Write Logic Circuits

 

Example Logic Circuit: Full Adder

inputs outputs
A B Cin (carry in) Cout (carry out) S (sum)
0 0 0 0 0
0 0 1 0 1
0 1 0 0 1
0 1 1 1 0
1 0 0 0 1
1 0 1 1 0
1 1 0 1 0
1 1 1 1 1

Formulæ:

Cout = ABCin∧XOR(A, B)

S = XOR(XOR(A, B), Cin)

 

Property of NAND and NOR

Theorem: It is possible to implement all boolean functions using only NAND [or only NOR]

Proof:

We know that we can write any boolean function using only ∧, ∨, and ¬ (using a normal form)

If we can write these three boolean operations using only NAND [or only NOR], our proof is complete.

¬ A = NAND(A) [NOR(A)] (alternatively: AA [AA])

AB = ¬¬(AB) = NAND(¬(AB)) = NAND(NAND(A, B))
        [= ¬¬(AB) = ¬(¬A ∨ ¬B) = NOR(¬A, ¬B) = NOR(NOR(A), NOR(B))]

AB = ¬¬(AB) = ¬(¬A ∧ ¬B) = NAND(¬A, ¬B) = NAND(NAND(A), NAND(B))
        [= ¬¬(AB) = NOR(¬(AB)) = NOR(NOR(A, B))]

Q.E.D.

Comment: This is a constructive proof. It is often used for theorems of the form "it is possible...". A constructive proof shows how it is possible...

Comment: This property is important because it is easier to construct a logical circuit where all the gates are the same (e.g. all NAND).

 

Axiomatization

 

Axiomatizations of Basic Logic

(for more axiomatizations, see http://www.cs.unm.edu/~veroff/BA/)

Comment: [+D] indicates that the dual is also an axiom

 

Evaluation of Axiomatizations

Con­sis­tent? Com­plete? Mini­mal? Simple? Obvi­ous?
Axi­oms Op­er­a­tors Overall Length
Standard yes yes yes 6 3 very long yes
Huntington 1904 yes yes yes 8 3 very long yes
Huntington 1933 yes yes yes 3 2 short no
Robbins yes yes yes 3 2 short no
Sheffer yes yes yes 3 1 long no
Wolfram yes yes yes 1 1 very short no

 

Conclusion from Evaluation of Axiomatizations

 

Logical Operations Important for Symbolic Logic

 

Truth Table for Equivalence and Implication

Equivalence Implication
A B AB AB
F F T T
F T F T
T F F F
T T T T

Example of Implication

A: "I will pass Discrete Mathematics I." (antecedent)

B: "I will travel to Okinawa next Spring." (consequent)

AB: "Me passing Discrete Mathematics I implies that I will travel to Okinawa next Spring."
or: "If I will pass Discrete Mathematics I, I will travel to Okinawa next Spring."

 

Implication is True if Antecedent is False

 

Laws of Implication and Equivalence

  1. Rewriting (removing) implication: AB = ¬AB = ¬(A∧¬B)
  2. Rewriting (removing) equivalence: AB = (AB)∧(BA) = (AB)∨(¬A∧¬B)
  3. Transitive laws: ((AB) ∧ (BC)) ⇒ (AC),
    ((AB) ∧ (BC)) ⇒ (AC)
  4. Reductio ad absurdum: A→¬A = ¬A
  5. Contraposition: AB = ¬B→¬A
  6. Properties of equivalence: AB = ¬A↔¬B, ¬(AB) = (A↔¬B)
  7. Properties of implication: T→A = A, F→A = T, A→T = T, A→F = ¬A

 

Difference between → and ⇒

There is a difference between "→" and "⇒".

"→" is an operator of boolean/symbolic logic. "→" can be manipulated like any other operator (e.g. +, -, ×, ÷ in basic arithmetic).

"⇒" tells us humans that we can replace formulæ that match the form on its left side with formulæ that match its right side.

This is best visible in the transitive law for implication: ((AB) ∧ (BC)) ⇒ (AC)

The same difference exists between "↔" and "=".

 

How to Use a Truth Table for a Proof

A B AB AAB AABA
F F F F T
F T F F T
T F F T T
T T T T T

For both methods, add a sentence that says why the proof works.

 

Tautology and Contradiction

 

This Week's Homework

Deadline: October 25 19, 2018 (Thursday), 19:00.

Format: A4 single page (using both sides is okay; NO cover page), easily readable handwriting (NO printouts), name (kanji and kana) and student number at the top right

Where to submit: Box in front of room O-529 (building O, 5th floor)
(There are several boxes, please make sure to use the correct one.)

Problem One

For each of the 16 Boolean functions of two Boolean variables A and B (same as problem 1 of last week), find the shortest formula using only NAND.
You can use NAND with any number of arguments ≧1, but you cannot use T or F.

Hint: Start with simple formulæ using NAND and find out which functions they represent.

Problem Two

Draw logic circuits of the following three Boolean formulæ:

  1. AB ∧ ¬C
  2. NOR(G, XOR(H, K), H)
  3. NAND(E, ¬D) ∧ G

Problem Three

(no need to submit/提出不要)

Create examples for implication and think about why the truth table for implication is the way it is.

(含意の例を作って、含意の真理表と実例を比較して含意を身に着ける。)

Problem Four

(no need to submit)

In preparation for next week's lecture, using your high school books/materials or other sources, research the following terms related to sets, and write a definition and short explanation for each of them:

(高校の本・資料や他の情報を活用して、上記の集合に関連する概念を調査し、定義と簡単な説明を書きなさい。)

 

Glossary

grading
採点 (作業)
exclusive or
排他的論理和
encryption
暗号化
cryptography
暗号学
(electronic) circuit
(電子) 回路
logic circuit
論理回路
master thesis
修士論文
gate
ゲート
half adder
半加算器
bit (binary digit)
ビット
variable name
変数名
implement
実装する
theorem
定理
constructive proof
構成的証明
axiomatization
公理化
complete(ness)
完全 (性)
consisten(t/cy)
一貫 (した・性)
contradiction
矛盾
obvious(ness)
明白な・自明性
symbolic logic
記号論理
equivalence
同値
x is equivalent to y
x と y が同値である
implication
含意
x implies y
x ならば y
antecedent
前件
consequent
後件
pass (some course)
(ある科目を) 合格する
rewriting (removing) implication
含意の除去
rewriting (removing) equivalence
同値の除去
transitive laws
推移律
reductio ad absurdum
背理法
contraposition
対偶
properties of equivalence
同値の性質
properties of implication
含意の性質
tautology
恒真式