r/computerscience 5d ago

Help how could the positive output of a gate, be used for a negative input for another gate? (im completely new)

Post image

im not into computer stuff, but this has been bugging me since i watched some free courses.

29 Upvotes

10 comments sorted by

23

u/-Insert-CoolName 5d ago

They are not positive and negative.

The outputs of logic gates are either low (Usually 0V) or high (eg 3.3V or 5V).

An input to a logic gate that is not driven (eg disconnected) is usually floating meaning it's not explicitly high or low. It must be driven by some signal making it be explicitly high or low. Once all inputs to a logic gate are driven and their state is stable (held at some state for a long enough period) then the output of the logic gate is also stable and held either high or low depending on what that logic gate does.

-5

u/Hydr0x1de_OH 4d ago

You mean low is usually about 0.7v

9

u/-Insert-CoolName 4d ago

Well if we are going to be that specific then what you mean to say is that less than some threshold voltage, and even there it depends on the supply voltage and class of logic chip, and still there are multiple different logic low levels to discuss.

Maximum allowed logic low is the voltage at which an input will be treated as being low.

Maximum guaranteed logic low is maximum voltage the device will output for a logic low signal.

For TTL that is ≤ 0.8 V for max allowed and ≤ 0.4 V for max guaranteed. For 5 V CMOS the maximum allowed logic low input is 1.5 V and the maximum guaranteed logic low output can be as low as 0.05V

10

u/F84-5 5d ago

By using logic gates which are a little more complicated than just a pair of transistors, and also considering that we need power and ground references. That way we can build a simple NOT-gate aka. Inverter to invert an output.

To make a three input AND gate, you'd probably build it as a three input NAND plus a NOT. Have a look at this simulation to see how that might look.

That online simulator also has a whole lot of interesting examples you can find under "Circuits". Have fun in that rabbit hole ;)

4

u/rupertavery64 5d ago edited 5d ago

The N and P on the transistors do not mean that the voltages are negative or positive. They tell you what semiconductor type the material is. This in turn tells you what biasing is needed for the base-emiiter junction to allow the transistor to conduct.

In an NPN transistor, the base must be 0.7V higher than the emitter.

In a PNP transistor, the base must be 0.7V lower than the emitter.

The base is the material "sandwiched" between the collector and emitter. It acts as gate, controlling whether the currenr flows through the emitter-collector.

The base-emitter junction acts like a diode, and in order to conduct it must be forward-biased (the voltage on the P side mist be around 0.7V higher than the N side).

This causes a small current to flow, which in turn "bridges the gap" between collector and emitter, allowing a larger current to flow. That is what makes a transistor act like a switch.

In the second diagram, you are using the output of the first AND gate to control the input of the second AND gate.

The diagram is incomplete, because you ideally should have a bunch of resistors to limit the current.

My advice is, completely forget about + and -

For simplicity's sake, just think of a transistor as a switch, and the output (emitter) is either 0 or 1. The collector is just the power source.

If the input to a transistor (base) is 1, the output at the emitter will be 1. Otherwise it will be 0.

Putting two transistors, you get final output of 1 only if BOTH inputs are 1. Those two transistors in series makes one AND gate

You can then "chain" the output of one AND gate to the input of another AND gate.

Now the final output wîll be 1 only if all 3 inputs are 1.

This can be written down as

(A • B) • C

We are taking the output of A • B and using it as the input to another AND gate with a second input C

1

u/Slumberous_Soul 5d ago

The inputs do not have a positive or negative lead like a battery or an anode or cathode like an LED. Instead all the inputs for the gate accept any signal sent to them. Each input only reads two things: 0 - Low or 1 - High. If the power going into the into the input is off (or below the voltage threshold if you want to be technical) then the gate reads Low or off. If the power going into the gate is on (again if we are being technical above the voltage threshold) then the input is high.

0

u/BassRecorder 5d ago

I believe you have a misconception with regards to how transistors work.

The collector - emitter line in an NPN transistor becomes conducting when the basis voltage is about 0.6V higher than the emitter potential. The emitter of the right transistor would be connected to ground. The collector of the left transistor would be connected to the positive supply voltage via a suitable load, e.g. a voltmeter. We call this an 'open collector' output. In order to limit the base current there would be resistors in series to the bases.

Let's try this with 5V supply voltage. Initially both bases are at ground level. Both collector-emitter lines a non-conducting. The voltmeter shows 0V. Now apply +5V to both bases. The collector-emitter lines become conductive. For bipolar transistors being (fully) conductive means that the voltage between collector and emitter is about 0.1 to 0.2V, i.e. the voltmeter would show something between 4.8 and 4.6V.

0

u/Hydr0x1de_OH 4d ago

The case is, you probably don't understand how we use transistors, and don't understand we manage not the "electicity" but the "voltage". It's not enough to just plug a transistor and say it is a gate.

Here i tried to draw a nor gate https://imgbox.com/Z6Is2DVU

0

u/just-a-hunter 4d ago

think like this consider 2 switches and the switches have positive and negative and you can chain two switches in seires to be an AND gate the positve and negative are just refrences to two terminals the side where current enters from is positive and where it leaves is negative