Data in computers (or any digital electronic device) is represented in Binary Bits and Bytes. Basically 0 or 1. But how do computers change data? Without going into too much detail, computers do so by way of binary logic.
Below is a list of all the operations that can be done. All operations but "NOT" take in two inputs and spit out one output.
The operations
NOT: Inverts the incoming signal.
Input
0
1
Output
1
0
OR: As long as one input is 1, the output is 1.
Can be thought of as addition, only you have to believe for a moment that 1 + 1 = 1.
Input
00
01
10
11
Output
0
1
1
1
AND: Both inputs must be 1 for the output to be 1.
Can be thought of as multiplication.
Input
00
01
10
11
Output
0
0
0
1
XOR (Exclusive OR): Both inputs must be different for the output to be 1.
Can be thought of subtraction, only the result is the always positive.
Input
00
01
10
11
Output
0
1
1
0
NAND: Same as the AND operation, but the output is inverted. One of the universal logic operations (you can do any of these operations with NAND gates). Most commonly used in Flash Memory
Input
00
01
10
11
Output
1
1
1
0
NOR: Same as the OR operation, but the output is inverted. The other universal logic operation.
Input
00
01
10
11
Output
1
0
0
0
XNOR: Same as the XOR, but the output is inverted.
Outside of computing, it's often written as "iff", for "if and only if", because one is true if and only if the other one is too.
Input
00
01
10
11
Output
1
0
0
1
Supplemental Operations
Three-state Buffer: Normally, whatever signal comes into this will come out just the same. But there's a second input that when turned on, effectively "cuts off" the signal. This third state, known as the Hi-Z state, is seen by the rest of the system as disconnected.
Latch: A latch is a fundamental "storage unit", made with a pair of NOR or NAND gates with the outputs feeding one of the other's inputs, as well as providing an actual output. This produces a pair of opposite outputs. Since there are two outputs, usually only one of them is used. Latches also can't have a certain input, which is either 00 or 11, depending on the type.
For a typical set-reset latch, using output Q (as opposed to Q-not)
Input
00
01
10
11
Output (Q)
(no change)
0
1
(invalid)
Flip-Flop: A flip flop uses a type of latch that uses a clock signal as one of its inputs. Not only is it used to store information, but it can also be used to divide clock signals in half. There are three types of flip-flops named D, T, and JK.
Community content is available under CC-BY-SA
unless otherwise noted.