Topic 1.2.1 – Logic System Specification
Learning Objectives:
At the end of this topic you will be able to;
Translate a specification into a truth table.
Design and test a system, with up to 4 inputs from a specification.
1
Module ET1
Introduction to Analogue and Digital Systems.
Logic System Specification.
In the previous section we introduced the function of a number of logic gates that are available for us to use in electronic system design. In this section we will be developing the process needed to convert the design brief of a problem into a truth table. Before we can start we must have a problem that needs to be solved so let’s begin with something fairly simple to explain the process.
Problem 1:
A warning light is to be placed on a skip at night to warn any approaching drivers that there is a hazard in the road. The light should only operate in the dark and the light should be flashing.
Solution :
In any problem of this nature the first stage is to identify the type of inputs needed to convert external factors e.g. light or temperature into an electrical signal that can be processed to perform the function required in the design brief. In our problem two input systems are required, a light sensor and a pulse generator. In a real situation you would design the light sensor to give the output characteristics you would need for the system you have designed, however this will be covered more in Module ET2 – Electronic
Circuits and Components. In all problems in ET1 you will be given the characteristics of the light sensor to enable the system to be constructed so for now we will assume the following :
The light sensor produces a logic 1 in the dark, and Logic 0 in daylight.
The pulse generator will be producing a continuous series of on / off or
Logic 1 / Logic 0 pulses as soon as the power is switched on.
A simple block diagram of the system can now be constructed.
2
Topic 1.2.1 – Logic System Specification
Light
Sensor ( A )
Pulse
Logic
System
Warning
Lamp ( Q )
Generator ( B )
You will notice that the two inputs have now been given a letter so that we can identify them in a truth table. In this case there are only two inputs, and therefore there will be four possible combinations of
A
and
B
that we have to consider. The next stage is to construct a truth table to show all the possible input conditions and for each set of inputs determine when an output is required.
Input
B
Input
A
Output
Q
0
0
1
1
0
1
0
1
0
0
0
1
Comments
Light Sensor (
A
) = 0 = Daylight, Pulse
Generator (
B
) = 0 = Off, Output (
Q
) Off
Light Sensor (
A
) = 1 = Dark, Pulse
Generator (
B
) = 0 = Off, Output (
Q
) Off
Light Sensor (
A
) = 0 = Daylight, Pulse
Generator (
B
) = 1 = On, Output (
Q
) Off
Light Sensor (
A
) = 0 = Dark, Pulse
Generator (
B
) = 1 = On, Output (
Q
) On
A close examination of the Output column reveals that the truth table is that of a simple AND gate. i.e.
Q = A.B so the only logic gate we need is a single AND gate and our system diagram can now be redrawn as shown below.
Light
Sensor ( A )
A
B
Q Warning
Lamp ( Q )
Pulse
Generator ( B )
3
Module ET1
Introduction to Analogue and Digital Systems.
In this case the solution has worked out to be quite simple, however let us reconsider this problem again with a different specification for the Light sensor. What if this had been given as follows:
The light sensor produces a logic 0 in the dark, and Logic 1 in daylight.
In this scenario we would have to redefine our truth table, so lets do that now.
Input
B
Input
A
Output
Q
Comments
0
0
1
1
0
1
0
1
0
0
1
0
Light Sensor (
A
) = 0 = Dark, Pulse
Generator (
B
) = 0 = Off, Output (
Q
) Off
Light Sensor (
A
) = 1 = Daylight, Pulse
Generator (
B
) = 0 = Off, Output (
Q
) Off
Light Sensor (
A
) = 0 = Dark, Pulse
Generator (
B
) = 1 = On, Output (
Q
) On
Light Sensor (
A
) = 0 = Daylight, Pulse
Generator (
B
) = 1 = On, Output (
Q
) Off
Careful consideration of the Output Column now reveals that it is no longer the output of a simple logic gate. The output is on when
A
is a Logic 0 and
B
is a Logic 1. In Boolean terms we would write this as
Q
A .
B
.
Our system diagram will now have changed slightly to incorporate the changes determined above so that we now have:
Light
Sensor ( A )
A A
A
B
Q Warning
Lamp ( Q )
Pulse
Generator ( B )
Now let us increase the complexity of the system a little bit.
4
Topic 1.2.1 – Logic System Specification
Problem 2:
A market gardener wants to install an automatic watering system for his green houses to ensure that his prizewinning plants do not suffer from a lack of water. The system however, must have some safeguards whereby plants should only be watered in daylight, when the soil is dry and the door to the greenhouse is closed.
The following sensors are available:
A moisture sensor (
A
) which outputs a Logic 0 when dry, and Logic 1 when wet.
A light sensor (
B
) which outputs a Logic 1 in daylight, and Logic 0 at night.
A door switch (
C
) which outputs a Logic 0 when closed and Logic 1 when open.
An overview of the system is therefore as shown below:
Moisture
Sensor ( A )
Light Sensor
( B )
Logic
System
Water
On ( Q )
Door Sensor
( C )
The next stage is to construct a truth table for this system, as shown on the next page.
5
Module ET1
Introduction to Analogue and Digital Systems.
Input
C
Input
B
Input
A
Output
Q
Comments
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
0
0
1
0
0
0
0
0
Moisture Sensor (
A
) = 0 = Dry,
Light Sensor (
B
) = 0 = Night,
Door Sensor (
C
) = 0 = Closed,
Output (
Q
) = Off
Moisture Sensor (
A
) = 1 = Wet,
Light Sensor (
B
) = 0 = Night,
Door Sensor (
C
) = 0 = Closed,
Output (
Q
) = Off
Moisture Sensor (
A
) = 0 = Dry,
Light Sensor (
B
) = 1 = Daylight,
Door Sensor (
C
) = 0 = Closed,
Output (
Q
) = On
Moisture Sensor (
A
) = 1 = Wet,
Light Sensor (
B
) = 1 = Daylight,
Door Sensor (
C
) = 0 = Closed,
Output (
Q
) = Off
Moisture Sensor (
A
) = 0 = Dry,
Light Sensor (
B
) = 0 = Night,
Door Sensor (
C
) = 1 = Open,
Output (
Q
) = Off
Moisture Sensor (
A
) = 1 = Wet,
Light Sensor (
B
) = 0 = Night,
Door Sensor (
C
) = 1 = Open,
Output (
Q
) = Off
Moisture Sensor (
A
) = 0 = Dry,
Light Sensor (
B
) = 1 = Daylight,
Door Sensor (
C
) = 1 = Open,
Output (
Q
) = Off
Moisture Sensor (
A
) = 1 = Wet,
Light Sensor (
B
) = 1 = Daylight,
Door Sensor (
C
) = 1 = Open,
Output (
Q
) = Off
Careful study of the truth table shows that the output must come on when
A
is Logic 0, AND
B
is Logic 1 AND
C
is Logic 0 or in Boolean Algebra terms this can be written as :
Q
A .
B .
C
.
The complete system diagram therefore now becomes the following:
6
Topic 1.2.1 – Logic System Specification
Moisture
Sensor ( A )
Light Sensor
( B )
Water
On ( Q )
Door Sensor
( C )
An alternative design that does the same thing can be formed if only two input AND gates are available, by combining two such units together as shown below:
Moisture
Sensor ( A )
Light Sensor
( B )
Water
On ( Q )
Door Sensor
( C )
Spend a few minutes convincing yourself that these two designs are indeed the same.
Now it’s time for you to have a go.
7
Module ET1
Introduction to Analogue and Digital Systems.
Design Problem 3.
An expensive painting in an art gallery is protected by a modest security system. The picture is protected by a pressure switch which is normally closed when the picture is in place, but opens if the picture is removed from the wall. Design a system to sound the alarm if the picture is removed from the wall only when the gallery is closed at night.
The specification for the available sensors are as follows:
Picture Pressure sensor (
A
) which outputs a Logic 0 when picture is in place, and Logic 1 when the picture is removed.
A light sensor (
B
) which outputs a Logic 0 during the day, and Logic 1 at night.
A door switch (
C
) which outputs a Logic 0 when locked and Logic 1 when unlocked.
Complete the following system diagram:
Now complete the truth table opposite.
8
Topic 1.2.1 – Logic System Specification
Input
C
Input
B
Input
A
Output
Q
Comments
0
0
0
0
1
1
1
1
0
0
1
1
0
0
1
1
0
1
0
1
0
1
0
1
Pressure Sensor (
A
) = 0 = Picture Present,
Light Sensor (
B
) = 0 = Daytime,
Door Sensor (
C
) = 0 = Locked,
Output (
Q
) = ______
Pressure Sensor (
A
) = 1 = Picture Missing,
Light Sensor (
B
) = 0 = Daytime,
Door Sensor (
C
) = 0 = Locked,
Output (
Q
) = ______
Pressure Sensor (
A
) = 0 = Picture Present,
Light Sensor (
B
) = 1 = Night-time,
Door Sensor (
C
) = 0 = Locked,
Output (
Q
) = ______
Pressure Sensor (
A
) = 1 = Picture Missing,
Light Sensor (
B
) = 1 = Night-time,
Door Sensor (
C
) = 0 = Locked,
Output (
Q
) = ______
Pressure Sensor (
A
) = 0 = Picture Present,
Light Sensor (
B
) = 0 = Daytime,
Door Sensor (
C
) = 1 = Un-locked,
Output (
Q
) = ______
Pressure Sensor (
A
) = 1 = Picture Missing,
Light Sensor (
B
) = 0 = Daytime,
Door Sensor (
C
) = 1 = Un-locked,
Output (
Q
) = ______
Pressure Sensor (
A
) = 0 = Picture Present,
Light Sensor (
B
) = 1 = Night-time,
Door Sensor (
C
) = 1 = Un-locked,
Output (
Q
) = ______
Pressure Sensor (
A
) = 1 = Picture Missing,
Light Sensor (
B
) = 1 = Night-time,
Door Sensor (
C
) = 1 = Un-locked,
Output (
Q
) = ______
Write down the conditions needed to sound the alarm:
……………………………………………………………………………………………………………………………………………
……………………………………………………………………………………………………………………………………………
……………………………………………………………………………………………………………………………………………
Boolean Equation : ………………………………………
9
Module ET1
Introduction to Analogue and Digital Systems.
Now draw a suitable arrangement of logic gates to meet the needs of your system.
If we reconsider the specification for the alarm that you have just designed, you should have realised that it is a pretty poor design for an alarm, since if someone walked in during the day and removed the picture from the wall no alarm would sound.
This is clearly an unacceptable position and a better system would sound the alarm every time the picture was removed from the wall. The owner of the gallery was not happy with this suggestion as once a week the picture was removed for cleaning, and the alarm should not sound during this period. The owner stated that when cleaning was taking place, the gallery was closed, and only took place during daytime hours.
The modified truth table opposite shows the modifications needed to meet the demands of this enhanced alarm system.
Check through the table carefully to see if you agree !
10
Topic 1.2.1 – Logic System Specification
Input
0
0
0
0
1
1
C
Input
0
0
1
1
0
0
B
Input
0
1
0
1
0
1
A
Output
0
0
0
1
0
1
Q
Comments
Pressure Sensor (
A
) = 0 = Picture Present,
Light Sensor (
B
) = 0 = Daytime,
Door Sensor (
C
) = 0 = Locked,
Output (
Q
) = Off
Pressure Sensor (
A
) = 1 = Picture Missing,
Light Sensor (
B
) = 0 = Daytime,
Door Sensor (
C
) = 0 = Locked,
Output (
Q
) = Off (Cleaning in progress)
Pressure Sensor (
A
) = 0 = Picture Present,
Light Sensor (
B
) = 1 = Night-time,
Door Sensor (
C
) = 0 = Locked,
Output (
Q
) = Off
Pressure Sensor (
A
) = 1 = Picture Missing,
Light Sensor (
B
) = 1 = Night-time,
Door Sensor (
C
) = 0 = Locked,
Output (
Q
) = On
Pressure Sensor (
A
) = 0 = Picture Present,
Light Sensor (
B
) = 0 = Daytime,
Door Sensor (
C
) = 1 = Un-locked,
Output (
Q
) = Off
Pressure Sensor (
A
) = 1 = Picture Missing,
Light Sensor (
B
) = 0 = Daytime,
Door Sensor (
C
) = 1 = Un-locked,
Output (
Q
) = On
1
1
1
1
0
1
0
1
Now there are three possible conditions that cause the alarm to sound: i.
A
on AND
B
on AND
C
off OR
Pressure Sensor (
A
) = 0 = Picture Present,
Light Sensor (
B
) = 1 = Night-time,
Door Sensor (
C
) = 1 = Un-locked,
Output (
Q
) = Off
Pressure Sensor (
A
) = 1 = Picture Missing,
Light Sensor (
B
) = 1 = Night-time,
Door Sensor (
C
) = 1 = Un-locked,
Output (
Q
) = On ii.
A
on AND
B
off AND
C
on OR iii.
A
on AND
B
on AND
C
on.
In Boolean terms this would be written as:
Q
A .
B .
C
A .
B .
C
A .
B .
C
This does however make the logic diagram for the alarm much more complicated as shown on the following page.
11
Pressure
Sensor ( A )
Module ET1
Introduction to Analogue and Digital Systems.
Light Sensor
( B )
Door Sensor
( C )
Alarm
On ( Q )
This is quite a complex system for what is essentially quite a straight forward system. Imagine what this would look like if only two input gates were available! It would appear that system design is going to become very complicated – surely there must be an easier way ?
Well you will be pleased to know that there are some additional techniques we can use to make our designs a little bit more straight forward
Indeed this system that we have just designed can be reduced to the system shown opposite.
12
Topic 1.2.1 – Logic System Specification
Pressure
Sensor ( A )
Light
Sensor ( B )
Door
Sensor ( C )
Alarm
On ( Q )
Complete the truth table below and compare it with the one on page 11.
Input
C
Input
B
Input
A
Output
Q
0 0 0
0
1
0
0
0
1
1
0
1
0
1
0
1
1
0
1
1
0
1 1 1
All we need do now is find out how this dramatic simplification can take place, as this design is significantly easier to build than the original.
13
Module ET1
Introduction to Analogue and Digital Systems.
We will stop looking at system design for the moment even though we have not considered 4 input systems as suggested in the learning objectives, because these would inevitably lead to very complex designs if we used the techniques introduced so far in this section.
Before considering such large systems we must have the tools required to simplify our design after working out the conditions needed for an output to operate from the system specification.
Our next topic of work – 1.2.2 – Boolean Algebra will provide us with a set of rules we can use to simplify the logic system.
System design will temporarily be put on hold while we learn the simplification techniques of Boolean Algebra – Good Luck!
14
Topic 1.2.1 – Logic System Specification
Self Evaluation Review
Learning Objectives
My personal review of these objectives:
Translate a specification into a truth table.
Design and test a system, with up to
4 inputs from a specification.
Targets: 1. ………………………………………………………………………………………………………………
………………………………………………………………………………………………………………
2.
………………………………………………………………………………………………………………
………………………………………………………………………………………………………………
15