Why do gates do what they do?

CCrunnernb

Golden Member
Sep 14, 2000
1,002
0
76
What the heck makes them do what they do? I know what they can do, but why, what is inside that makes them work!

-Nick
 

Bassyhead

Diamond Member
Nov 19, 2001
4,545
0
0
gates are made up of basically transistors. the design of a gate is conceived so that the output(s) states are such and such values when these such and such input(s) conditions are true/false. you can look up data sheets for basic 74xx series ICs that utilize these gates and often times they will include a schematic of how the gate is implemented.
 

azel

Member
Jun 16, 2004
40
0
0
All gates are made of transistors. A transistor has one function; to allow or block flow of electrons.
When there is enough voltage applied to a transistor, the electrons from the first input can flow to the output.
A very primative version of transistors is the vacuum tube.

I'll explain how transistors do this later, but here's how to build an AND gate with just transistors:
Let's define transistor input as INPUT, output as OUTPUT, and voltage input as SWITCH. (If switch is HIGH, the INPUT and OUTPUT are connected. If switch is LOW, the OUPUT is always LOW).

Constant HIGH --> Transistor1.SWITCH
AND_GATE_INPUT_A --> Transistor1.INPUT
Transistor1.OUTPUT --> Transistor2.SWITCH
AND_GATE_INPUT_B --> Transistor2.INPUT
Transistor2.OUTPUT --> AND_GATE_OUTPUT

This way the only way the Transistor1 output is HIGH is when Transistor1 input is HIGH.
Then, the only way the Transistor2's output is HIGH is when Transistor2's input is HIGH and Transistor2's switch is HIGH, which means Transistor1 input is also HIGH. Vola, an AND gate constructed :)

Try solving the puzzle for NOT/OR/XOR, etc gates :) It should be pretty fun. (righhhht only for EE majors)

Here's a schematic of an AND gate:
http://hyperphysics.phy-astr.gsu.edu/hbase/electronic/and.html

.....so, how do transistors actually switch traffic on and off?
There are actually many kinds of transistors. All of them usually use metals called semiconductors, though.
Semiconductors can either block flow of electrons or pass them.
The most commonly used semiconductor is silicon. (SiO2, to be exact)
Silicon Valley is named after silicon not because you can mine Silicon there, but because silicon is the integral semiconductor which are the building blocks of integrated circuits :) (And IT companies are in Silicon Valley :p)
When a potential is applied to silicon it becomes conductive, so the input of a transistor is separated by a thin layer of SiO2 from the output of the conductor.

To dive even deeper, silicon becomes a conductor when applied a voltage because the voltage heats it up and excites the valence electrons in the covalent bonds which make up silicon. Once excited, these electrons become free to roam, so electrons can now go in and out of the silicon. (The reason metals conduct electricity is because electrons can freely move in them) Different elements have different required potential to make the valence electrons go free, and silicon has a very low one so that's why it's the first choice for semicondoctors :)
 

CCrunnernb

Golden Member
Sep 14, 2000
1,002
0
76
Like I said before, I know what the AND and or gates do, a simple truth table will tell you, I wanted to know what was inside that makes it all happen.
 

pm

Elite Member Mobile Devices
Jan 25, 2000
7,419
22
81
Azel had a very good answer. Transistors are what makes it happen in a microprocessor and he gave a nice explanation of how.
 

Geniere

Senior member
Sep 3, 2002
336
0
0
Any device that changes its output state based on its input state can be considered a logic element. It need not be a transistor, nor does it have to be powered by electricity. Logic circuits have been made using fluid or air pressure as the power source. The simplest electronic logic gate can be made using two diodes and a resistor. For instance, aN "OR" gate would be made as follows: Connect the cathodes of two diodes to a resistor. Connect the opposite end of the resistor to ground. The non-grounded end of the resistor is the output which will go ?hi? if either diode?s anode is connected to a ?hi? input source. By ?hi?, in this case I?m referring to a positive voltage, but I could just as easily define a positive voltage as a ?lo?, or a ?1? or a ?0?.
 

imported_devnull

Junior Member
May 22, 2004
9
0
0
Originally posted by: CCrunnernb
Like I said before, I know what the AND and or gates do, a simple truth table will tell you, I wanted to know what was inside that makes it all happen.


So if I get it right you want to see how such a gate is made...

Ok, look at this link : layout design of gates

This is an old design of some simple gates that I made when I was at the university. If this page looks all greek to you, then it is because its in greek!!! You may simply look at the pictures or use an on line translation tool like SysTran or google, to read its contents (I dont know how successfull the translation will be). This link will be valid only for a few days, though!!! (Sorry...) Anyway, the blue in the layout design is metal, the reddish is polysilicon, the green and brown are p- and n- diffusions, the Xs boxes are contacts. PLEASE don't judge the design... It is very simplistic very premature etc. I provide it only as informative as I could not find something better!
 

CTho9305

Elite Member
Jul 26, 2000
9,214
1
81
Originally posted by: devnull
Originally posted by: CCrunnernb
Like I said before, I know what the AND and or gates do, a simple truth table will tell you, I wanted to know what was inside that makes it all happen.


So if I get it right you want to see how such a gate is made...

Ok, look at this link : layout design of gates

This is an old design of some simple gates that I made when I was at the university. If this page looks all greek to you, then it is because its in greek!!! You may simply look at the pictures or use an on line translation tool like SysTran or google, to read its contents (I dont know how successfull the translation will be). This link will be valid only for a few days, though!!! (Sorry...) Anyway, the blue in the layout design is metal, the reddish is polysilicon, the green and brown are p- and n- diffusions, the Xs boxes are contacts. PLEASE don't judge the design... It is very simplistic very premature etc. I provide it only as informative as I could not find something better!

It's worth pointing out that azel's AND gate schematic is a BJT design, whereas your links are to MOSFET designs.

In a BJT (Bipolar Junction Transistor), the switch is controlled by a current flowing into the switch (called "base", for BJTs). In a MOSFET (Metal Oxide Semiconductor Field Effect Transistor), the switch is controlled by a voltage applied to the switch (called "gate" for FETs). This is relevant because it means when a BJT gate is just sitting with its inputs not changing, current is flowing into the bases, so power is being consumed. For FETs, however, a gate that is sitting there doesn't use any power, because no current flows into the gate. (that's in an ideal world... in reality, the gate leaks a little, and even when the transistor is off, it's still a little bit on).

A while back I put together this drawing to attempt to describe a CMOS inverter (Complementary Metal Oxide Semiconductor - complementary because each N has a corresponding P, and MOS because it uses MOSFETs). The upper left drawing is the circuit schematic. The crude drawing below it is a very simple way of modelling the gate (it's not a particularly accurate way of modelling it), and the box on the right is a drawing of a MOSFET (in this case, nmos, which is on when the gate voltage is high).
 

CCrunnernb

Golden Member
Sep 14, 2000
1,002
0
76
Yea, I wanted to know more of what there made of and such. I understand what their function is and when you do this and this it'll give you that. I believe Azel's last part about what there actually made of is what I really wanted to know. I'm in my 3rd semester of school and since day one I was curious as to what was inside these gates that made it all happened. We started out as AND gates do this, OR's that etc. etc.
 

SuperTool

Lifer
Jan 25, 2000
14,000
2
0
Basically a NAND (not-AND) gate has two pulldowns in series, and two pullups in parallel. a pulldown transistor is turned on by a high input, and a pullup is turned on by a low signal.
So if either of the two inputs is low, one of the parallel pullups is on and the series pulldown is off, so the output is 1 (high). If both inputs are high, both pullups are off, and the pulldown in series is on, so the output is 0 (low).
And that's how you make logic gates. NOR gate is the mirror version with two pullups in series, and two pulldowns in parallel. Inverter is one pullup and one pulldown.
XOR gate is made out of several simpler gates (nands, nors, inverters), or using passgate logic, like a multiplexer.
 

Mday

Lifer
Oct 14, 1999
18,647
1
81
Originally posted by: CCrunnernb
What the heck makes them do what they do? I know what they can do, but why, what is inside that makes them work!

-Nick

mmm 2 courses in EE electives. one is semiconductor physics, the other is well, more of the same.
 

Mday

Lifer
Oct 14, 1999
18,647
1
81
Originally posted by: CCrunnernb
Yea, I wanted to know more of what there made of and such. I understand what their function is and when you do this and this it'll give you that. I believe Azel's last part about what there actually made of is what I really wanted to know. I'm in my 3rd semester of school and since day one I was curious as to what was inside these gates that made it all happened. We started out as AND gates do this, OR's that etc. etc.

the simplest case is if you look up what CMOS really is. study briefly what hte current and voltage calculations of a MOSFET is. Then expand that into the PMOS and NMOS model which makes up the CMOS. now, one thing about gate design. AND and OR gates are not easy to make. what are made are nand or nor gates simply because they are easier\cheaper to make (no point in getting into it). you can also look at TTL circuits.

a bit is represented by a voltage. let's say 0V = 0, and 5V = 1. and let's make the gate a 2 input AND gate. if you apply 5 V to both inputs, the output is 5V. if you apply 0V and 0V, the output is 0V. If the inputs are different, the output is 0V. this follows from the characteristics of the transistor design of an AND gate. you must understand semiconductor physics to get this. if you apply the diode model to the transistor circuit design, what happens is that you wind up biasing or reverse biasing the transistor(s) such that the voltage at output is what you want it to be (one of the inputs, both inputs if they are the same, the inverse of both inputs if they are the same). at this point we dont care about what a bit is. we just want to make sure that the voltages are consistent with the truth table for the gate we want to design.

--

this is a mosfet.
this explains several gate designs using MOSFETs
 

CTho9305

Elite Member
Jul 26, 2000
9,214
1
81
Originally posted by: Mday
Then expand that into the PMOS and NMOS model which makes up the CMOS. now, one thing about gate design. AND and OR gates are not easy to make. what are made are nand or nor gates simply because they are easier\cheaper to make (no point in getting into it). you can also look at TTL circuits.

It's simple to explain why AND/OR are "harder" than NAND/NOR... nmos devices, which are turned on when the input is high conduct the value "0" well, and the value "1" poorly. pmos devices, which are turned on when the input is low conduct the value "1" well, and the value "0" poorly. (Device physics explain why that is, but that isn't important to this explanation). An AND or OR gate must pull the output to 1 when the inputs are one or both high, and to 0 when the inputs are one or both low. You just can't do that... so it's easiest to make a NAND or NOR gate and invert the output.