diff --git a/notes/2023-10-19.md b/notes/2023-10-19.md index 645cf21..8269ee7 100644 --- a/notes/2023-10-19.md +++ b/notes/2023-10-19.md @@ -5,7 +5,7 @@ kernelspec: --- -# Why did we learn the plubming commands? +# Why did we learn the plumbing commands? You will not typically use them on a day to day basis, but they are a good way to see what happens at the interim steps and make sure that you have the right understanding of what git does. @@ -1061,4 +1061,4 @@ save your command history to `2023-10-19-log.txt` and put that file in your KWL ```{note} due to scheduling issues this will be late today -``` \ No newline at end of file +``` diff --git a/resources/understanding-logic-gates.md b/resources/understanding-logic-gates.md new file mode 100644 index 0000000..492edf2 --- /dev/null +++ b/resources/understanding-logic-gates.md @@ -0,0 +1,71 @@ +# Understanding Logic Gates + +## What are logic gates? + +Logic gates are used in digital circuits to preform logical functions in most electronics used today. + +There are many types of logic gates, the four main gates we will look at are AND, OR, XOR, and NAND. + +To understand how each one operates we can use truth tables to provide a better visual understanding. + +Note: truth tables use 0's and 1's as input to get its output. + +### AND Gate + +AND gates use the logic of if input A and input B are both value 1 then the output is 1. So if either of input A or B are value 0 then the output is 0. + +Truth Table: +| A | B | A AND B | +| --- | --- | :---: | +| 0 | 0 | 0 | +| 0 | 1 | 0 | +| 1 | 0 | 0 | +| 1 | 1 | 1 | + +### OR Gate + +OR gates use the logic of if input A or input B are value 1 then the output is 1. So if one of the inputs are 1 then the output; regardless of the other input, is also 1. + +Truth Table: +| A | B | A OR B | +| --- | --- | :---: | +| 0 | 0 | 0 | +| 0 | 1 | 1 | +| 1 | 0 | 1 | +| 1 | 1 | 1 | + +### XOR Gate + +XOR gates use the logic of if either input A or input B are value 1 then the output is 1 but if both are the same value then the output is 0. So if one of the inputs are a 1 then the output is 1, if both inputs are the same value then the output is 0. + +Truth Table: +| A | B | A XOR B | +| --- | --- | :---: | +| 0 | 0 | 0 | +| 0 | 1 | 1 | +| 1 | 0 | 1 | +| 1 | 1 | 0 | + +### NAND Gate + +NAND gates use the logic of if the inverse of input A has a value of 1 or if both input A and B are 0 then the output will be 1; otherwise, if the inverse of input A is 0 and input B is 1 then the output is 0. + +Truth Table: +| A | B | A NAND B | +| --- | --- | :---: | +| 0 | 0 | 1 | +| 0 | 1 | 1 | +| 1 | 0 | 1 | +| 1 | 1 | 0 | + +## Some Practice to learn the logic operations better + +A great way to understand and familiarize yourself with logic operators is to write functions for each logic gate in a program that take input A and B as parameters and return the output. + +#### Challenge + +In your Inclass repo, create a program that contains each logic gate as a function and post your experience to the [discussions page](https://github.com/introcompsys/discussion-fa23-community/discussions). + +## External resources + +- [Online Logic Simulator](https://lodev.org/logicemu/) \ No newline at end of file