First Electrical Engineering Lab, Need Help!

GopherT

Joined Nov 23, 2012
8,012
First chip I think I got to work on the simulator! good way to end the night. Ill be doing more tomorrow with the other gates/chips (I know this is ridiculously basic but at least its something)
That's the idea. Now,
- add a resistor to the bottom of your LED (set it to 470 ohms),
- then connect other end of resistor to the ground wire below it.

Then you will see the LED light up instead of just turn Green outline. The green outline color means positive voltage is on that component or that wire.
 

GopherT

Joined Nov 23, 2012
8,012
One other problem. The simulation software generally thinks that wires that are not connected to positive are at ground. That is not true in real life. You always want an input wire in a logic circuit either at 0V or 5V (if working with 5V logic).

That means, your NOT gate has an issue. I circled it in red.

Add a 10k resistor ("pull down resistor"). as shown in the second image below.


upload_2015-9-5_6-14-13.png



upload_2015-9-5_6-18-42.png
 

Thread Starter

Hunter Neumann

Joined Aug 24, 2015
53
One other problem. The simulation software generally thinks that wires that are not connected to positive are at ground. That is not true in real life. You always want an input wire in a logic circuit either at 0V or 5V (if working with 5V logic).

That means, your NOT gate has an issue. I circled it in red.

Add a 10k resistor ("pull down resistor"). as shown in the second image below.


View attachment 91086



View attachment 91087
Figured I would miss something like that. We have not covered resistors yet. Can you tell me what exactly why (what it does) you need a 10k resistor on the input and one set at 470 ohms connected to the led? Thanks for the help

Edit: Also do I need to put a 10k resistor on all inputs?
 

GopherT

Joined Nov 23, 2012
8,012
Figured I would miss something like that. We have not covered resistors yet. Can you tell me what exactly why (what it does) you need a 10k resistor on the input and one set at 470 ohms connected to the led? Thanks for the help

Edit: Also do I need to put a 10k resistor on all inputs?
No. Just to pull the signal up or down. There are other ways to do it in the simulator but most likely, it will be done like I said in a real circuit if using a switch.

I am not using iCircuit right now on my PC so I will post an alternative later - one that does not take up so much space for you on your work area of the simulator.
 

MrAl

Joined Jun 17, 2014
8,382
Thanks for your reply, here is my Icircuit diagram of what I think I should start out with for the equation you gave me. Looking forward to your response.

Edit: I now know (or think I do anyway) to change the switches to spst
Hello again,

Well, that's one way to start, but the simpler way is to just draw out the gate diagram, then later go to the actual physical device selection. So you go from equation to gate diagram, then to actual physical device selection. That's probably the best way to go because you have to deal with less abstraction for each step.

The attachment shows the three main gate types, and a simple direct implementation of a simple equation. Note that we can also call that implementation a "NOR" gate, which is just an OR gate with an inverted output. Similarly, a "NAND" gate is just an AND gate with an inverter on the output. You can see that the NOR gate implementation is just a cascade of an OR gate and a NOT gate.

Also note that all along here we are referring to the logic from the point of view of what is called "positive logic". More about that another time though.

See if you can draw out the direct gate diagram of the previous equation we talked about:
D=A*B+C

Once you get used to doing it this way you will find it very simple to draw out more complicated networks of logic gates.
 

Attachments

Thread Starter

Hunter Neumann

Joined Aug 24, 2015
53
Hello again,

Well, that's one way to start, but the simpler way is to just draw out the gate diagram, then later go to the actual physical device selection. So you go from equation to gate diagram, then to actual physical device selection. That's probably the best way to go because you have to deal with less abstraction for each step.

The attachment shows the three main gate types, and a simple direct implementation of a simple equation. Note that we can also call that implementation a "NOR" gate, which is just an OR gate with an inverted output. Similarly, a "NAND" gate is just an AND gate with an inverter on the output. You can see that the NOR gate implementation is just a cascade of an OR gate and a NOT gate.

Also note that all along here we are referring to the logic from the point of view of what is called "positive logic". More about that another time though.

See if you can draw out the direct gate diagram of the previous equation we talked about:
D=A*B+C

Once you get used to doing it this way you will find it very simple to draw out more complicated networks of logic gates.
This the way I think I am supposed to diagram the equation
 

Attachments

Thread Starter

Hunter Neumann

Joined Aug 24, 2015
53
No. Just to pull the signal up or down. There are other ways to do it in the simulator but most likely, it will be done like I said in a real circuit if using a switch.

I am not using iCircuit right now on my PC so I will post an alternative later - one that does not take up so much space for you on your work area of the simulator.
So the 10k resistor is needed for switches? Im sure we will get into more about Ohm's law and how to apply it either in this class or in my physics class I will be taking next semester
 

Attachments

MrAl

Joined Jun 17, 2014
8,382
This the way I think I am supposed to diagram the equation
Hi,

That is very close to the right way to draw out the logic gates for that expression so i see you have made progress :)

If you draw it out as gates you dont need to show any real switches. You can just label the inputs as "A", "B", etc. If you do choose to draw switches however, then you need to show how both states of the switch show up as an input. For your switches we can see what happens when the switch is 'on', but when the switch is 'off' there is then no input to the gate. No input to a gate is not really an allowed state for logic. Most gates either require a pull down, pull up, or a switch that has two distinct states like a SPDT switch. With a SPDT switch when the upper section is 'on' then the gate input gets a logical '1' or "high" signal, and when the SPDT switch lower section is 'on' then the gate input gets a logical '0' or "low" signal. In this way the gate either gates a 1 or a zero, but never an 'open' which although sometimes works with some logic families is not usually allowed because the input may float to either level which means we can no longer predict what the output will be. In short, the logic is very complicated with an open input so it is better to no allow any open inputs.
Another way to get a more well defined input from an SPST switch is to use a pull down or pull up resistor. In your case you have the switches going to +Vcc, so you would use a pull down resistor on the input of the gate so that when the switch is open the resistor supplies an equivalent 'low' logic signal to the input of the gate. The value of the resistor is highly dependent on the logic family however, and sometimes it is better to use a pull up and connect the switch to ground so that the switch provides a logical zero when 'on' rather than a logical 1. The best way again depends on the logic family, but if using CMOS then either way works pretty well.
When using switches as the input to logic circuits we sometimes get into other problems too, such as switch bounce. This is a problem where the switch closes, then opens, then closes, then opens again for a few times before it comes to rest mechanically. This causes a bunch of pulses to enter the gate input rather than one clean transition.
All the switch implementation problems go away when we simply label the inputs as A, B, or C, as needed. If switches are really needed though, then you have to study the effects switches have on logic circuit inputs, and at the very least make sure that the input always gets a well defined state either 0 or 1 (a low or a high input, but not an open circuit).
 

Thread Starter

Hunter Neumann

Joined Aug 24, 2015
53
Hi,

That is very close to the right way to draw out the logic gates for that expression so i see you have made progress :)

If you draw it out as gates you dont need to show any real switches. You can just label the inputs as "A", "B", etc. If you do choose to draw switches however, then you need to show how both states of the switch show up as an input. For your switches we can see what happens when the switch is 'on', but when the switch is 'off' there is then no input to the gate. No input to a gate is not really an allowed state for logic. Most gates either require a pull down, pull up, or a switch that has two distinct states like a SPDT switch. With a SPDT switch when the upper section is 'on' then the gate input gets a logical '1' or "high" signal, and when the SPDT switch lower section is 'on' then the gate input gets a logical '0' or "low" signal. In this way the gate either gates a 1 or a zero, but never an 'open' which although sometimes works with some logic families is not usually allowed because the input may float to either level which means we can no longer predict what the output will be. In short, the logic is very complicated with an open input so it is better to no allow any open inputs.
Another way to get a more well defined input from an SPST switch is to use a pull down or pull up resistor. In your case you have the switches going to +Vcc, so you would use a pull down resistor on the input of the gate so that when the switch is open the resistor supplies an equivalent 'low' logic signal to the input of the gate. The value of the resistor is highly dependent on the logic family however, and sometimes it is better to use a pull up and connect the switch to ground so that the switch provides a logical zero when 'on' rather than a logical 1. The best way again depends on the logic family, but if using CMOS then either way works pretty well.
When using switches as the input to logic circuits we sometimes get into other problems too, such as switch bounce. This is a problem where the switch closes, then opens, then closes, then opens again for a few times before it comes to rest mechanically. This causes a bunch of pulses to enter the gate input rather than one clean transition.
All the switch implementation problems go away when we simply label the inputs as A, B, or C, as needed. If switches are really needed though, then you have to study the effects switches have on logic circuit inputs, and at the very least make sure that the input always gets a well defined state either 0 or 1 (a low or a high input, but not an open circuit).
Its hard for me to follow everything you're saying with my knowledge but you explained it well, I thought that showing variables as switches was the way you were supposed to on the simulator but I changed it to just a text box. Let me know what you think now, thanks!

Edit: I can draw up gate diagrams using the basic gates pretty well by using the order of precedence even with moderately hard equations like in my lab. Im also pretty good with the truth tables. However, the main problem I'm having is understanding how it works with the chips, power, ground, switches, led, resistors (hands on stuff) ect as I have not had ANY experience with even basic wiring or any of that stuff. I guess the logic behind it is what confuses me right now like in the post above I didn't know that you needed resistors or what exactly they do and where to place them. It is only my first week of getting into this stuff but I want to try and get ahead and you guys are helping me out so thanks!

(I'm getting an analog and digital design trainer with the 7400, 7402, 7404, 7408, and 7432 chips with wires this week so I can start learning how to apply it hands on.. Id love to get suggestions on what else I should get to help out as well)
 

Attachments

Last edited:

GopherT

Joined Nov 23, 2012
8,012
Hunter,

Just add the DC Rail icon as your inputs for +5 and 0V. Then you can easily use your AND, OR and NOT symbols. Everything is clean and neat.

Here with the 7400 series chips...

image.jpg

image.jpg

Or, with the symbols instead of the chip...

image.jpg
 

Thread Starter

Hunter Neumann

Joined Aug 24, 2015
53
Hunter,

Just add the DC Rail icon as your inputs for +5 and 0V. Then you can easily use your AND, OR and NOT symbols. Everything is clean and neat.

Here with the 7400 series chips...

View attachment 91120

View attachment 91121

Or, with the symbols instead of the chip...

View attachment 91122
That helps me understand it a bit better, So I use voltage to act as 1 or 0. (high, low) (on, off) not sure how to correctly characterize it. Then the output goes through the resistor before hitting the led so that the voltage is not too much? What would happen in real life if the resistor was not there?
 

GopherT

Joined Nov 23, 2012
8,012
That helps me understand it a bit better, So I use voltage to act as 1 or 0. (high, low) (on, off) not sure how to correctly characterize it. Then the output goes through the resistor before hitting the led so that the voltage is not too much? What would happen in real life if the resistor was not there?
You have two options.
A) simply connect jumpers to your inputs from either the 5V power rail (1) or the ground rail (0) of the protoboard. No resistors needed. (Simple)

B) if you use switches in a real device that you plan to build, use a resistor to connect to your "default" power rail (0 or 1) and then connect the switch between your input pin and the other rail (1 or 0 respectively). (More complex - especially on a protoboard).

Cheers.
 

Thread Starter

Hunter Neumann

Joined Aug 24, 2015
53
You have two options.
A) simply connect jumpers to your inputs from either the 5V power rail (1) or the ground rail (0) of the protoboard. No resistors needed. (Simple)

B) if you use switches in a real device that you plan to build, use a resistor to connect to your "default" power rail (0 or 1) and then connect the switch between your input pin and the other rail (1 or 0 respectively). (More complex - especially on a protoboard).

Cheers.
I think I got my lab diagrammed correctly as a gate diagram! check it out and see if you see anything wrong with it
 

Attachments

Thread Starter

Hunter Neumann

Joined Aug 24, 2015
53
You have two options.
A) simply connect jumpers to your inputs from either the 5V power rail (1) or the ground rail (0) of the protoboard. No resistors needed. (Simple)

B) if you use switches in a real device that you plan to build, use a resistor to connect to your "default" power rail (0 or 1) and then connect the switch between your input pin and the other rail (1 or 0 respectively). (More complex - especially on a protoboard).

Cheers.
Just finished my chip diagram for the lab equation too if you wouldn't mind checking it out, Thanks!
 

Attachments

Top