# Logic Gates - An Introduction To Digital Electronics - PyroEDU

you in the previous lesson we took a look at two number systems binary and decimal which are actively used in

## digital

### electronics

in this lesson we'll move forward and apply the on-off true/false quality that the binary number system offers us and see how it applies to## logic

### gates

and boolean algebra boolean algebra uses three operators to perform mathematical boolean operations they are and or not## logic

### gates

are a graphical way to represent boolean algebra equations through## logic

diagrams and with a## logic

diagram drawn you can move to## digital

hardware and actually build the circuit the first boolean expression and## logic

gate that we'll look at is called the and gate graphically it looks like this symbol and algebraically it is represented by this dot but like multiplication you can actually just have the two input symbols x and y together it means that they should be ANDed together the way that this## logic

gate works is with binary inputs the inputs and outputs are defined by what is called a truth table as you can see on your screen now this truth table shows that only when both inputs are## logic

one can an output from the## logic

gate of## logic

1 be achieved if either of the inputs is a## logic

0 the and### gates

output is also a## logic

0 the next boolean operator and## logic

gate that we'll look at is called the or gate graphically it looks like this a more curved version of the and gate the boolean algebra representation of or is a plus sign just as with the and gate in...or

## logic

gate has a truth table that defines is function here the truth table shows us that when either input signal is a## logic

1 the output is a## logic

1 only when both inputs are## logic

0 does the output become## logic

0 the next boolean operator and## logic

gate is called the not gate and in boolean algebra it is represented by putting a line over the input like this the not gate is the most simple of all the## logic

### gates

because all it does is invert the input signal from## logic

1 to## logic

0 or from## logic

0 to## logic

1 so the truth table for it looks like this the final boolean expression and## logic

gate that we'll look at is called the XOR gate and it's boolean algebra symbol looks like this the X or gate short for exclusive or is a special guy that combines both the or gate and and### gates

together here is the truth table for how the XOR reacts to different inputs when the inputs are both 0 0 or 1 1 the output is## logic

0 however if either input is a 1 the output is a## logic

1 this might seem like an odd operation to have but the more tools we have in our## digital

## logic

toolbox for solving problems the better these## logic

### gates

form the basis of## digital

### electronics

if you delve deeper into## logic

gate Theory you can discover other types of## logic

### gates

do exist but they are all some combination of the and/or not## logic

### gates

that we just learned about now that we've established the theory let's get some integrated circuits out and see this stuff in action for the...experimentation part of this lesson we'll go through each of the three basic

## logic

### gates

and or not and verify that they work like we would expect by building a circuit and checking the truth table first let's check the and gate the 74 HC zero eight I see is a quad and gate device this circle can be found on any integrated circuit chip it tells you that pin 1 is right next to it from that point you can count out the identification of each pin as you see on your screen for the## logic

ICS will be using pin 7 is always ground and pin 14 is always plus 5 volt VCC the 74 HC 0 8 IC has four and### gates

inside of it with each of the inputs and outputs connecting two different pins on the IC will only need one and gate for this experiment so we'll only be using pins 1 2 and 3 here's the schematic of the circuit we'll build this circuit to test out the end gate and if you look closely you can see the inputs to that and gate are pins 1 and 2 and the output is pin 3 the parts used in this experiment are jumper wire from the wire kit and a breadboard from the components kit we'll need a 9-volt battery connector a 7805 +5 volt regulator 3 red LEDs a 9-volt battery a 74 HC 0 8 integrated circuit and 3 100 ohm resistors so let's set up our experiment we're going to want to run everything off of +5 volt power so we'll use a 7805 voltage regulator at the top of the breadboard here 10 1 connects to the plus 9 volt connectors input the red wire pin 2 connects to...the plus 9 volt ground the black wire and pin 3 is the +5 volt output from the 7805 will connect the 7805 s pin 3 to the power bus line with a yellow wire and pin 2 to the ground bus line with a green wire to red wires connect the +5 volt power and ground to a second bus line on the breadboard the 74 HC 0 8 and gate IC will be placed in the middle notice that it fits perfectly bread boards are designed to be used specifically with these type of pea dip integrated circuits connect +5 volt power to pin 14 and ground to pin 7 and now we're ready to test the and gate to confirm the truth table we'll need to give the and gate two input signals and view the output as per the schematic we'll connect three 100 ohm resistors to the and gate at pins one two and three and then connect each of those resistors to an LED that goes to ground these three LEDs will represent the two inputs to the and gate and the one output from the and gate if an input or output to or from the and gate is a

## logic

one the LED will turn on if it is a## logic

0 the LED will be off with the battery plugged in the system is turned on the two yellow wires will be used to change the state of the system the first state that we're looking at right now is input of 0 0 which yields an output of 0 now using the two yellow wires will change input States between## logic

0 and## logic

1 to verify the truth table when input is 0 1 output is 0 when input is 1 0 output is 0 and when input is 1 1 output is 1 and that...is how the and

## logic

gate works let's perform the same experiment with the or gate like the previous I see this 74 HC 32 IC has 4 dual input or### gates

inside of it here is the schematic that we will be building the only difference is that we're using a 74 HC 32 or gate integrated circuit that means you can actually just remove the IC from the previous experiment and put the 74 HC 32 in exactly the same spot now let's go through the truth table again and verify the or gate does what we theoretically expect when the input is 0 0 represented by the LEDs on the left side the output is 0 when we change the input to 0 1 the output is## logic

1 changing the input to 1 0 the output is still## logic

1 and finally we test when the input is 1 1 and you can see the output is also a## logic

1 represented by the LED being on thus the or gate follows the theory exactly the last device that we will experiment with is the not gate the for hc0 for inside of this I see there are 6 knot modules that we can use if you remember from theory section the not gate is an inverter whatever is input the opposite is output here is the schematic for this experiment notice that this time there are only two LEDs because there is only one input and one output from a not gate for this circuit will place the IC in the middle of the board and add power and ground connections then the to 100 ohm resistors are connected to pins 1 and 2 followed by 2 LEDs which connect from those resistors to ground finally a...yellow wire is added to give input to pin 1 now you can see the input on the left-hand side and the output on the right-hand side when

## logic

0 is connected to the input of the 74 HC 0 4 at pin 1 the output at pin 2 is a## logic

1 and if we change the input to a## logic

1 the output changes to a## logic

0 since this 74 HC 0 4 is an inverter it is working perfectly and we have just verified its truth table the components kit also includes an xor gate a 74 86 a NAND gate a 7400 and Donora gate a 7400 to take some extra time and find the truth tables for these devices and go through and verify that they follow the truth table using the method we experimented with just now while## logic

### gates

alone are hard to find in the real world their true place is actually in the bigger picture called## logic

diagrams a## logic

diagram like these produces a single output given multiple inputs just like cars at a four-way intersection with a stoplight the sensor for each stoplight must know if a car is present or not in order to determine if it should turn to a green light beyond graphical## logic

there exists a written style of## logic

called boolean algebra which represents the complex input and output system of## digital

## logic

and allows you to more easily play with the numbers in order to simplify them we'll learn more about boolean algebra in the next lesson in a final real-world note## digital

## logic

the idea that things have two states either on or off or true or false is also widely used in programming...languages across the board you can see ands ORS trues and falses in plain English or represented by simple symbols but they're actually performing the same simple task that a