1.1 Computer organization
The logic diagrams in this section are made with CircuitMaker Student V6.2c by Protel Technology, Inc.
Logic gates are pretty self-explanatory once you understand what they are all about. All inputs to and outputs from a logic gate are thought of as either true or false (denoted T/F, or 0/1, or high/low).
But let's take a couple of examples.
The AND-gate takes two (or more) inputs, which all can be either true or false (1 or 0 / high or low), as just explained. Let's say we have the simplest of AND-gates, with only two inputs. For this AND-gate to output T, both inputs most be T. This is reflected in its name. Is both input A and B true? If yes, then output is true. If one input is false, then the output is false. If both inputs are false, then output is false.
OR, on the other hand, only demands that one of the inputs are true in order for the output to be true. Is A OR B true? If yes, one of them is (or both are) true, then A OR B is true, and the output is true.
XOR (exclusive or) is the same as OR, with the exception that both inputs cannot be true (if they are, output is false). So, if A OR B is true, but not both, then A XOR B is true.
The NOT-gate simply inverts its input. Hence, if input is true, then output is false, and vice versa.
The NAND-gate is and AND-gate with an inverter after it. Likewise, the NOR- and XNOR-gates are OR- and XOR-gates with inverters after them. The circle you can see on all these gates denotes the negation (the NOT, so to speak).
You can see truth-tables for AND and OR-gates in the Boolean algebras-pages, and in the logic-pages. The two pages uses slightly different notations. In Boolean algebra, OR is often written as +, and AND as *. In logic, OR is Ú and AND is Ù. This might sound confusing, but you should get the hang of it, it really isn't difficult.
The convince yourself of the logic, you should draw truth-tables for all the gates. (Do it! Do it! Do it! Do it!)
Let's take the AND-gate as an example. If you look at the picture of an OR-gate in section 1.1.1, you will find that the AND-gate you se here, is very much like that OR-gate, but now with three inverters (NOTs) on it. And you would be perfectly right. What is going on here? Well, remember that the AND-gate only outputs true if both its inputs are true.
Let's draw the truth-table for this new AND-gate. A and B are the inputs. A means NOT A (hence if A is true, A is false, and vice versa), B means NOT B, X means NOT X, and this NOT X is what this gate outputs.
We see from the table that only when A AND B are both true, is the output true, and this was what we wanted an AND-gate to do, right?
1.1.3 Memory (Flip-flops)