SLR 2.4 Computational logic Flashcards
What is a truth table?
A notation used in Boolean algebra for defining the output of a logic gate or logic circuit for all possible combinations of inputs.
Which logic gate has the following truth table?
Input A ¦ Input B ¦ Output \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ 0 ¦ 0 ¦ 0 0 ¦ 1 ¦ 1 1 ¦ 0 ¦ 1 1 ¦ 1 ¦ 1
The OR gate has the truth table
Input A ¦ Input B ¦ Output \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ 0 ¦ 0 ¦ 0 0 ¦ 1 ¦ 1 1 ¦ 0 ¦ 1 1 ¦ 1 ¦ 1
Which logic gate has the following truth table?
Input A ¦ Input B ¦ Output \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ 0 ¦ 0 ¦ 0 0 ¦ 1 ¦ 0 1 ¦ 0 ¦ 0 1 ¦ 1 ¦ 1
The AND gate has the truth table
Input A ¦ Input B ¦ Output \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ 0 ¦ 0 ¦ 0 0 ¦ 1 ¦ 0 1 ¦ 0 ¦ 0 1 ¦ 1 ¦ 1
Which logic gate has the following truth table?
Input A ¦ Output
_____________
0 ¦ 1
1 ¦ 0
The NOT gate has the truth table
Input A ¦ Output
_____________
0 ¦ 1
1 ¦ 0
Why is binary used to represent data in a computer?
Circuits only need to check for two states (they can use switches). The states are electricity flowing or not flowing (on / off OR 1 / 0). This results in more reliable circuits.
What is the computational symbol for addition?
+
What is the computational symbol for subtraction?
-
What is the computational symbol for multiplication?
*
What is the computational symbol for division?
/
What is the pseudocode for integer division (no remainder)?
DIV (note this is the pseudocode for integer division, python uses //)
What is the pseudocode for modulus (just the remainder of division)?
MOD (note this is the pseudocode for modulus, python uses %)
What is the pseudocode for raising one number to the power of another (e.g. 2 cubed)?
^ (note this is the pseudocode for ‘exponentation’ - powers - python uses ** for example 2 ** 3 is 2 cubed)