From dd8359fb84c2fdabc42597c1673341396026b1dc Mon Sep 17 00:00:00 2001 From: thomasabishop Date: Fri, 16 Dec 2022 13:00:05 +0000 Subject: [PATCH 01/14] Autosave: 2022-12-16 13:00:05 --- Logic/Boolean_functions.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Logic/Boolean_functions.md b/Logic/Boolean_functions.md index 7cae04c..7e78972 100644 --- a/Logic/Boolean_functions.md +++ b/Logic/Boolean_functions.md @@ -15,3 +15,5 @@ $$ Here is a work through where $f(1, 0, 1)$: // Insert diagram + +We can compute all possible outputs of the function by constructing a truth-table with each possible variable value as the From fd5a41abe4d14f78efb9bf8aad70cf51939e2c29 Mon Sep 17 00:00:00 2001 From: thomasabishop Date: Sat, 17 Dec 2022 15:30:04 +0000 Subject: [PATCH 02/14] Autosave: 2022-12-17 15:30:04 --- Logic/Boolean_functions.md | 19 ----------------- Logic/{ => General_concepts}/Consistency.md | 0 Logic/{ => General_concepts}/Indeterminacy.md | 0 .../Logical_equivalence.md | 0 .../Logical_possibility_and_necessity.md | 0 .../Logical_truth_and_falsity.md | 0 .../Object_language_and_meta-language.md | 0 Logic/{ => General_concepts}/Soundness.md | 0 Logic/{ => General_concepts}/Syllogism.md | 0 .../Validity_and_entailment.md | 0 .../{ => Proofs}/Biconditional_Elimination.md | 0 .../Biconditional_Introduction.md | 0 Logic/{ => Proofs}/Conditional_Elimination.md | 0 .../{ => Proofs}/Conditional_Introduction.md | 0 Logic/{ => Proofs}/Conjunction_Elimination.md | 0 .../{ => Proofs}/Conjunction_Introduction.md | 0 Logic/{ => Proofs}/Disjunction_Elimination.md | 0 .../{ => Proofs}/Disjunction_Introduction.md | 0 .../Formal_proofs_in_propositional_logic.md | 0 Logic/{ => Proofs}/Negation_Elimination.md | 0 Logic/{ => Proofs}/Negation_Introduction.md | 0 Logic/{ => Proofs}/Reiteration.md | 0 .../Strategies_for_constructing_proofs.md | 0 .../Atomic_and_molecular_sentences.md | 0 .../Propositional_logic/Boolean_functions.md | 21 +++++++++++++++++++ .../Syntax_of_sentential_logic.md | 0 .../Truth-functional_connectives.md | 0 .../{ => Propositional_logic}/Truth-tables.md | 0 .../{ => Propositional_logic}/Truth-trees.md | 0 ...orresponding_material_and_biconditional.md | 0 Logic/{ => Theorems}/DeMorgan's_Laws.md | 0 .../Law_of_Non-Contradiction.md | 0 .../Law_of_the_Excluded_Middle.md | 0 .../{ => Theorems}/Theorems_and_empty_sets.md | 0 34 files changed, 21 insertions(+), 19 deletions(-) delete mode 100644 Logic/Boolean_functions.md rename Logic/{ => General_concepts}/Consistency.md (100%) rename Logic/{ => General_concepts}/Indeterminacy.md (100%) rename Logic/{ => General_concepts}/Logical_equivalence.md (100%) rename Logic/{ => General_concepts}/Logical_possibility_and_necessity.md (100%) rename Logic/{ => General_concepts}/Logical_truth_and_falsity.md (100%) rename Logic/{ => General_concepts}/Object_language_and_meta-language.md (100%) rename Logic/{ => General_concepts}/Soundness.md (100%) rename Logic/{ => General_concepts}/Syllogism.md (100%) rename Logic/{ => General_concepts}/Validity_and_entailment.md (100%) rename Logic/{ => Proofs}/Biconditional_Elimination.md (100%) rename Logic/{ => Proofs}/Biconditional_Introduction.md (100%) rename Logic/{ => Proofs}/Conditional_Elimination.md (100%) rename Logic/{ => Proofs}/Conditional_Introduction.md (100%) rename Logic/{ => Proofs}/Conjunction_Elimination.md (100%) rename Logic/{ => Proofs}/Conjunction_Introduction.md (100%) rename Logic/{ => Proofs}/Disjunction_Elimination.md (100%) rename Logic/{ => Proofs}/Disjunction_Introduction.md (100%) rename Logic/{ => Proofs}/Formal_proofs_in_propositional_logic.md (100%) rename Logic/{ => Proofs}/Negation_Elimination.md (100%) rename Logic/{ => Proofs}/Negation_Introduction.md (100%) rename Logic/{ => Proofs}/Reiteration.md (100%) rename Logic/{ => Proofs}/Strategies_for_constructing_proofs.md (100%) rename Logic/{ => Propositional_logic}/Atomic_and_molecular_sentences.md (100%) create mode 100644 Logic/Propositional_logic/Boolean_functions.md rename Logic/{ => Propositional_logic}/Syntax_of_sentential_logic.md (100%) rename Logic/{ => Propositional_logic}/Truth-functional_connectives.md (100%) rename Logic/{ => Propositional_logic}/Truth-tables.md (100%) rename Logic/{ => Propositional_logic}/Truth-trees.md (100%) rename Logic/{ => Theorems}/Corresponding_material_and_biconditional.md (100%) rename Logic/{ => Theorems}/DeMorgan's_Laws.md (100%) rename Logic/{ => Theorems}/Law_of_Non-Contradiction.md (100%) rename Logic/{ => Theorems}/Law_of_the_Excluded_Middle.md (100%) rename Logic/{ => Theorems}/Theorems_and_empty_sets.md (100%) diff --git a/Logic/Boolean_functions.md b/Logic/Boolean_functions.md deleted file mode 100644 index 7e78972..0000000 --- a/Logic/Boolean_functions.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -categories: - - Mathematics -tags: [logic] ---- - -# Boolean functions - -An example of a Boolean function: - -$$ -f(x,y,z) = (x \land y) \lor (\lnot(x) \land z ) -$$ - -Here is a work through where $f(1, 0, 1)$: - -// Insert diagram - -We can compute all possible outputs of the function by constructing a truth-table with each possible variable value as the diff --git a/Logic/Consistency.md b/Logic/General_concepts/Consistency.md similarity index 100% rename from Logic/Consistency.md rename to Logic/General_concepts/Consistency.md diff --git a/Logic/Indeterminacy.md b/Logic/General_concepts/Indeterminacy.md similarity index 100% rename from Logic/Indeterminacy.md rename to Logic/General_concepts/Indeterminacy.md diff --git a/Logic/Logical_equivalence.md b/Logic/General_concepts/Logical_equivalence.md similarity index 100% rename from Logic/Logical_equivalence.md rename to Logic/General_concepts/Logical_equivalence.md diff --git a/Logic/Logical_possibility_and_necessity.md b/Logic/General_concepts/Logical_possibility_and_necessity.md similarity index 100% rename from Logic/Logical_possibility_and_necessity.md rename to Logic/General_concepts/Logical_possibility_and_necessity.md diff --git a/Logic/Logical_truth_and_falsity.md b/Logic/General_concepts/Logical_truth_and_falsity.md similarity index 100% rename from Logic/Logical_truth_and_falsity.md rename to Logic/General_concepts/Logical_truth_and_falsity.md diff --git a/Logic/Object_language_and_meta-language.md b/Logic/General_concepts/Object_language_and_meta-language.md similarity index 100% rename from Logic/Object_language_and_meta-language.md rename to Logic/General_concepts/Object_language_and_meta-language.md diff --git a/Logic/Soundness.md b/Logic/General_concepts/Soundness.md similarity index 100% rename from Logic/Soundness.md rename to Logic/General_concepts/Soundness.md diff --git a/Logic/Syllogism.md b/Logic/General_concepts/Syllogism.md similarity index 100% rename from Logic/Syllogism.md rename to Logic/General_concepts/Syllogism.md diff --git a/Logic/Validity_and_entailment.md b/Logic/General_concepts/Validity_and_entailment.md similarity index 100% rename from Logic/Validity_and_entailment.md rename to Logic/General_concepts/Validity_and_entailment.md diff --git a/Logic/Biconditional_Elimination.md b/Logic/Proofs/Biconditional_Elimination.md similarity index 100% rename from Logic/Biconditional_Elimination.md rename to Logic/Proofs/Biconditional_Elimination.md diff --git a/Logic/Biconditional_Introduction.md b/Logic/Proofs/Biconditional_Introduction.md similarity index 100% rename from Logic/Biconditional_Introduction.md rename to Logic/Proofs/Biconditional_Introduction.md diff --git a/Logic/Conditional_Elimination.md b/Logic/Proofs/Conditional_Elimination.md similarity index 100% rename from Logic/Conditional_Elimination.md rename to Logic/Proofs/Conditional_Elimination.md diff --git a/Logic/Conditional_Introduction.md b/Logic/Proofs/Conditional_Introduction.md similarity index 100% rename from Logic/Conditional_Introduction.md rename to Logic/Proofs/Conditional_Introduction.md diff --git a/Logic/Conjunction_Elimination.md b/Logic/Proofs/Conjunction_Elimination.md similarity index 100% rename from Logic/Conjunction_Elimination.md rename to Logic/Proofs/Conjunction_Elimination.md diff --git a/Logic/Conjunction_Introduction.md b/Logic/Proofs/Conjunction_Introduction.md similarity index 100% rename from Logic/Conjunction_Introduction.md rename to Logic/Proofs/Conjunction_Introduction.md diff --git a/Logic/Disjunction_Elimination.md b/Logic/Proofs/Disjunction_Elimination.md similarity index 100% rename from Logic/Disjunction_Elimination.md rename to Logic/Proofs/Disjunction_Elimination.md diff --git a/Logic/Disjunction_Introduction.md b/Logic/Proofs/Disjunction_Introduction.md similarity index 100% rename from Logic/Disjunction_Introduction.md rename to Logic/Proofs/Disjunction_Introduction.md diff --git a/Logic/Formal_proofs_in_propositional_logic.md b/Logic/Proofs/Formal_proofs_in_propositional_logic.md similarity index 100% rename from Logic/Formal_proofs_in_propositional_logic.md rename to Logic/Proofs/Formal_proofs_in_propositional_logic.md diff --git a/Logic/Negation_Elimination.md b/Logic/Proofs/Negation_Elimination.md similarity index 100% rename from Logic/Negation_Elimination.md rename to Logic/Proofs/Negation_Elimination.md diff --git a/Logic/Negation_Introduction.md b/Logic/Proofs/Negation_Introduction.md similarity index 100% rename from Logic/Negation_Introduction.md rename to Logic/Proofs/Negation_Introduction.md diff --git a/Logic/Reiteration.md b/Logic/Proofs/Reiteration.md similarity index 100% rename from Logic/Reiteration.md rename to Logic/Proofs/Reiteration.md diff --git a/Logic/Strategies_for_constructing_proofs.md b/Logic/Proofs/Strategies_for_constructing_proofs.md similarity index 100% rename from Logic/Strategies_for_constructing_proofs.md rename to Logic/Proofs/Strategies_for_constructing_proofs.md diff --git a/Logic/Atomic_and_molecular_sentences.md b/Logic/Propositional_logic/Atomic_and_molecular_sentences.md similarity index 100% rename from Logic/Atomic_and_molecular_sentences.md rename to Logic/Propositional_logic/Atomic_and_molecular_sentences.md diff --git a/Logic/Propositional_logic/Boolean_functions.md b/Logic/Propositional_logic/Boolean_functions.md new file mode 100644 index 0000000..ee7d205 --- /dev/null +++ b/Logic/Propositional_logic/Boolean_functions.md @@ -0,0 +1,21 @@ +--- +categories: + - Mathematics +tags: [logic] +--- + +# Boolean functions + +An example of a Boolean function: + +$$ +f(x,y,z) = (x \land y) \lor (\lnot(x) \land z ) +$$ + +Here is a work through where $f(1, 0, 1)$: + +- The first disjunction : $ \lnot(x) \land z $ is false because $x$ is 1 and $z$ is 1 +- The second disjunction: $x \land y$ is false because $x$ is 1 and $y$ is 0 +- The overall function returns true because the main connective is disjunction and one of the disjuncts (the second) evaluates to 1. Thus the output is 1. + +We can compute all possible outputs of the function by constructing a truth-table with each possible variable as the truth conditions and the output of the function as the truth value: diff --git a/Logic/Syntax_of_sentential_logic.md b/Logic/Propositional_logic/Syntax_of_sentential_logic.md similarity index 100% rename from Logic/Syntax_of_sentential_logic.md rename to Logic/Propositional_logic/Syntax_of_sentential_logic.md diff --git a/Logic/Truth-functional_connectives.md b/Logic/Propositional_logic/Truth-functional_connectives.md similarity index 100% rename from Logic/Truth-functional_connectives.md rename to Logic/Propositional_logic/Truth-functional_connectives.md diff --git a/Logic/Truth-tables.md b/Logic/Propositional_logic/Truth-tables.md similarity index 100% rename from Logic/Truth-tables.md rename to Logic/Propositional_logic/Truth-tables.md diff --git a/Logic/Truth-trees.md b/Logic/Propositional_logic/Truth-trees.md similarity index 100% rename from Logic/Truth-trees.md rename to Logic/Propositional_logic/Truth-trees.md diff --git a/Logic/Corresponding_material_and_biconditional.md b/Logic/Theorems/Corresponding_material_and_biconditional.md similarity index 100% rename from Logic/Corresponding_material_and_biconditional.md rename to Logic/Theorems/Corresponding_material_and_biconditional.md diff --git a/Logic/DeMorgan's_Laws.md b/Logic/Theorems/DeMorgan's_Laws.md similarity index 100% rename from Logic/DeMorgan's_Laws.md rename to Logic/Theorems/DeMorgan's_Laws.md diff --git a/Logic/Law_of_Non-Contradiction.md b/Logic/Theorems/Law_of_Non-Contradiction.md similarity index 100% rename from Logic/Law_of_Non-Contradiction.md rename to Logic/Theorems/Law_of_Non-Contradiction.md diff --git a/Logic/Law_of_the_Excluded_Middle.md b/Logic/Theorems/Law_of_the_Excluded_Middle.md similarity index 100% rename from Logic/Law_of_the_Excluded_Middle.md rename to Logic/Theorems/Law_of_the_Excluded_Middle.md diff --git a/Logic/Theorems_and_empty_sets.md b/Logic/Theorems/Theorems_and_empty_sets.md similarity index 100% rename from Logic/Theorems_and_empty_sets.md rename to Logic/Theorems/Theorems_and_empty_sets.md From 6fb1b1c8ea337f4ca20b3c039d755a4378bd01ab Mon Sep 17 00:00:00 2001 From: thomasabishop Date: Sat, 17 Dec 2022 16:30:05 +0000 Subject: [PATCH 03/14] Autosave: 2022-12-17 16:30:05 --- Logic/Propositional_logic/Boolean_functions.md | 15 +++++++++++++-- .../Corresponding_material_and_biconditional.md | 0 .../DeMorgan's_Laws.md | 0 .../Law_of_Non-Contradiction.md | 0 .../Law_of_the_Excluded_Middle.md | 0 .../Theorems_and_empty_sets.md | 0 6 files changed, 13 insertions(+), 2 deletions(-) rename Logic/{Theorems => _Laws_and_theorems.md}/Corresponding_material_and_biconditional.md (100%) rename Logic/{Theorems => _Laws_and_theorems.md}/DeMorgan's_Laws.md (100%) rename Logic/{Theorems => _Laws_and_theorems.md}/Law_of_Non-Contradiction.md (100%) rename Logic/{Theorems => _Laws_and_theorems.md}/Law_of_the_Excluded_Middle.md (100%) rename Logic/{Theorems => _Laws_and_theorems.md}/Theorems_and_empty_sets.md (100%) diff --git a/Logic/Propositional_logic/Boolean_functions.md b/Logic/Propositional_logic/Boolean_functions.md index ee7d205..1a77adf 100644 --- a/Logic/Propositional_logic/Boolean_functions.md +++ b/Logic/Propositional_logic/Boolean_functions.md @@ -15,7 +15,18 @@ $$ Here is a work through where $f(1, 0, 1)$: - The first disjunction : $ \lnot(x) \land z $ is false because $x$ is 1 and $z$ is 1 -- The second disjunction: $x \land y$ is false because $x$ is 1 and $y$ is 0 +- The second disjunction: $x \land y$ is true because $x$ is 1 and $y$ is 1 - The overall function returns true because the main connective is disjunction and one of the disjuncts (the second) evaluates to 1. Thus the output is 1. -We can compute all possible outputs of the function by constructing a truth-table with each possible variable as the truth conditions and the output of the function as the truth value: +We can compute all possible outputs of the function by constructing a [truth-table](/Logic/Propositional_logic/Truth-tables.md) with each possible variable as the truth conditions and the output of the function as the truth value: + +| $x$ | $y$ | $z$ | $f(x,y,z) = (x \land y) \lor (\lnot(x) \land z )$ | +| --- | --- | --- | ------------------------------------------------- | +| 0 | 0 | 0 | 0 | +| 0 | 0 | 1 | 1 | +| 0 | 1 | 0 | 0 | +| 0 | 1 | 1 | 1 | +| 1 | 0 | 0 | 0 | +| 1 | 0 | 1 | 0 | +| 1 | 1 | 0 | 1 | +| 1 | 1 | 1 | 1 | diff --git a/Logic/Theorems/Corresponding_material_and_biconditional.md b/Logic/_Laws_and_theorems.md/Corresponding_material_and_biconditional.md similarity index 100% rename from Logic/Theorems/Corresponding_material_and_biconditional.md rename to Logic/_Laws_and_theorems.md/Corresponding_material_and_biconditional.md diff --git a/Logic/Theorems/DeMorgan's_Laws.md b/Logic/_Laws_and_theorems.md/DeMorgan's_Laws.md similarity index 100% rename from Logic/Theorems/DeMorgan's_Laws.md rename to Logic/_Laws_and_theorems.md/DeMorgan's_Laws.md diff --git a/Logic/Theorems/Law_of_Non-Contradiction.md b/Logic/_Laws_and_theorems.md/Law_of_Non-Contradiction.md similarity index 100% rename from Logic/Theorems/Law_of_Non-Contradiction.md rename to Logic/_Laws_and_theorems.md/Law_of_Non-Contradiction.md diff --git a/Logic/Theorems/Law_of_the_Excluded_Middle.md b/Logic/_Laws_and_theorems.md/Law_of_the_Excluded_Middle.md similarity index 100% rename from Logic/Theorems/Law_of_the_Excluded_Middle.md rename to Logic/_Laws_and_theorems.md/Law_of_the_Excluded_Middle.md diff --git a/Logic/Theorems/Theorems_and_empty_sets.md b/Logic/_Laws_and_theorems.md/Theorems_and_empty_sets.md similarity index 100% rename from Logic/Theorems/Theorems_and_empty_sets.md rename to Logic/_Laws_and_theorems.md/Theorems_and_empty_sets.md From 2dd099dc6cd3dd42816e44e04d2430233f907bdd Mon Sep 17 00:00:00 2001 From: thomasabishop Date: Sun, 18 Dec 2022 11:00:04 +0000 Subject: [PATCH 04/14] Autosave: 2022-12-18 11:00:04 --- .vscode/settings.json | 5 ----- Computer_Architecture/Hardware_abstraction.md | 0 .../Corresponding_material_and_biconditional.md | 0 .../DeMorgan's_Laws.md | 0 .../Law_of_Non-Contradiction.md | 0 .../Law_of_the_Excluded_Middle.md | 0 .../Theorems_and_empty_sets.md | 0 _meta/Resources.md | 4 ++++ 8 files changed, 4 insertions(+), 5 deletions(-) delete mode 100644 .vscode/settings.json create mode 100644 Computer_Architecture/Hardware_abstraction.md rename Logic/{_Laws_and_theorems.md => Laws_and_theorems.md}/Corresponding_material_and_biconditional.md (100%) rename Logic/{_Laws_and_theorems.md => Laws_and_theorems.md}/DeMorgan's_Laws.md (100%) rename Logic/{_Laws_and_theorems.md => Laws_and_theorems.md}/Law_of_Non-Contradiction.md (100%) rename Logic/{_Laws_and_theorems.md => Laws_and_theorems.md}/Law_of_the_Excluded_Middle.md (100%) rename Logic/{_Laws_and_theorems.md => Laws_and_theorems.md}/Theorems_and_empty_sets.md (100%) diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 41a1aa3..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "cSpell.words": [ - "elif" - ] -} \ No newline at end of file diff --git a/Computer_Architecture/Hardware_abstraction.md b/Computer_Architecture/Hardware_abstraction.md new file mode 100644 index 0000000..e69de29 diff --git a/Logic/_Laws_and_theorems.md/Corresponding_material_and_biconditional.md b/Logic/Laws_and_theorems.md/Corresponding_material_and_biconditional.md similarity index 100% rename from Logic/_Laws_and_theorems.md/Corresponding_material_and_biconditional.md rename to Logic/Laws_and_theorems.md/Corresponding_material_and_biconditional.md diff --git a/Logic/_Laws_and_theorems.md/DeMorgan's_Laws.md b/Logic/Laws_and_theorems.md/DeMorgan's_Laws.md similarity index 100% rename from Logic/_Laws_and_theorems.md/DeMorgan's_Laws.md rename to Logic/Laws_and_theorems.md/DeMorgan's_Laws.md diff --git a/Logic/_Laws_and_theorems.md/Law_of_Non-Contradiction.md b/Logic/Laws_and_theorems.md/Law_of_Non-Contradiction.md similarity index 100% rename from Logic/_Laws_and_theorems.md/Law_of_Non-Contradiction.md rename to Logic/Laws_and_theorems.md/Law_of_Non-Contradiction.md diff --git a/Logic/_Laws_and_theorems.md/Law_of_the_Excluded_Middle.md b/Logic/Laws_and_theorems.md/Law_of_the_Excluded_Middle.md similarity index 100% rename from Logic/_Laws_and_theorems.md/Law_of_the_Excluded_Middle.md rename to Logic/Laws_and_theorems.md/Law_of_the_Excluded_Middle.md diff --git a/Logic/_Laws_and_theorems.md/Theorems_and_empty_sets.md b/Logic/Laws_and_theorems.md/Theorems_and_empty_sets.md similarity index 100% rename from Logic/_Laws_and_theorems.md/Theorems_and_empty_sets.md rename to Logic/Laws_and_theorems.md/Theorems_and_empty_sets.md diff --git a/_meta/Resources.md b/_meta/Resources.md index 6e25af1..a03d9d3 100644 --- a/_meta/Resources.md +++ b/_meta/Resources.md @@ -50,6 +50,8 @@ Hennesy, Patterson. 2020. **Computer Organization and Design** ([BBC O'Reilly Li Bryant, O'Halloran. 2016. **Computer Systems: A Programmer's Perspective** +N.Nisan, S.Schoken. 2021. **The Elements of Computing Systems** (Second Edition) + [How do transistors work, anyway?](https://lcamtuf.substack.com/p/how-do-transistors-work-anyway) [NAND latch](http://hyperphysics.phy-astr.gsu.edu/hbase/Electronic/nandlatch.html) @@ -93,3 +95,5 @@ A. Sweighart. 2015. **Automate the Boring Stuff with Python** ## Shell B. Perry, D. Taylor. 2015. **Wicked Cool Shell Scripts** + +[What is the difference between `${var}`, `"$var"`, and `"${var}"` in the Bash shell? (Stack Overflow)](https://stackoverflow.com/q/18135451/10484600) From 44e4f19f545287604a11bac2d849372bd0f3eeb0 Mon Sep 17 00:00:00 2001 From: thomasabishop Date: Sun, 18 Dec 2022 12:30:04 +0000 Subject: [PATCH 05/14] Autosave: 2022-12-18 12:30:04 --- Computer_Architecture/Hardware_abstraction.md | 0 .../Hardware_abstraction_and_modularity.md | 8 ++++++++ Electronics_and_Hardware/Binary/Binary_encoding.md | 2 +- _meta/Resources.md | 12 +++++++++++- 4 files changed, 20 insertions(+), 2 deletions(-) delete mode 100644 Computer_Architecture/Hardware_abstraction.md create mode 100644 Computer_Architecture/Hardware_abstraction_and_modularity.md diff --git a/Computer_Architecture/Hardware_abstraction.md b/Computer_Architecture/Hardware_abstraction.md deleted file mode 100644 index e69de29..0000000 diff --git a/Computer_Architecture/Hardware_abstraction_and_modularity.md b/Computer_Architecture/Hardware_abstraction_and_modularity.md new file mode 100644 index 0000000..7201ce6 --- /dev/null +++ b/Computer_Architecture/Hardware_abstraction_and_modularity.md @@ -0,0 +1,8 @@ +--- +categories: + - Computer Architecture + - Hardware +tags: [abstraction, modules] +--- + +# Hardware abstraction and modularity diff --git a/Electronics_and_Hardware/Binary/Binary_encoding.md b/Electronics_and_Hardware/Binary/Binary_encoding.md index 0cdfa85..3d2b445 100644 --- a/Electronics_and_Hardware/Binary/Binary_encoding.md +++ b/Electronics_and_Hardware/Binary/Binary_encoding.md @@ -13,7 +13,7 @@ _Encoding_ is the process of establishing a correspondence between sets of binar > An encoding system maps each symbol to a unique sequence of bits. A computer then interprets that sequence of bits and displays the apppropriate symbol to the user. -The length of the binary number (bytes, 16-bit, 32-bit etc) that is used to represent a given data set is determined by the number of variations that you require to capture the entire range of the dataset. For example, say we know that there are 18 levels to a computer game. To encode a reference for each level we would need a binary number that is capable of at least 18 total variations. In this instance a 16-bit number would not suffice because it would give us only 16 variants. Thus 32-bit ($2^{5}$) would be the right choice +The length of the binary number (bytes, 16-bit, 32-bit etc) that is used to represent a given data set is determined by the number of variations that you require to capture the entire range of the dataset. For example, say we know that there are 18 levels to a computer game. To encode a reference for each level we would need a binary number that is capable of at least 18 total variations. In this insta

Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus

``` 00001 (1) diff --git a/_meta/Resources.md b/_meta/Resources.md index a03d9d3..318099b 100644 --- a/_meta/Resources.md +++ b/_meta/Resources.md @@ -16,7 +16,7 @@ P. Norvig, S. Russell. 2020. **Artificial Intelligence: A Modern Approach** N. Weiner. 1948. **Cybernetics** -## Backend (CPD) +## Backend (general) [Backend Roadmap](https://roadmap.sh/backend) @@ -82,6 +82,10 @@ E. Lehman, F. Thomson Leighton, A.R. Meyer 2017. **Mathematics for Computer Scie G. Caldarelli, M. Catanzaro. 2012. **Networks: A Very Short Introduction** +[Course: NodeJS Essential Training (LinkedIn Learning)](https://www.linkedin.com/learning/node-js-essential-training-14888164) + +[Course: Building RESTful APIs with Node.js and Express](https://www.linkedin.com/learning/building-restful-apis-with-node-js-and-express-16069959) + ## Python A. Sweighart. 2020. **Beyond the Basic Stuff with Python** @@ -97,3 +101,9 @@ A. Sweighart. 2015. **Automate the Boring Stuff with Python** B. Perry, D. Taylor. 2015. **Wicked Cool Shell Scripts** [What is the difference between `${var}`, `"$var"`, and `"${var}"` in the Bash shell? (Stack Overflow)](https://stackoverflow.com/q/18135451/10484600) + +## SQL + +[Course: MySQL Essential Training (LinkedIn Learning)](https://www.linkedin.com/learning/mysql-essential-training-2) + +[Course: MySQL Advanced Topics (LinkedIn Learning)](https://www.linkedin.com/learning/mysql-advanced-topics) From d187579bffc742bc1c06300d053791f79e95edec Mon Sep 17 00:00:00 2001 From: thomasabishop Date: Sun, 18 Dec 2022 13:00:05 +0000 Subject: [PATCH 06/14] Autosave: 2022-12-18 13:00:05 --- .../Hardware_abstraction_and_modularity.md | 19 ++++++++++++++++ Logic/Propositional_logic/Boolean_algebra.md | 22 +++++++++++++++++++ .../Propositional_logic/Boolean_functions.md | 10 ++++----- 3 files changed, 46 insertions(+), 5 deletions(-) create mode 100644 Logic/Propositional_logic/Boolean_algebra.md diff --git a/Computer_Architecture/Hardware_abstraction_and_modularity.md b/Computer_Architecture/Hardware_abstraction_and_modularity.md index 7201ce6..33eed68 100644 --- a/Computer_Architecture/Hardware_abstraction_and_modularity.md +++ b/Computer_Architecture/Hardware_abstraction_and_modularity.md @@ -6,3 +6,22 @@ tags: [abstraction, modules] --- # Hardware abstraction and modularity + +In computer architecture we deal with complexity by breaking the system into **modules**. For each module we distinguish **_abstraction_** from **_implementation_**. + +
+
abstraction
+
what the module does
+
implementation
+
how it does it
+
+ +When using a module as a building block you are to focus exclusively on the module's abstraction, ignoring completely its implementation details. + +> The abstraction-implementation paradigm helps developers manage complexity and maintain sanity: by dividing an overwhelming system into well-defined modules we create manageable chunks of implementation work and localize error detection and correction. + +[N.Nisan, S.Schoken. 2021. **The Elements of Computing Systems** (Second Edition)] + +The design of the diagram below emphasises the role of abstraction and modularity in the movement from transistors to chips: + +![](/img/hardware-abstraction-hierarchy.png) diff --git a/Logic/Propositional_logic/Boolean_algebra.md b/Logic/Propositional_logic/Boolean_algebra.md new file mode 100644 index 0000000..f1e9383 --- /dev/null +++ b/Logic/Propositional_logic/Boolean_algebra.md @@ -0,0 +1,22 @@ +--- +categories: + - Logic +tags: [propositional-logic, algebra] +--- + +# Boolean algebra + +Many of the laws that obtain in the mathematical realm of algebra also obtain for Boolean expressions. + +## The Commutative Law + +$$ + x \land y = y \land x \\ +$$ + +$$ + + x \lor y = y \lor x +$$ + +## The Associative Law diff --git a/Logic/Propositional_logic/Boolean_functions.md b/Logic/Propositional_logic/Boolean_functions.md index 1a77adf..5dd48b8 100644 --- a/Logic/Propositional_logic/Boolean_functions.md +++ b/Logic/Propositional_logic/Boolean_functions.md @@ -1,7 +1,7 @@ --- categories: - - Mathematics -tags: [logic] + - Logic +tags: [logic, propositional-logic] --- # Boolean functions @@ -14,9 +14,9 @@ $$ Here is a work through where $f(1, 0, 1)$: -- The first disjunction : $ \lnot(x) \land z $ is false because $x$ is 1 and $z$ is 1 -- The second disjunction: $x \land y$ is true because $x$ is 1 and $y$ is 1 -- The overall function returns true because the main connective is disjunction and one of the disjuncts (the second) evaluates to 1. Thus the output is 1. +- The first disjunction : $ \lnot(x) \land z $ is false because $x$ is 1 and $z$ is 0 +- The second disjunction: $x \land y$ is false because $x$ is 1 and $y$ is 1 +- The overall function returns false because the main connective is disjunction and both of its disjuncts are false We can compute all possible outputs of the function by constructing a [truth-table](/Logic/Propositional_logic/Truth-tables.md) with each possible variable as the truth conditions and the output of the function as the truth value: From aa3ba5196be2f40c778a2943912239dec4443c14 Mon Sep 17 00:00:00 2001 From: thomasabishop Date: Sun, 18 Dec 2022 13:30:05 +0000 Subject: [PATCH 07/14] Autosave: 2022-12-18 13:30:05 --- Logic/Propositional_logic/Boolean_algebra.md | 30 ++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/Logic/Propositional_logic/Boolean_algebra.md b/Logic/Propositional_logic/Boolean_algebra.md index f1e9383..4df4537 100644 --- a/Logic/Propositional_logic/Boolean_algebra.md +++ b/Logic/Propositional_logic/Boolean_algebra.md @@ -19,4 +19,34 @@ $$ x \lor y = y \lor x $$ +Compare the [Commutative Law](/Mathematics/Prealgebra/Whole_numbers.md#the-commutative-property) in the context of arithmetic. + ## The Associative Law + +$$ + x \land (y \land z) = (x \land y) \land z +$$ + +$$ + x \lor (y \lor z) = (x \lor y) \lor z +$$ + +Compare the [Associative Law](/Mathematics/Prealgebra/Whole_numbers.md#the-associative-property) in the context of arithmetic. + +## The Distributive Law + +$$ + x \land (y \lor z) = (x \land y) \lor (x \land z) +$$ + +$$ + x \lor (y \land z) = (x \lor y) \land (x \lor z) +$$ + +Compare for instance how this applies in the case of [multiplication](/Mathematics/Prealgebra/Distributivity.md): + +$$ + a \cdot (b + c) = a \cdot b + a \cdot c +$$ + +In addition we have [DeMorgan's Laws](/Logic/Laws_and_theorems.md/DeMorgan's_Laws.md) which express the relationship that obtains between the negations of conjunctive and disjunctive expressions From c1639194b1fb058701e1c1d87ea6ceaeaaa938f8 Mon Sep 17 00:00:00 2001 From: thomasabishop Date: Sun, 18 Dec 2022 14:30:04 +0000 Subject: [PATCH 08/14] Autosave: 2022-12-18 14:30:04 --- Logic/Laws_and_theorems.md/DeMorgan's_Laws.md | 12 ++-- Logic/Propositional_logic/Boolean_algebra.md | 59 ++++++++++++++++++- 2 files changed, 63 insertions(+), 8 deletions(-) diff --git a/Logic/Laws_and_theorems.md/DeMorgan's_Laws.md b/Logic/Laws_and_theorems.md/DeMorgan's_Laws.md index e50b538..d816931 100644 --- a/Logic/Laws_and_theorems.md/DeMorgan's_Laws.md +++ b/Logic/Laws_and_theorems.md/DeMorgan's_Laws.md @@ -1,9 +1,11 @@ --- categories: - - Mathematics -tags: [logic, theorems] + - Logic +tags: [logic, laws] --- +# DeMorgan's Laws + DeMorgan's laws express some fundamental equivalences that obtain between the Boolean [connectives](Truth-functional%20connectives.md): ## First Law @@ -16,14 +18,14 @@ $$ The equivalence is demonstrated with the following truth-table -![demorgan-1.png](../img/demorgan-1.png) +![demorgan-1.png](/img/demorgan-1.png) ## Second Law > The negation of a disjunction is equivalent to the conjunction of the negation of the original disjuncts. $$ -\sim (P \lor Q) \equiv \sim P & \sim Q +\sim (P \lor Q) \equiv \sim P \& \sim Q $$ -![demorgan-2.png](../img/demorgan-2.png) +![demorgan-2.png](/img/demorgan-2.png) diff --git a/Logic/Propositional_logic/Boolean_algebra.md b/Logic/Propositional_logic/Boolean_algebra.md index 4df4537..681f341 100644 --- a/Logic/Propositional_logic/Boolean_algebra.md +++ b/Logic/Propositional_logic/Boolean_algebra.md @@ -6,9 +6,11 @@ tags: [propositional-logic, algebra] # Boolean algebra +## Algebraic laws + Many of the laws that obtain in the mathematical realm of algebra also obtain for Boolean expressions. -## The Commutative Law +### The Commutative Law $$ x \land y = y \land x \\ @@ -21,7 +23,7 @@ $$ Compare the [Commutative Law](/Mathematics/Prealgebra/Whole_numbers.md#the-commutative-property) in the context of arithmetic. -## The Associative Law +### The Associative Law $$ x \land (y \land z) = (x \land y) \land z @@ -33,7 +35,7 @@ $$ Compare the [Associative Law](/Mathematics/Prealgebra/Whole_numbers.md#the-associative-property) in the context of arithmetic. -## The Distributive Law +### The Distributive Law $$ x \land (y \lor z) = (x \land y) \lor (x \land z) @@ -50,3 +52,54 @@ $$ $$ In addition we have [DeMorgan's Laws](/Logic/Laws_and_theorems.md/DeMorgan's_Laws.md) which express the relationship that obtains between the negations of conjunctive and disjunctive expressions + +## Applying the laws to simplify complex Boolean expressions + +Say we have the following expression: + +$$ + \lnot(\lnot(x) \land \lnot (x \lor y)) +$$ + +We can employ DeMorgan's Laws to convert the second conjunct to a different form: + +$$ + \lnot (x \lor x) = \lnot x \land \lnot y +$$ + +So now we have: + +$$ + \lnot(\lnot(x) \land (\lnot x \land \lnot y )) +$$ + +As we have now have an expression of the form _P and (Q and R)_ we can apply the Distributive Law to simplify the brackets (_P and Q and R_): + +$$ + \lnot( \lnot(x) \land \lnot(x) \land \lnot(y)) +$$ + +Notice that we are repeating ourselves in this reformulation. We have $\lnot(x) \land \lnot(x)$ but this is just the same $\lnot(x)$ by the principle of **idempotence**. So we can reduce to: + +$$ + \lnot(\lnot(x) \land \lnot(y)) +$$ + +This gives our expression the form of the first DeMorgan Law ($\lnot (P \land Q)$), thus we can apply the law ($\lnot P \lor \lnot Q$) to get: + +$$ +\lnot(\lnot(x)) \lor \lnot(\lnot(y)) +$$ + +Of course now we have two double negatives. We can apply the double negation law to: + +$$ + x \lor y +$$ + +// TO DO: + +- Use truth tables to show equivalence +- Explicitly add implicit laws +- Link to deductive rules +- Link to digital circuits and NANDs as universal gates From 03f25f50a9fc4fbeaab1b6e5aa0bb0174104d17d Mon Sep 17 00:00:00 2001 From: thomasabishop Date: Sun, 18 Dec 2022 19:00:05 +0000 Subject: [PATCH 09/14] Autosave: 2022-12-18 19:00:05 --- Logic/Propositional_logic/Boolean_algebra.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/Logic/Propositional_logic/Boolean_algebra.md b/Logic/Propositional_logic/Boolean_algebra.md index 681f341..df685fd 100644 --- a/Logic/Propositional_logic/Boolean_algebra.md +++ b/Logic/Propositional_logic/Boolean_algebra.md @@ -91,12 +91,27 @@ $$ \lnot(\lnot(x)) \lor \lnot(\lnot(y)) $$ -Of course now we have two double negatives. We can apply the double negation law to: +Of course now we have two double negatives. We can apply the double negation law to get: $$ x \lor y $$ +### Truth table + +Whenever we simplify an algebraic expression the value of the resulting expression should match that of the complex expression. We can demonstrate this with a truth table: + +| $x$ | $y$ | $\lnot(\lnot(x) \land \lnot (x \lor y))$ | $x \lor y$ | +| --- | --- | ---------------------------------------- | ---------- | +| 0 | 0 | 0 | 0 | +| 0 | 1 | 1 | 1 | +| 1 | 0 | 1 | 1 | +| 1 | 1 | 1 | 1 | + +### Significance for computer architecture + +The fact that we can take a complex Boolean function and reduce it to a simpler formulation has great significance for the development of computer architectures, specifically [logic gates](/Electronics_and_Hardware/Digital_circuits/Logic_gates.md). It would be rather resource intensive and inefficient to create a gate that is representative of the complex function. Whereas the simplified version only requires a single [OR gate](/Electronics_and_Hardware/Digital_circuits/Logic_gates.md#or-gate) + // TO DO: - Use truth tables to show equivalence From d6ba124c1c67823a58cb200085cdec3a3132b3ff Mon Sep 17 00:00:00 2001 From: thomasabishop Date: Sun, 18 Dec 2022 19:30:05 +0000 Subject: [PATCH 10/14] Autosave: 2022-12-18 19:30:05 --- Logic/Propositional_logic/Boolean_algebra.md | 37 ++++++++++++++------ 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/Logic/Propositional_logic/Boolean_algebra.md b/Logic/Propositional_logic/Boolean_algebra.md index df685fd..1dea69e 100644 --- a/Logic/Propositional_logic/Boolean_algebra.md +++ b/Logic/Propositional_logic/Boolean_algebra.md @@ -45,13 +45,37 @@ $$ x \lor (y \land z) = (x \lor y) \land (x \lor z) $$ -Compare for instance how this applies in the case of [multiplication](/Mathematics/Prealgebra/Distributivity.md): +Compare how the [Distributive Law applies in the case of algebra based on arithmetic](/Mathematics/Prealgebra/Distributivity.md): $$ a \cdot (b + c) = a \cdot b + a \cdot c $$ -In addition we have [DeMorgan's Laws](/Logic/Laws_and_theorems.md/DeMorgan's_Laws.md) which express the relationship that obtains between the negations of conjunctive and disjunctive expressions +### Double Negation Elimination + +$$ + \lnot \lnot x = x +$$ + +### Idempotent Law + +$$ + x \land x = x +$$ + +> Combining a quantity with itself either by logical addition or logical multiplication will result in a logical sum or product that is the equivalent of the quantity + +### DeMorgan's Laws + +In addition we have [DeMorgan's Laws](/Logic/Laws_and_theorems.md/DeMorgan's_Laws.md) which express the relationship that obtains between the negations of conjunctive and disjunctive expressions: + +$$ +\lnot(x \land y) = \lnot x \lor \lnot y +$$ + +$$ + \lnot (x \lor y) = \lnot x \land \lnot y +$$ ## Applying the laws to simplify complex Boolean expressions @@ -110,11 +134,4 @@ Whenever we simplify an algebraic expression the value of the resulting expressi ### Significance for computer architecture -The fact that we can take a complex Boolean function and reduce it to a simpler formulation has great significance for the development of computer architectures, specifically [logic gates](/Electronics_and_Hardware/Digital_circuits/Logic_gates.md). It would be rather resource intensive and inefficient to create a gate that is representative of the complex function. Whereas the simplified version only requires a single [OR gate](/Electronics_and_Hardware/Digital_circuits/Logic_gates.md#or-gate) - -// TO DO: - -- Use truth tables to show equivalence -- Explicitly add implicit laws -- Link to deductive rules -- Link to digital circuits and NANDs as universal gates +The fact that we can take a complex Boolean function and reduce it to a simpler formulation has great significance for the development of computer architectures, specifically [logic gates](/Electronics_and_Hardware/Digital_circuits/Logic_gates.md). It would be rather resource intensive and inefficient to create a gate that is representative of the complex function. Whereas the simplified version only requires a single [OR gate](/Electronics_and_Hardware/Digital_circuits/Logic_gates.md#or-gate). From 3be197fef861ebc5e830671cd336a1d5df1a8556 Mon Sep 17 00:00:00 2001 From: thomasabishop Date: Mon, 19 Dec 2022 07:00:05 +0000 Subject: [PATCH 11/14] Autosave: 2022-12-19 07:00:05 --- Logic/Propositional_logic/Boolean_algebra.md | 1 + Logic/Propositional_logic/Boolean_functions.md | 1 + 2 files changed, 2 insertions(+) diff --git a/Logic/Propositional_logic/Boolean_algebra.md b/Logic/Propositional_logic/Boolean_algebra.md index 1dea69e..8125cc6 100644 --- a/Logic/Propositional_logic/Boolean_algebra.md +++ b/Logic/Propositional_logic/Boolean_algebra.md @@ -1,6 +1,7 @@ --- categories: - Logic + - Computer Architecture tags: [propositional-logic, algebra] --- diff --git a/Logic/Propositional_logic/Boolean_functions.md b/Logic/Propositional_logic/Boolean_functions.md index 5dd48b8..5cf6646 100644 --- a/Logic/Propositional_logic/Boolean_functions.md +++ b/Logic/Propositional_logic/Boolean_functions.md @@ -1,6 +1,7 @@ --- categories: - Logic + - Computer Architecture tags: [logic, propositional-logic] --- From 17a184be3ccd97a3069ff1bdea70378d946a84a2 Mon Sep 17 00:00:00 2001 From: thomasabishop Date: Mon, 19 Dec 2022 07:30:04 +0000 Subject: [PATCH 12/14] Autosave: 2022-12-19 07:30:04 --- .../Boolean_function_synthesis.md | 16 ++++++++++++++++ Logic/Propositional_logic/Boolean_functions.md | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 Logic/Propositional_logic/Boolean_function_synthesis.md diff --git a/Logic/Propositional_logic/Boolean_function_synthesis.md b/Logic/Propositional_logic/Boolean_function_synthesis.md new file mode 100644 index 0000000..12e9dbf --- /dev/null +++ b/Logic/Propositional_logic/Boolean_function_synthesis.md @@ -0,0 +1,16 @@ +--- +categories: + - Logic + - Computer Architecture +tags: [logic, propositional-logic, nand-to-tetris] +--- + +# Boolean function synthesis + +When we looked at [boolean functions](/Logic/Propositional_logic/Boolean_functions.md) we were working in a particular direction: from a function to a truth table. When we do Boolean function synthesis we work in the opposite direction: from a function to a truth table. + +This is an important skill that we will use when constructing [logic circuits](/Electronics_and_Hardware/Digital_circuits/Digital_circuits.md). We will go from truth conditions (i.e. what we want the circuit to do and when we want it to do it) to a function expression which is then reduced and implemented with [logic gates](/Electronics_and_Hardware/Digital_circuits/Logic_gates.md). + +## The process + +The process proceeds as follows: diff --git a/Logic/Propositional_logic/Boolean_functions.md b/Logic/Propositional_logic/Boolean_functions.md index 5cf6646..b649e80 100644 --- a/Logic/Propositional_logic/Boolean_functions.md +++ b/Logic/Propositional_logic/Boolean_functions.md @@ -2,7 +2,7 @@ categories: - Logic - Computer Architecture -tags: [logic, propositional-logic] +tags: [logic, propositional-logic, nand-to-tetris] --- # Boolean functions From 5a2aa693841c49403eb97e4d801df895b271dbd6 Mon Sep 17 00:00:00 2001 From: thomasabishop Date: Mon, 19 Dec 2022 08:00:05 +0000 Subject: [PATCH 13/14] Autosave: 2022-12-19 08:00:05 --- .../Boolean_function_synthesis.md | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/Logic/Propositional_logic/Boolean_function_synthesis.md b/Logic/Propositional_logic/Boolean_function_synthesis.md index 12e9dbf..1f5bb18 100644 --- a/Logic/Propositional_logic/Boolean_function_synthesis.md +++ b/Logic/Propositional_logic/Boolean_function_synthesis.md @@ -14,3 +14,48 @@ This is an important skill that we will use when constructing [logic circuits](/ ## The process The process proceeds as follows: + +1. Work out the truth conditions for the circuit we want to construct +2. Identify the rows where the output is equal to 1 +3. For each of these rows construct a Boolean expression that evaluates to that output +4. Join each expression with OR +5. Reduce these expressions to a single expression in its simplest form + +## Example + +Let's say we have the following truth table: + +| Line | $x$ | $y$ | $z$ | $f$ | +| ---- | --- | --- | --- | --- | +| 1 | 0 | 0 | 0 | 1 | +| 2 | 0 | 0 | 1 | 0 | +| 3 | 0 | 1 | 0 | 1 | +| 4 | 0 | 1 | 1 | 0 | +| 5 | 1 | 0 | 0 | 1 | +| 6 | 1 | 0 | 1 | 0 | +| 7 | 1 | 1 | 0 | 0 | +| 8 | 1 | 1 | 1 | 0 | + +We only need to focus on lines 1, 3, and 5 since they have the output 1: + +| Line | $x$ | $y$ | $z$ | $f$ | +| ---- | --- | --- | --- | --- | +| 1 | 0 | 0 | 0 | 1 | +| 3 | 0 | 1 | 0 | 1 | +| 5 | 1 | 0 | 0 | 1 | + +For each line we construct a Boolean expression that would result in the value in the $f$ column. In other words we construct the function: + +| Line | $x$ | $y$ | $z$ | $f$ | +| ---- | --- | --- | --- | ------------------------------------------- | +| 1 | 0 | 0 | 0 | $ \lnot(x) \land \lnot (y) \land \lnot(z) $ | +| 3 | 0 | 1 | 0 | $ \lnot(x) \land y \land \lnot(z) $ | +| 5 | 1 | 0 | 0 | $ x \land \lnot(y) \land \lnot(z) $ | + +We can now join each expression to create a complex expression that covers the entire truth table. Since 1 will be output for any one of these sub-expressions we can just join them up with OR: + +$$ +(\lnot(x) \land \lnot (y) \land \lnot(z)) \lor \lnot(x) \land y \land \lnot(z) \lor x \land \lnot(y) \land \lnot(z) +$$ + +It's clear that we have transcribed the truth conditions accurately but that we are doing so in a rather verbose way. Let's simplify: From 099762e96a7e126194e5d08a4ca1d1833f267139 Mon Sep 17 00:00:00 2001 From: thomasabishop Date: Mon, 19 Dec 2022 08:30:04 +0000 Subject: [PATCH 14/14] Autosave: 2022-12-19 08:30:04 --- .../Boolean_function_synthesis.md | 27 +++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/Logic/Propositional_logic/Boolean_function_synthesis.md b/Logic/Propositional_logic/Boolean_function_synthesis.md index 1f5bb18..dab9bf3 100644 --- a/Logic/Propositional_logic/Boolean_function_synthesis.md +++ b/Logic/Propositional_logic/Boolean_function_synthesis.md @@ -55,7 +55,30 @@ For each line we construct a Boolean expression that would result in the value i We can now join each expression to create a complex expression that covers the entire truth table. Since 1 will be output for any one of these sub-expressions we can just join them up with OR: $$ -(\lnot(x) \land \lnot (y) \land \lnot(z)) \lor \lnot(x) \land y \land \lnot(z) \lor x \land \lnot(y) \land \lnot(z) +(\lnot(x) \land \lnot (y) \land \lnot(z)) \lor (\lnot(x) \land y \land \lnot(z)) \lor (x \land \lnot(y) \land \lnot(z)) $$ -It's clear that we have transcribed the truth conditions accurately but that we are doing so in a rather verbose way. Let's simplify: +It's clear that we have transcribed the truth conditions accurately but that we are doing so in a rather verbose way. We can simplify by just looking at the position of the 1s in the truth table. Notice: + +- $z$ is always 0 +- $x$ and $y$ are either 0 or 1 but never both 1 in the same row + +So we simplify: + +$$ + (\lnot(x) \land \lnot(z)) \lor (\lnot(y) \land \lnot(z)) +$$ + +Notice that $\lnot(z)$ is repeated so we can remove the repetition: + +$$ + \lnot z \land (\lnot(x) \lor \lnot(y)) +$$ + +The upshot is that we now have a simpler expression that uses only NOT, OR and AND. We could therefore construct a circuit that just uses these gates to construct the conditions we specified in the first truth table. + +> This is important and is an instance of the general theorem that _any Boolean function_ can be represented using an expression containing AND, OR and NOT operations + +But even this is too complex. We could get rid of the OR and just use AND and NOT, in other words, NAND: + +stopped at 6:38