| « 1001001 SOS | Semiconduct THIS » |
So we have diodes, resistors, transistors, capacitors, inducers, and whatnot. So how does this all come together to make computers?
At its heart, a transistor takes an input and provides an output. Alone its a fairly simple logic operation and transistors alone are usually used solely for switching current. However, when you combine them in fascinating ways you can create logic gates. Logic gates take inputs and provide outputs based on certain criteria. The simplest gates are NOT, AND, OR.
If you remember from high school mathematics, logic isn't that complicated. For these gates you have two inputs that are compared and an output that is determined by the input. The inputs will be A and B, the output Q and 1 represents high and 0 represents low.
NOT
Not is one of the most simplest gates, it takes the input and reverses it.
A->Q
1 0
0 1
AND
And merely outputs high when both A AND B are high, otherwise it outputs low.
A+B->Q
0 0 0
1 0 0
0 1 0
1 1 1
OR
Or outputs high when either input is high.
A+B->Q
0 0 0
1 0 1
0 1 1
1 1 1
Simple enough. We also have logic operations that are combination of the above. Combining OR and AND with NOT gives us NOR and NAND. This merely reverses the output as follows
NOR
A+B->Q
0 0 1
1 0 0
0 1 0
1 1 0
NAND
A+B->Q
0 0 1
1 0 1
0 1 1
1 1 0
Now ever more complicated we have logic gates that are slightly more complex. These are the Exclusive OR(XOR) and the Exclusive NOR(XNOR) gates.
XOR
The idea behind the XOR gate is that the inputs can be either or, but not BOTH. Hence it is exclusive to the OR function.
A+B->Q
0 0 0
1 0 1
0 1 1
1 1 0
XNOR
Reverse it.
A+B->Q
0 0 1
1 0 0
0 1 0
1 1 1
There we go, the simplest logic gates. With these logic gates we can make things like adders, flip flops and memory. We'll save the explanation of those for another day since it can get quite tedious.
Since the first post of this blog we've done a crash course in electronics, semiconductors and logic. Now that we understand the basics behind circuitry and electronics we can go ahead and start playing with our microcontrollers and begin learning how to make them do our bidding. Stay tuned as i go into the Binary and Hexadecimal number system and as we begin looking at assembly.