Uploaded by Andrew Adithiyaa

GPIS CS-101 (1)

advertisement
Chapter 10
Boolean Logic
• Electronic circuits in computers, many new memories and controlling
devices are made up of thousands of LOGIC GATES.
• Logic gates take binary inputs and produce a binary output.
• Several logic gates combined together form a LOGIC CIRCUIT and
these circuits are designed to carry out a specific function.
• The checking of the output from a logic gate or logic circuit is done
using a TRUTH TABLE.
Logic Gates
Truth Tables
• Truth tables are used to trace the output from a logic gate or logic circuit.
• The NOT gate is the only logic gate with one input; the other five gates
have two inputs.
• When constructing truth tables, all possible combinations of 1s and 0s
which can be input are considered.
• For the NOT gate (one input) there are only 21 =(2) possible binary
combinations.
• For all other gates (two inputs), there are 22 =(4) possible binary
combinations.
• For logic circuits, the number of inputs can be more than 2; for example
three inputs give a possible 23 =(8) binary combinations.
• And for four inputs, the number of possible binary combinations is 24 =(16).
• It is clear that the number of possible binary combinations is a multiple of
the number 2 in every case.
Truth tables for two, three and four inputs
NOT gate
Description:
The output, X, is 1
if: the input, A, is 0
Truth table:
AND gate
OR gate
NAND gate (NOT AND)
NOR gate (NOT OR)
XOR gate
Activity:
Show why X = (A AND NOT B) OR (NOT A AND B) and Y = (A OR B) AND
(NOT (A AND B)) both represent the same logic gate.
OR
Logic circuits
• When logic gates are combined together to carry out a particular
function, such as controlling a robot, they form a logic circuit.
• The output from the logic circuit is checked using a truth table.
• There now follows three examples which show:
• how to produce a truth table
• how to design a logic circuit from a given logic
statement/Boolean algebra
• how to design a logic circuit to carry out an actual safety
function.
Example 1
Example 2
Produce a truth table for the following logic circuit (note the use of • at
junctions):
Part 1
This is the first part of the logic circuit; the first task is to find the
intermediate values P and Q.
The value of P is found from the AND gate where the inputs are A and B.
The value of Q is found from the NOR gate where the inputs are B and C.
Part 2
The second part of the logic circuit has P and Q as inputs and the
intermediate output, R:
Part 3
The final part of the logic circuit has R and C as inputs and the final
output, X:
Putting all three intermediate truth tables together produces the final
truth table which represents the original logic circuit:
The intermediate values can be left out of the final truth table, but it is
good practice to leave them in until you become confident about
producing the truth tables. The final truth table would then look like
this:
Activity
Produce truth tables for each of the following logic circuits. You are
advised to split them up into intermediate parts to help eliminate
errors.
(a)
(b)
(c)
(d)
(e)
Download