Introduction to Digital Logic�using TinkerCAD
Nick Carter
5/26/2020
What we will cover
Getting Started – make an account
What is a Simulator?
Arduino
How do you see what happens?�The same as in real life!
Nova Labs Electronics Bench
Real Life – After Corona Virus
Starting in TinkerCAD
Using TinkerCAD�After you click “Create new Circuit”�
Most icons will tell what they are if you hover cursor over.
Centers the circuit in the window
For Arduino
programming
To get a component, move cursor over it and click and
hold left mouse button then drag it where you want it.
When the component is selected you see a popup box
to change things
To connect 2 components click on a terminal and drag the wire to where you want it to go then click again. You can pin it to a bend location by clicking for clear routing.
A component terminal may have useful information when you hover the cursor over it.
What is there to build from�Click “All” on the Component menu and scroll up and down
TinkerCAD Tips
What is a circuit?
+
-
9 v olts difference
Current flow
No current flow
A circuit is connected
A circuit is not connected
+
-
Let’s Measure a Resistor
Get the Components:
(Click on it once to select it and then drag then click again to drop it)
A Multimeter lets us measure resistance, voltage and current
Connect the wires:
Select Component Parameters
Change and Simulate your circuit
Multimeters�(In normal times you get to try these)
ANALOG and DIGITAL
Both Measure, Volts AC and DC, Current Amps, Resistance Ohms, Connection Buzzer
USE THE OFF SWITCH POSITION!!!
Features
ANALOG DIGITAL
What is BOOLEAN LOGIC?�It comes from Mathematics
What is DIGITAL LOGIC?�As used in Computers
How Do We Combine Them?�We implement logical functions
How do Logical Operators Work?
How can you make logic circuits
LOGIC with Resistor/Switch�OR function
Make This Circuit
Try using the switches to see what combination lights the LED
In Circuits LEDs are included to indicate TRUE when ON (Our convention)
A
B
Q
Logical Statement
A + B = Q
Truth Table – examines all input combinations
Our convention is
Switches will be “TRUE when ‘UP” and FALSE when “down”
Symbol
A | 0 | 0 | 1 | 1 |
B | 0 | 1 | 0 | 1 |
Q=A+B | | | | |
A | 0 | 0 | 1 | 1 |
B | 0 | 1 | 0 | 1 |
Q=A+B | 0 | | | |
A | 0 | 0 | 1 | 1 |
B | 0 | 1 | 0 | 1 |
Q=A+B | 0 | 1 | | |
A | 0 | 0 | 1 | 1 |
B | 0 | 1 | 0 | 1 |
Q=A+B | 0 | 1 | 1 | |
A | 0 | 0 | 1 | 1 |
B | 0 | 1 | 0 | 1 |
Q=A+B | 0 | 1 | 1 | 0 |
LOGIC with Resistor/Switch�AND function
Make This Circuit
Try using the switches to see what combination lights the LED
In our Circuits LEDs are included to indicate TRUE when ON (Our convention)
A
B
Q
Logical Statement
A . B = Q
Truth Table – examines all input combinations
Our convention is
Switches will be “TRUE when ‘UP” and FALSE when “down”
Symbol
A | 0 | 0 | 1 | 1 |
B | 0 | 1 | 0 | 1 |
Q=A+B | | | | |
A | 0 | 0 | 1 | 1 |
B | 0 | 1 | 0 | 1 |
Q=A+B | 0 | | | |
A | 0 | 0 | 1 | 1 |
B | 0 | 1 | 0 | 1 |
Q=A+B | 0 | 0 | | |
A | 0 | 0 | 1 | 1 |
B | 0 | 1 | 0 | 1 |
Q=A+B | 0 | 0 | 0 | |
A | 0 | 0 | 1 | 1 |
B | 0 | 1 | 0 | 1 |
Q=A+B | 0 | 0 | 0 | 1 |
LOGIC with switches in TinkerCAD
(Transistors can be used without NOT function too)
Make a Transistor “NOT” Inverter
Make This Circuit
Try using the switch to see what state lights the LED
Symbol
Q
A
In our Circuits LEDs are included to indicate TRUE when ON (Our convention)
Truth Table – examines all input combinations
Logical Statement
A = Q
A | 0 | 1 | |
Q | 1 | 0 | |
C
B
E
LOGICAL SYMBOLS in a CIRCUIT�How Do We Write Them
FLAT FRONT = AND
CURVED FRONT = OR
LINE OVER VALUE = NOT
NOT TRUE = FALSE
CIRCLE = NOT
2 CURVES at FRONT = XOR
Why NAND and NOR�Look for the circle!
LOGIC with Diode/Transistor�NAND function – separate inputs
Make This Circuit
In Circuits LEDs are included to indicate TRUE when ON (Our convention)
A
B
Q
Logical Statement
A . B = Q
Truth Table – examines all input combinations
Symbol
A | 0 | 0 | 1 | 1 |
B | 0 | 1 | 0 | 1 |
Q=A.B | | | | |
A | 0 | 0 | 1 | 1 |
B | 0 | 1 | 0 | 1 |
Q=A.B | 1 | | | |
A | 0 | 0 | 1 | 1 |
B | 0 | 1 | 0 | 1 |
Q=A.B | 1 | 1 | | |
A | 0 | 0 | 1 | 1 |
B | 0 | 1 | 0 | 1 |
Q=A.B | 1 | 1 | 1 | |
A | 0 | 0 | 1 | 1 |
B | 0 | 1 | 0 | 1 |
Q=A.B | 1 | 1 | 1 | 0 |
NAND is a Universal GATE�look what you can make
Prebuilt Electronic GATES
1
4 Gates in a Package�(TinkerCAD has these, and more)
NOTICE DIFFERENCE IN PIN ASSIGNMENTS (PINOUT) _ DO NOT ASSUME!
Grab a Gate Package and test it.
2 input NAND Test Circuit
Make an example like this.
Try connecting the output to another gate input and measure the output of that,
RTL - Resistor Transistor Logic�DTL- Diode Transistor Logic
Integrated Circuit Top View
TTL - Transistor Transistor Logic
Integrated Circuit Top View
Hex (Six) Inverters in a package - 7404
USING 7400 CHIPS
Part Number | No in 14 pin Pack | Inputs | Gate Type |
74HC00 | 4 | 2 | NAND |
74HC02 | 4 | 2 | NOR |
74HC04 | 6 | 1 | NOT (INVERTER) |
74HC08 | 4 | 2 | AND |
74HC10 | 3 | 3 | NAND |
74HC11 | 3 | 3 | AND |
74HC20 | 2 | 4 | NAND |
74HC21 | 2 | 4 | AND |
74HC27 | 3 | 3 | NOR |
74HC32 | 4 | 2 | OR |
74HC86 | 4 | 2 | XOR |
74HC14 | 4 | 2 | NAND Schmitt Trigger* |
*74HC137 | 6 | 1 | NOT Schmitt Trigger* |
Recommended Design Process
TINKERCAD GATES NAND and NOR Functionality Test
You can access this design to get your own copy at (or build your own) https://www.tinkercad.com/things/bePGRCSVkfu-demo-of-74hc-logic
Logical Function and Algebra 1
Credit: https://www.electronics-tutorials.ws/boolean/bool_6.html
Go there for more details
Logical Function and Algebra 2
Credit: https://www.electronics-tutorials.ws/boolean/bool_6.html
Go there for more details
Logical Function and Algebra 3
Credit: https://www.electronics-tutorials.ws/boolean/bool_6.html
Go there for more details
DIGITAL LOGIC Makes Computers Work
Computers DO Arithmetic �- TRUE or FALSE?
Binary Numbering compared to Decimal Numbering
Position 5 4 3 2 1
Value
Single Bit Adder
Input A
Input B
Carry In
Output
CarryOut
74HC283 4 bit Fast Adder Circuit
Example (Arithmetic symbol use):
Decimal 10 +9 =Binary 0 + 1010 + 1001
Sum = Decimal 19 = Binary 1 + 0011
Inputs, A*, B*. Outputs, S*
Carry plus 2^3, 2^2, 2^1, 2^0
^ = OR, + = AND
Single Bit Adder
TinkerCAD 4 Bit Adder
Shared as DIGTL7 4 BIT ADDER NOVALABS - Search and try it
Sequential LOGIC Overview
Circuits with Memory
Computer use of Logic Gates
Modern Use of Gates
Moore’s Law
By Max Roser - https://ourworldindata.org/uploads/2019/05/Transistor-Count-over-time-to-2018.png, CC BY-SA 4.0, https://commons.wikimedia.org/w/index.php?curid=79751151
References
Class Pic
Extra Credit :-D
More things to build and try
Make a Transistor “NOR” gate
Make This Circuit
Try using the switch to see what state lights the LED
Add the resistor and switch
Symbol
In Circuits LEDs are included to indicate TRUE when ON (Our convention)
Truth Table – examines all input combinations
Logical Statement
A + B= Q
A | 0 | 0 | 1 | 1 |
B | 0 | 1 | 0 | 1 |
Q=A+B | | | | |
A | 0 | 0 | 1 | 1 |
B | 0 | 1 | 0 | 1 |
Q=A+B | 1 | | | |
A | 0 | 0 | 1 | 1 |
B | 0 | 1 | 0 | 1 |
Q=A+B | 1 | 0 | | |
A | 0 | 0 | 1 | 1 |
B | 0 | 1 | 0 | 1 |
Q=A+B | 1 | 0 | 0 | |
A | 0 | 0 | 1 | 1 |
B | 0 | 1 | 0 | 1 |
Q=A+B | 1 | 0 | 0 | 1 |
LOGIC with Resistor/Transistor�NAND function – no separate inputs
Make This Circuit
Try using the switches to see what combination lights the LED
Reconfigure the switches
In Circuits LEDs are included to indicate TRUE when ON (Our convention)
Diodes can be used between the switch and transistor to isolate multiple inputs.
A
B
Q
Logical Statement
A . B = Q
Truth Table – examines all input combinations
Symbol
A | 0 | 0 | 1 | 1 |
B | 0 | 1 | 0 | 1 |
Q=A.B | | | | |
A | 0 | 0 | 1 | 1 |
B | 0 | 1 | 0 | 1 |
Q=A.B | 1 | | | |
A | 0 | 0 | 1 | 1 |
B | 0 | 1 | 0 | 1 |
Q=A.B | 1 | 1 | | |
A | 0 | 0 | 1 | 1 |
B | 0 | 1 | 0 | 1 |
Q=A.B | 1 | 1 | 1 | |
A | 0 | 0 | 1 | 1 |
B | 0 | 1 | 0 | 1 |
Q=A.B | 1 | 1 | 1 | 0 |
LOGIC with Transistor/Transistor�NAND function – separate inputs
Make This Circuit
In Circuits LEDs are included to indicate TRUE when ON (Our convention)
A
B
Q
Logical Statement
A . B = Q
A | 0 | 0 | 1 | 1 |
B | 0 | 1 | 0 | 1 |
Q | 1 | 1 | 1 | 0 |
Truth Table – examines all input combinations
Symbol
Function: NOT
Function: AND
Design an Exclusive Or (XOR) Gate
MAKE a Truth Table
A | 0 | 0 | 1 | 1 |
B | 0 | 1 | 0 | 1 |
Q | 0 | 1 | 1 | 0 |
Circle on pin indicates “NOT”
XOR
Design Process�Make a Truth Table
Input�A | Input�B | Logical Need | Output �Need | But we can also Express it as the Not or opposite of | Logical Output |
Input�A | Input�B |
| for "1" |
|
|
0 | 0 |
|
| Not This and | 0 |
1 | 0 | A and Not B | either this |
| 1 |
0 | 1 | B and Not A | or this |
| 1 |
1 | 1 |
|
| Not This | 0 |
XOR Function Implementations
There can be more than one way to get the answer.
Using Inverters and OR gates�(but uses 3 packages partially)
INV1
INV2
| | | Input�A | Input�B | Not A | Not B | A and Not B | B and Not A | AND1OUT OR AND2OUT == | A XOR B |
With inverters | |
|
| INV1 Out | INV2OUT | AND1OUT | AND2OUT | OR OUT |
| |
AND and OR Gates | | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | |
| | | 1 | 0 | 0 | 1 | 1 | 0 | 1 | 1 |
| | | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 1 |
| | | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 |
AND2
AND1
OR
XOR using NAND Gates
Input�A | Input�B | Output� 1 | Output �2 | Output �3 | Output �4 | Logical Need | Ouptput �Need | But we can also Express it as the Not or opposite of |
Input�A | Input�B | Not A.B | Not(A.Not(A.B)) | Not(B.Not(A.B)) | Not(Output3.Output4) |
| for "1" |
|
0 | 0 | 1 | 1 | 1 | 0 |
|
| Not This and |
1 | 0 | 1 | 0 | 1 | 1 | A and Not B | either this |
|
0 | 1 | 1 | 1 | 0 | 1 | B and Not A | or this |
|
1 | 1 | 0 | 1 | 1 | 0 |
|
| Not This |
1
2
3
4
Gate numbers chosen for use in truth table not wiring
To Make with NAND gates�we need expression with NOT(A AND B)
Q =(XOR(A.B)) = (((NOT A) AND B ) OR (A AND (NOT B)))
We write this using “.” or “*” for “OR” , and “+” for “AND” and Line over for “NOT”
Q = A.B + A.B
Using NAND gates we have to use the expression A.B for each gate
We can also write the gate function as A + B which we can use to get the NOT A and NOT B inputs to combine with the A and B.
So A.(A + B) = A.A + A.B but A.A = 0
So A.(A + B) = A.B and similarly
B.(A + B) = A.B
So we have to OR these together to get the answer
Logic States in the XOR circuit
= A.B + A.B
A + B
A.B
A.B
= A.B .
A.B
= A.B +
A.B
= A.B
A.A and B.B terms disappear
Two NOTs cancel each other
Label circuit diagram with package pins�also called “schematic”
Assign pins to the gates
Any gate is the same as any other so choose them for least difficulty in wiring. I picked the same as in truth table just because….
Then:
1
2
3
4
1
2
3
4
5
6
13
12
11
10
9
8
XOR with NAND GATES
You can search for this and find it in TinkerCAD by name and play with it
XOR with Indicators – NOVALABS
or use this link
https://www.tinkercad.com/things/lwPHpsX4i3P-xor-with-indicators-novalabs