Hi, Kids!
Welcome back to GraviCalc, where each week we build a new digital logic circuit using
GraviTrax marble runs.
We’re doing this to find out how computers and other electronics work on the inside.
This is our 2nd Lesson in the series.
so if you haven’t watched the first lesson, please go back and watch it first.
Today we’re going to build two logic gates out of one GraviCalc marble circuit.
Before we continue, pause the video and build this week’s track using the app code shown.
The app will give you step by step build instructions, when you switch the app to “manual” mode.
This week’s track can be built with a single starter kit.
No expansions are needed.
Last week I forgot to say: Make sure all switches in your GraviCalc circuits are in the correct
starting position shown in the app, or you won’t get a correct result.
And after running a track, you'll need to reset those switches back to their starting
position before you run the track again.
In last week’s video we briefly introduced some new terms, and today we’re going to
take some more time to talk about them.
We talked about inputs and outputs.
An input is what goes in to a system.
And an output is what comes out of a system.
Think about a calculator.
You may type the phrase, “10+10” into the calculator as an input.
The calculator will then display the answer of “20” as an output.
Or think of a french horn player playing in an orchestra.
His sheet music is the input, and the sound of the horn is the output.
In digital logic, logic gates have inputs and outputs.
These inputs and outputs are electric signals that represent ones and zeroes.
Last week we asked “What is digital logic?”
We learned that digital logic is how electrical circuits work in computer chips.
The word “digital” in digital logic means we’re working with circuits whose inputs
and outputs can only be 1 or 0.
The word “logic” here means we are going to perform arithmetic calculations.
We are not using the word “logic” to refer to logical ways of thinking, or logical fallacies
such as how circular reasoning is often used to date fossils and sedimentary layers as
millions of years old.
So “digital logic” is doing calculations with 1’s and 0’s, which is the binary
system.
Binary means “two”, and so we are working in a math system that can only count to two.
In future videos we are going to learn to count and read numbers in the binary system.
Last week we also mentioned that computers aren’t as smart as they seem.
Instead, they do really simple calculations really fast, over and over and over and over
and over.
And the simplest smallest part of a computer that does a calculation is called a logic
gate.
There are 7 simple logic gates.
We are going to build all of them in our GraviCalc video series, then we’ll start putting them
together to make circuits that can add or multiply.
In computers, the logic gates are hooked to each other, meaning that the output of one
logic gate goes on to the input of another logic gate.
The signals of 1s and 0s are passed from one logic gate to another.
In GraviCalc, we are representing the signals with marbles.
We represent a 1 signal with a marble, and a 0 with no marble, or a lack of a marble.
In GraviCalc, we will eventually be using the marbles to carry the signal from one part
of the circuit track to the next, just like the signals are passed inside a computer.
But first, we have to learn the 7 basic logic gates.
Here are their names.
Repeat after me: AND, OR, XOR, NOT, NAND, NOR, XNOR (repeat several times)
------------------------------- Today's digital logic gates are the OR gate
and the AND gate.
These are a bit different than the NOT gate we built last week.
The NOT gate had one input and one output.
So in our GraviCalc layout, we used a single marble slot on the launcher as the input.
And we used the landing pad as the output.
But the OR gate and the AND gate both have 2 inputs and one output.
So in our GraviCalc circuit, we are going to use 2 slots in the marble launcher as our
2 inputs.
We’ll call the left slot input A. And we’ll call the right slot input B.
If we have a marble in the left slot, that means the state of input A is 1.
If we have no marble in the left slot, that means input A’s state is 0.
If we have a marble in the right slot, that means input B’s state is 1.
If we have no marble in the right slot, that means input B is 0.
Let’s look at how the OR gate works by using a logic table.
A logic table tells us what output we get for each set of inputs.
The OR gate works by treating a value of 1 as TRUE, and by treating a value of 0 as FALSE.
Think about what the word OR means.
What happens if your mom says you can have a cookie if you sweep the floor OR wash the
dishes.
Does that mean you can have a cookie if you sweep the floor?
Yes, that is true.
Does it mean you can have a cookie if you wash the dishes?
Yes, that is true.
Does it mean you can have a cookie if you sweep AND wash dishes?
Yes, that is true.
Does it mean you can have a cookie if you neither sweep nor wash dishes?
No, that is FALSE.
And so we can make a logic table for the OR gate based on the logic of the word “OR”.
If either one of the inputs is 1, the output is 1.
If both of the inputs are 1, then output is 1.
But if both of the inputs are 0, the output is 0.
So let’s run our OR Gate circuit.
We’re going to run all 4 combinations of inputs.
First, we have input A as 1 and input B as 0.
What is the output?
It is 1.
Next, we have input A as 0 and input B as 1.
What is the output?
It is 1.
Next, we have both inputs A and B as 1.
What is the output?
It is 1.
Lastly, we have both inputs A and B as 0.
What is the output?
It is 0.
Now let’s use this track to make an AND gate.
All we have to do is move the switch starting position to the left.
Now we have an AND gate.
Let’s look at how the AND gate works by using a logic table.
Think about what the word AND means.
What happens if your mom says you can have a cookie if you sweep the floor AND wash the
dishes.
Does that mean you can have a cookie if you sweep the floor?
No, that is FALSE.
Does it mean you can have a cookie if you wash the dishes?
No, that is FALSE.
Does it mean you can have a cookie if you sweep AND wash dishes?
Yes, that is TRUE.
Does it mean you can have a cookie if you neither sweep nor wash dishes?
No, that is FALSE.
And so we can make a logic table for the AND gate based on the logic of the word “AND”.
The output is only 1 if BOTH of the inputs are 1.
So let’s run our AND Gate circuit.
We’re going to run all 4 combinations of inputs.
First, we have input A as 1 and input B as 0.
What is the output?
It is 0.
Next, we have input A as 0 and input B as 1.
What is the output?
It is 0.
Next, we have both inputs A and B as 1.
What is the output?
It is 1.
Lastly, we have both inputs A and B as 0.
What is the output?
It is 0.
So hooray!
Today you learned how an OR gate and an AND gate works.
Because the AND and OR gates each have 2 inputs and 1 output, they are going to be helpful
when we start building a GraviCalc computer circuit that can do arithmetic calculations
like adding two numbers.
We’ve now built 3 of the 7 basic logic gates.
Good job guys!
We're going to build other 4 gates over the next 4 weeks.
Okay, see you next week.
Thanks a lot guys!