Pages: <Previous  28    29    30    31    32    33    34    35    36    37    38  Next >

8 Logic operations

8.6 Summary

The logic operations introduced here are summarised in Table 1, which is an example of what is known as a ‘truth table’. It shows what the result (‘output’) of each logic operation is for all possible combinations of ‘input’ values. You may find this format a useful one for remembering the various logic operations.

Table 1: Summary of the logic operations NOT, AND, OR and XOR

Operation Inputs Output
NOT 0 1
  1 0
AND 0 0 0
  0 1 0
  1 0 0
  1 1 1
OR 0 0 0
  0 1 1
  1 0 1
  1 1 1
XOR 0 0 0
  0 1 1
  1 0 1
  1 1 0

Activity 28 (Self assessment)

  1. If A = 0011 0111 and B = 0100 1011, find
    1. NOT A
    2. A AND B
    3. A OR B
    4. A XOR B
    1. Is A AND B=B AND A?
    2. Is A OR B=B OR A?
    3. Is A XOR B=B XOR A?

Now read the answer

Pages: <Previous  28    29    30    31    32    33    34    35    36    37    38  Next >