chapter_10_-_boolean_logic

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 24

Boolean logic

You should be able to:


1. Identify and use the standard symbols for logic gates
2. Define and understand the functions of the logic gates Including:
– NOT
– AND
– OR
– NAND
– NOR
– XOR (EOR)
– the binary output produced from all the possible binary inputs

3. (a) Use logic gates to create given logic circuits from a:


I. problem statement
II. logic expression
III. truth table
(b) Complete a truth table from a:
i. problem statement
ii. logic expression
iii. logic circuit
(c) Write a logic expression from a:
iv. problem statement
v. logic circuit
vi. truth table
Boolean logic
Electric Circuits in computers have little devices called Logic Gates.
Logic gates :
• Represents binary values by changing the electricity from high voltage (1)
to low voltage (0) and vice versa
• Put in binary values and output a binary value as well.
• Logic gates regulate the flow of electricity through an electronic circuit by receiving and
modifying binary input and output, and have a switch on and off
LOGIC CIRCUIT is formed when several logic gates combined together and these circuits carry
out a specific function.
TRUTH TABLE is used for the checking of the output from a logic gate or logic circuit.
Logic gates
Six different logic gates will be considered in this chapter:
The function of the logic gates
1) NOT gate : One Input
Truth table :
1 input : 21 combination

A Output X
Description: 0 1
The output X, is 1 if: the input, A, is 0
1 0

logic notation : X = NOT A

Boolean algebra : X=ā


. represents the AND operation
+ represents the OR operation
a bar above the letter represents NOT o
The function of the logic gates
2) AND gate : 2 Inputs

Truth table:
2 inputs
Description: A B X
The output, X, is 1 if: 0 0 0
both inputs, A and B, are 1 0 1 0

1 0 0
logic notation : X = A AND B
1 1 1

Boolean algebra X = a · b . represents the AND operation


+ represents the OR operation
a bar above the letter represents NOT o
The function of the logic gates
3) OR gate
Truth table:
2 inputs
A B X
Description:
0 0 0
The output, X, is 1 if: either input, A or B, is 1
0 1 1

logic notation X = A OR B 1 0 1

1 1 1
Boolean algebra X = a + b
. represents the AND operation
+ represents the OR operation
a bar above the letter represents NOT o
The function of the logic gates
4) NAND gate (NOT AND)
Truth table:
2 inputs
Description: A B X

The output, X, is 1 if: input A AND input 0 0 1

B are NOT both 1 0 1 1


Truth table: 1 0 1

1 1 0
logic notation : X = A NAND B
. represents the AND operation
+ represents the OR operation
Boolean algebra : X= A . B a bar above the letter represents NOT o
The function of the logic gates
5) NOR gate
Truth table:
2 inputs
A B X
Description:
0 0 1
The output, X, is 1
IF neither input A nor input B is 1 0 1 0

logic notation X = A NOR B 1 0 0

1 1 0
Boolean algebra X = A + B
. represents the AND operation
+ represents the OR operation
a bar above the letter represents NOT o
The function of the logic gates
6) XOR (EOR) gate

Truth table:
2 inputs
Description:
A B X
The output, X, is 1 if:
0 0 0
(input A is 1 AND input B is 0)
OR 0 1 1

(input A is 0 AND input B is 1) 1 0 1

1 1 0
logic notation X = A XOR B
. represents the AND operation
+ represents the OR operation
Boolean algebra X = A ⊕ B a bar above the letter represents NOT o
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 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.
1 input : 21 =2 combinations 2 inputs : 22=4 combinations 3 inputs: 23 =8 combinations

A B A B A B C
0 0 0 0 0 0 0

1 0 0 1 0 0 1

1 0 0 1 0

1 1 0 1 1

1 0 0

1 0 1

1 1 0

1 1 1
Logic circuits, logic expressions, truth
tables and problem statements
show how to carry out the following tasks:
Complete a truth table from a:
– problem statement
– logic or Boolean expression
– logic circuit

Create a logic circuit from a:


– problem statement
– logic or Boolean expression
– truth table

Write a logic or Boolean expression from a:


– problem statement (examples 6 and 7)
– logic circuit (example 2)
– truth table (examples 4 and 5).
Create logic circuits and truth table from logic expression
Consider the given logic statement:

X = ( ( (A XOR B) AND C ) OR NOT C)

Draw a logic circuit to match the given logic statement.


Create logic circuits and truth table from logic expression
Consider the given logic statement:

X = (((A NAND B) NOR (B AND C)) OR C)

Draw a logic circuit to match the given logic statement.


Logic Circuit
Create logic circuits from problem statements
Problem statement is : is when a logic problem is described in natural language, and you are
given criteria for the logic of the problem within that description .
Create logic circuits , logic expression and truth table from
problem statements
A wind turbine has a safety system which uses three inputs to a logic circuit. A certain
combination of conditions results in an output, X, from the logic circuit being equal to 1.
When the value of X = 1 then the wind turbine is shut down.
The following table shows which parameters are being monitored and form the three
inputs to the logic circuit.

The output, X, will have a value of 1 if any of the following combination of


conditions occur:
Either turbine speed <= 1000 rpm and bearing temperature > 80°C
Or turbine speed > 1000 rpm and wind velocity > 120 kph
Or bearing temperature <= 80°C and wind velocity > 120 kph
6

Ans : S1 AND ( P1 XOR P2)

0478/12/F/M/20
Create truth table and logic expression from logic circuits
Create truth table and logic expression from logic circuits
Logic Circuit
Create logic circuits from truth table
Steps :
1. Use only NOT,OR ,and AND Gates .
2. Circle only the rows that contain 1 in the output column see the example

3. In the example in row 2 (output is 1) : A=0 , B=1 --> use AND gate to give the
output 1, so both inputs must be 1 , A MUST BE INVERTED FROM 0->1 BY USING
NOT
so the expression for this row : NOT A AND B

4. Row 4 (output is 1) : use AND gate to give the output , since both inputs must
be 1 .
A and B are both 1
so the expression for this row : A AND B

5. To give all of the possible values for the output to be 1 are : row 1 OR row 4

The logic expression (statement ) is : (NOT A AND B ) OR (A AND B )


Logic Circuit
Create logic circuits from truth table
A B C X
0 0 0 0
0 0 1 1
0 1 0 0
0 1 1 1
1 0 0 0
1 0 1 1
1 1 0 0
1 1 1 1
Logic Circuit
Create logic circuits from truth table
A Boolean expression produces the following truth table.

Write the Boolean expression for the truth table by applying the sum-of-products.

You might also like