SLR 2.4 Computational logic Flashcards

1
Q

What is a truth table?

A

A notation used in Boolean algebra for defining the output of a logic gate or logic circuit for all possible combinations of inputs.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

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
A

The OR gate has the truth table

Input A  ¦  Input B ¦   Output
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
    0       ¦      0       ¦       0
    0       ¦       1       ¦        1
     1       ¦      0       ¦        1
     1       ¦       1       ¦        1
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

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
A

The AND gate has the truth table

Input A  ¦  Input B ¦   Output
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
    0       ¦      0       ¦       0
    0       ¦       1       ¦       0
     1       ¦      0       ¦       0
     1       ¦       1       ¦        1
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Which logic gate has the following truth table?

Input A ¦ Output
_____________
0 ¦ 1
1 ¦ 0

A

The NOT gate has the truth table

Input A ¦ Output
_____________
0 ¦ 1
1 ¦ 0

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Why is binary used to represent data in a computer?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the computational symbol for addition?

A

+

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the computational symbol for subtraction?

A

-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the computational symbol for multiplication?

A

*

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the computational symbol for division?

A

/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the pseudocode for integer division (no remainder)?

A

DIV (note this is the pseudocode for integer division, python uses //)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the pseudocode for modulus (just the remainder of division)?

A

MOD (note this is the pseudocode for modulus, python uses %)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the pseudocode for raising one number to the power of another (e.g. 2 cubed)?

A

^ (note this is the pseudocode for ‘exponentation’ - powers - python uses ** for example 2 ** 3 is 2 cubed)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly