Lab 2. (Logic Gates and Circuit Design)
(Israel Sanson, Electrical Engineer)
TCES 230 Digital Logic
(Israel Sanson, Electrical Engineer)
TCES 230 Digital Logic
Today in lab we will be designing digital circuits and testing logic gates. Our goal for lab 2, is to gain a real-life understanding and experience, also to give us an opportunity to see how these circuits work. Simultaneously we will be learning how to use the equipment that will help us in understanding our circuits, by testing the circuits we built with the dc generator, and the oscilloscope.
I was to design the logic for a light switch with multiple controls. X was to act as a regular light switch having 0 as false and 1 as TRUE, while y was to be true whether x was false or true, the light would turn on. Finally, while x, and y are true, they do not have to be simultaneously true, but at least one has to be true; z will shut off the light anytime z is true. When building my circuit, I started by creating a truth table, seen on table-1, then I used sum of products to get my equations, I then reduced and used the information to create my diagram of gates. My equation that was used is on figure 1-2.
Figure 1-2
`z*(x+y)
Table-1: This is the truth table for our pre-lab, my thinking was that when z is 1 L will always be 0. Therefore when z is 0 L will be true, as long as either x or y inputs are true.
Figure-1-1 :
This is my logic designed in Logisim, representing a switch with multiple controls. We have 3 inputs x, and y going in to an OR gate, and z getting inverted before going into a AND gate, with all going to an AND gate.
In the beginning of the lab, we had to construct a circuit so that we can test a XOR gate, using the schematics of AND gates from lab 1. We found that when both switches are off the output is false, when either switch is turned on independently the output is true, when both are on then the output is false. After testing both inputs we created a truth table below to show our findings. When looking at the waves created, we can see that, when the input is low the output is high, and when the input is high the output is low. Next we had to replace the input of the switch with the square wave signal straight into the XOR gate input. We found that when the input is false the output is true, and when the input is true the output is true. When we increase the frequency at 1 kHz our findings are similar to the original settings, high low and low input high output.
Figure 1-1:
A picture of the square waves generated when the oscilloscope is inputted to the XOR gate. At low voltage (0v).
Figure 1-2: A picture of our square wave signal from the function generator. With a 1 Hz frequency and a high voltage of 5v and low voltage of 0v.
Figure 1-3:
A picture of the square waves generated when the oscilloscope is inputted to the XOR gate. At low voltage (5v).
Figure 1-4:
A picture of the waves being generated when setting the frequency to 1kHz. When the input is low the output is high, and when the input is high the output low.
Figure 1-5:
A picture of our built circuit, 2 switches used, so 2 inputs with 4 outputs.
Table 2: The truth table containing our readings from lab 2 part 1.
Figure 1-6:
This is the circuit with a square wave signal going in to the XOR gate. We use the switch to set the other input to be low (0v). The output of the XOR gate is connected to channel 2 on the oscilloscope. This same circuit was used to set the input to be high (5v).
For part 2 we had recreated all the steps from part 1 but using a NAND gate instead. After we built it, we found that when switches are off the output is true, when either is on independently the output is true, when both are on the output is false. Which makes sense since the NAND gate converts true cases to false and false cases to true, therefore if both are 0, we get a signal that's true. When we attach the square wave signal to the input of the NAND gate, we get a true output whether the input is false or true. Below are our signals that we got from our oscilloscope readings.
Figure 1-6:
The circuit we created with a NAND gate. When switches are off the output is true, when either is on independently the output is true, when both are on the output is false
Figure 1-5:
This is the circuit with a square wave signal going in to the NAND gate. We use the switch to set the other input to be low (0v). The output of the NAND gate is connected to channel 2 on the oscilloscope. This same circuit was used to set the input to be high (5v).
Figure 1-4:
A picture of the waves being generated when setting the frequency to 1kHz. When the input is low the output is high, and when the input is high the output low.
Table-1:
The truth table for the NAND gate.
Figure 1-1:
Square wave signal with a 1Hz frequency, with high voltage at 5v and low voltage at 0v.
Figure 1-2:
The signal given when the Square wave signal acts as an input to the XOR gates. With the switch set to 0v, and channel 2 is connected to the output of the XOR gate.
Figure 1-3:
The signal given when the Square wave signal acts as an input to the XOR gates. With the switch set to 5v, and channel 2 is connected to the output of the XOR gate.
For this part, we just had to build the circuit that we created in Logisim. We used 47 k ohm resister with our switches, the out come was as expected. From the truth table that we created we found that it was correct, when we tested the 8 outputs. We checked all possible combinations of inputs to test the operation of our circuit, truth table below shows our results.
Figure 1-1:
The circuit we built from prelab.
Table 1-1:
Truth table shown.
For lab 2 we had to create 3 different circuits, one with a XOR, another with a NAND gate, and lastly our circuit with the logic that we designed on Logisim. We used the dc generator for the voltage and the oscilloscope set to square waves to show us the low and high inputs and outputs of voltage. Moreover, for part 1 and part 2 we directly inputted the oscilloscope into the XOR and NAND gates, where we then got different results from the original instructions, as seen in part 1 and part 2 of this notebook. We then built our circuit using the logic that was built in Logisim. In conclusion, I was able to understand and prove that Logisim works, and I was able to get a better understanding of how the NAND and XOR gates work, which for a NAND all cases give a true output as long as one or both are false, except for when 2 inputs are true, then it's a false output. When it comes to XOR gates, at least one input needs to be true in order for the output to be true, but if both inputs are false or true then the output is false.
Sources used: 74ls00-datasheet-1024x576.jpg (1024×576) (circuits-diy.com) , 74LS266_1.PNG (276×205) (bp.blogspot.com) , (9) Oscilloscope Tutorial (Basics 101) - YouTube
I learned that XOR gates have two inputs and one output, and that NAND also has two inputs and one output. I watched the video on how to use the oscilloscope and found how that the vertical knob is to set the voltage at a smaller or larger voltage scale, and the horizontal knob for setting the division or a period of time longer or shorter.