2.4 Computational Logic COMPLETE Flashcards
How do you get a positive output from an AND gate?
Both inputs = 1.
How go you get a positive output from an OR gate?
At least one of the inputs = 1.
How do you get a positive output from a NOT gate?
Input = 0.
How do you calculate how many rows you need in your truth table?
2 to the power of no. of inputs.
In computational logic, all possible outcomes are either…
TRUE or FALSE
Why is it important for computers that all possible outcomes in computational logic are either TRUE or FALSE?
Computers can also only have two states - on or off - represented by 1 and 0 in binary
What are the two states “on” and “off” represented by in binary?
1 and 0
What is boolean logic?
A form of algebra in which all values are reduced to one or two states, TRUE or FALSE
Why is boolean logic especially important for computer science?
It fits with the binary system in which each bit has a value of either 1 or 0, that is, each bit has a value of either TRUE or FALSE
A processor contains over 1 billion t__________
transistors
What to transistors transmit when they are on?
An electrical current
Do transistors transmit an electrical current when they are off?
No
What are the two states of transistors?
On or off
What can the two states of transistors be used to represent?
The conditions true (on) or false (off)
How are logic gates represented?
By symbols in logic diagrams
Logic gates use transistors that…
carry out all of the calculations and execute program instructions in the processor
What logic gate is this?

AND gate
If A = 1 and B = 0, what would Z be?

0
If A = 0 and B = 1, what would Z be?

0
If A = 1 and B = 1, what would Z be?

1
For an output at Q there must be an input at both…

A AND B
What logic gate is this?

OR gate
If A = 1 and B = 0, what would Z be?

1
If A = 1 and B = 1, what would Z be?

1
If A = 0 and B = 0, what would Z be?

0
For an output at Q there must be an input at…

either one of A OR B, or at both of them
What logic gate is this?

NOT gate
If A = 1, what would Z be?

0
If A = 0, what would Z be?

1
There is only an output at Q when…

there is NOT an input at A
The states of inputs and outputs of logic gates can be shown using…
Truth tables
In truth tables, what are used to indicate the presence or absence of an electric current?
a 1 or a 0
What logic gate is this truth table for?

AND gate
What logic gate is this truth table for?

OR gate
What logic gate is this truth table for?

NOT gate
Logic diagrams and truth tables can be used to solve…
logic problems
The Boolean statement P = A AND B implies that P is true only if…
Both A and B are true
How can the Boolean statement P = A AND B be investigated?
Using a truth table
What type of statements can be used to represent selection using relational operators used in programs?
Boolean statements
The statement “if X == 9 AND Y == 6 then” is the same as P = A ___ B
AND
The statement “if NOT(X == 9 AND Y == 6) then” is the same as P = …
NOT(A AND B)
How could the statement “if X != 9 AND Y != 6 then” be represented as a Boolean expression?
P = (NOT A) AND (NOT B)