Computational logic 1 Flashcards
outcomes in computational logic
true or false/on or off/ 0 or 1
What is boolean logic and how does it relate to computers?
boolean logic is a form of algebra in which all values are either TRUE or FALSE
it is important for computer science as it fits with the binary system using bits with a value of either 0 or 1
transistors
switches that are either on or off
they transmit an electrical current when on
they don’t transmit when off
the two conditions represent true (on) or false (off)
a processor contains over 1 billion transistors
logic gates
logic gates use transistors that carry out all of the calculations and execute program instructions in the processor
logic gates are represented by symbols in logic diagrams
- AND gate
- OR gate
- NOT gate
AND gate
represented by half of an oblong
- two inputs (A and B)
- one output (Q)
for an output at Q there must be an input at both A AND B
OR gate
represented by half an oblong that has been curved outwards to a point on the right, and curved inwards in a semicircle on the left
- two inputs (A and B)
- ouput (Q)
for an output at Q there must be an input at either one of A OR B or at both of them
NOT gate
represented by a triangle with a small circle at the point
- one input (A)
- output (Q)
there is an output at Q only if there is NOT an output at A
truth tables
the states of the inputs and outputs of the gates can be shown using truth tables where a 1 or 0 is used to indicate the presence or absence of an electrical current
the tables have headings of A/B/Q
e.g. AND gate: A B Q 0 0 0 0 1 0 1 0 0 1 1 1
An AND gate has an input at A of 1 and an input at B of 0.
It is connected to a NOT gate.
What is the output of the AND gate, and the output of the NOT gate? [1]
the AND gate has an output of 0
the NOT gate outputs 1
An OR gate has an input of 1 and 0.
What does it output? [1]
1