Bitwise Vs. Logical Expressions: In programming, the logic operations AND, OR, and NOT can take two forms: Bitwise and logical. Although they share the same name and in fact the same basic logic concept, they are in fact totally different in their function. Logical operations are the kind you probably think of when you think of these logic operations (assuming you learned about them from a discussion on logic gates). Logical operations are performed on two items and the results based on boolean truth. For example, if A is true and B is false, then A OR B is true, A AND B is false, and NOT A is false, while NOT B is true. Bitwise operations, on the other hand, use binary numbers. Each digit in the number counts as one true-or-false condition. For example, 12 AND 5 equals 4, because 12 is 1100 and 5 equals 0101. 1 AND 0 is 0, 1 AND 1 is 1, 0 AND 0 is 0, and 0 AND 1 is 0. That leaves us with 0100, which is 4. In C, probably the most popular programming language in the world, bitwise operations are specified by using single-instance expressions: & is AND, | is OR, and ! is NOT. For example, "e = 12 & 5" would set e to 4, because it would perform a bitwise AND operation. On the other hand, logical operations are specified by using double-instance expressions: && is AND, || is OR, and != is NOT (or NOT EQUALS). For example, "variable1 && variable2" is a logical operation which is true if both operations are true, and false otherwise. As a side note, this is similar to the way the equals sign is used. A single-instance equals sign (=) is actually a command to set a variable to equal something. For example, "a = 5" makes a equal 5. On the other hand, a double-instance equals sign (==) is used for comparison. For example, "a == 5" is a conditional statement which checks to see if a equals 5.