Last Sync: 2022-09-07 20:00:05

This commit is contained in:
tactonbishop 2022-09-07 20:00:05 +01:00
parent fd875b926c
commit 515f3e51c2
3 changed files with 23 additions and 22 deletions

View file

@ -0,0 +1,10 @@
---
title: Creating memory with NAND gates
categories:
- Computer Architecture
- Electronics
- Hardware
tags: [logic-gates, binary]
---
# Creating memory with NAND gates

View file

@ -7,11 +7,12 @@ tags: [logic-gates, binary]
---
# Logic gates
> [A logic gate consists in] three connections where there may or may not be some electricity. Two of those connections are places where electricity may be put into the device, and the third connection is a place where electricity may come out of the device. (Scott, 2009 p.21)
Logic gates are the basic building blocks of digital computing. **A logic gate is an electrical circuit that has one or more than one input and only one output.** The input controls the output and the logic determining which types of input (on/off) lead to specific outputs (on/off) is identical to the truth-conditions of the [Boolean connectives](../../Logic/Truth-functional_connectives.md) specifiable in terms of [truth-tables](../../Logic/Truth-tables.md).
Logic gates are the basic building blocks of digital computing. **A logic gate is an electrical circuit that has one or more than one input and only one output.** The input controls the output and the logic determining which types of input (on/off) lead to specific outputs (on/off) is identical to the truth-conditions of the [Boolean connectives](../../Logic/Truth-functional_connectives.md) specifiable in terms of [truth-tables](../../Logic/Truth-tables.md).
Physically, what 'travels through' the gates is electrical current and what constitutes the 'gate' is a transistor responding to the current. But on a more abstract level it is bits that go into the gate and bits which come out: binary information that may be either 1 or 0.
Physically, what 'travels through' the gates is electrical current and what constitutes the 'gate' is a transistor responding to the current. At the next level of abstraction it is bits that go into the gate and bits which come out: binary information that may be either 1 or 0.
## References

View file

@ -10,28 +10,17 @@ tags: [logic-gates, binary]
A NAND gate is a logic gate that inverts the truth-conditions for `AND`.
A real-life circuit showing two switches corresponding to two transistors which control the LED light:
![NAND_from_transitors.png](../../img/NAND_from_transitors.png)
In this circuit, there are two transistors, each connected to a switch. The switches control the LED light. So the switches are the input and the LED is the output.
For clarity, we are not going to draw both transistors, we will simplify the diagram with a symbol for them which stands for the NAND gate:
![NAND.png](../../img/NAND.png)
Diagram representing NAND gate:
<img src="/home/thomas/repos/computer_science/img/NAND.png" width="180" />
The diagram below shows how the circuit models the truth conditions for `NAND`
Diagram representing NAND gate:
![NAND.gif](../../img/NAND.gif)
<img src="/home/thomas/repos/computer_science/img/NAND.gif" width="400" />
* When both switches are off (corresponding to `false` `false`) the output is on (the bulb lights up).
* If either one of the switches are on, the output remains on (corresponding to `true` `false` or `false` `true` )
* It is only when both switches are on, that the output is off (corresponding to `true` `true` )
This is the exact opposite to the truth-conditions for AND.
## Transliterating the logic truth-table to the switch behaviour
@ -54,6 +43,7 @@ t f f
f t f
f f f
```
We can see that it inverts the value of AND.
## Significance of the NAND gate: functional completeness