55
© WJEC 2017 Combinational logic systems Learners should be able to: (a) recognise 1/0 as two-state logic levels (b) identify and use NOT gates and 2-input AND, OR, NAND and NOR gates, singly and in combination (c) produce a suitable truth table from a given system specification and for a given logic circuit (d) use truth tables to analyse a system of gates (e) use Boolean algebra to represent the output of truth tables or logic gates and use the basic Boolean identities A.B = A+B and A+B = A.B (f) design processing systems consisting of logic gates to solve problems (g) simplify logic circuits using NAND gate redundancy (h) analyse and design systems from a given truth table to solve a given problem (i) use data sheets to select a logic IC for given applications and to identify pin connections (j) design and use switches and pull-up or pull-down resistors to provide correct logic level/edge-triggered signals for logic gates and timing circuits Chapter 6 - Combinational logic systems 180 GCSE Electronics – Component 1: Discovering Electronics

Combinational logic systems - Amazon Web Servicesresource.download.wjec.co.uk.s3.amazonaws.com/vtc/2… ·  · 2017-08-03Combinational logic systems ... combination (c) produce a

  • Upload
    lydiep

  • View
    218

  • Download
    0

Embed Size (px)

Citation preview

© WJEC 2017

Combinational logic systems

Learners should be able to:

(a) recognise 1/0 as two-state logic levels

(b) identify and use NOT gates and 2-input AND, OR, NAND and NOR gates, singly and in combination

(c) produceasuitabletruthtablefromagivensystemspecificationandforagivenlogiccircuit

(d) use truth tables to analyse a system of gates

(e) use Boolean algebra to represent the output of truth tables or logic gates and use the

basic Boolean identities A.B = A+B and A+B = A.B

(f) design processing systems consisting of logic gates to solve problems

(g) simplify logic circuits using NAND gate redundancy

(h) analyse and design systems from a given truth table to solve a given problem

(i) use data sheets to select a logic IC for given applications and to identify pin connections

(j) design and use switches and pull-up or pull-down resistors to provide correct logic level/edge-triggered signals for logic gates and timing circuits

Chapter 6 - Combinational logic systems

180

GCSE Electronics – Component 1: Discovering Electronics

© WJEC 2017

Introduction

In this chapter we will be concentrating on the basics of digital logic circuits which will then be extended in Component 2. We should start by ensuring that you understand the difference between a digital signal and an analogue signal.

An analogue signal

This is a signal that can have any value between the zero and maximum of the power supply. Changes between values can occur slowly or rapidly depending on the system involved.

A digital signal

This is a signal that can only have two finite values, usually at zero and maximum of the power supply. Changes between these two values occur instantaneously.

For this part of the course we will concentrate on digital systems.

Recap of work covered in Chapter 1

When an input or output signal is at the minimum power supply voltage (usually 0 V) this is referred to as a LOW signal or LOGIC 0 signal.

When an input or output signal is at the maximum power supply voltage this is referred to as a HIGH signal or LOGIC 1 signal.

Remember then that a digital signal is a two-state system with input and output signals being either referred to as high/low, 0/1, on/off depending on the application.

The behaviour of a logic gate is summarised in a table, called a ‘truth table’We will now look at the basic building blocks of all digital systems, logic gates and their associated truth tables.

Voltage (V)

time (s)

Max

Min

Voltage (V)

time (s)

Max

Min

0 V

0 V

Chapter 6 - Combinational logic systems

181

GCSE Electronics – Component 1: Discovering Electronics

© WJEC 2017

Truth Tables

The behaviour of a logic gate is summarised in a table, called a truth table. In this course we will only consider the truth tables for logic gates with up to two inputs.

Here is a summary of the three logic gates you have already studied:

GATE SYMBOL TRUTH TABLE FUNCTION

NOT(INVERTER)

Signal out of gate is the opposite of the signal in, i.e. it inverts the input signal

AND

The output Q is only at a logic 1 when input A AND input B are at a logic 1

OR

The output Q is at a logic 1 when input A OR input B OR both are at a logic 1

Input Output A Q 0 1

1 0

Inputs Output B A Q 0 0 0

0 1 0

1 0 0

1 1 1

Inputs Output B A Q

0 0 0

0 1 1

1 0 1

1 1 1

GCSE Electronics – Component 1: Discovering ElectronicsChapter 6 - Combinational logic systems

182

© WJEC 2017

We will now look at two additional logic gates:

• The NAND gate

The symbol for a 2-input NAND gate is:

The truth table for the 2-input NAND gate is shown below.

If you compare this truth table with that for the AND gate, you will find that the output Q is the exact opposite of the AND gate output.

• The NOR gate

The symbol for a 2-input NOR gate is:

The truth table for the 2-input NOR gate is shown below.

If you compare this truth table with that for the OR gate, you will find that the output Q is the exact opposite of the OR gate output.

Inputs Output B A Q 0 0 1 0 1 1 1 0 1 1 1 0

Inputs Output B A Q 0 0 1

0 1 0

1 0 0

1 1 0

Chapter 6 - Combinational logic systems

183

GCSE Electronics – Component 1: Discovering Electronics

© WJEC 2017

Practical Logic Gates

Logic gates are available within an integrated circuit (IC) – a set of electronic circuits built on the same wafer of semiconductor material. These logic ICs are usually supplied in plastic DIL (dual in line) packages containing several logic gates of the same type.

The diagram shows one of these logic IC packages.

There are two common types of package available, known as TTL or 7400 series and CMOS or 4000 series.

Examination questions will only test CMOS devices. However, you may choose to use TTL devices for your project work.

The data sheet for a logic gate package includes the pinout diagram showing how the pins connect to the logic gates inside it.

The pinout diagrams below relate to ICs known as quad 2-input AND gates. The TTL AND gate is referred to as a ‘7408’ whilst the CMOS version is referred to as a ‘4081B’.

Using the right pinout is important, as incorrect connections can damage the whole package.

We will look at some more pinout diagrams later on.

CMOS AND gateTTL AND gate

Pin 1 identification

GCSE Electronics – Component 1: Discovering ElectronicsChapter 6 - Combinational logic systems

184

© WJEC 2017

Analysis of Simple Logic Circuits

You will need to recognise truth tables for the five basic gates individually and in simple combinations. You will also need to be able to complete a truth table for a larger system.

We will now consider a couple of examples of these systems.

Example 1:Study the following logic system carefully and then complete the truth table that follows:

In this problem, the output of the NOT gate has been labelled C. The first stage is to complete the output column for C which is the NOT of A as shown below.

Now we need to complete the final column Q which is the output of the AND gate with B and C as the inputs.

Do not fall into the trap of writing the answer to the Q column in the order you would normally do for the truth table for an AND gate. Because in this case the inputs to the AND gate are not in the same order as that given in the ‘standard’ AND gate truth table provided earlier.

Inputs Outputs B A C Q 0 0 0 1 1 0 1 1

Inputs Outputs B A C Q 0 0 1 0 1 0 1 0 1 1 1 0

Inputs Outputs B A C Q 0 0 1 0 0 1 0 0 1 0 1 1 1 1 0 0

Chapter 6 - Combinational logic systems

185

GCSE Electronics – Component 1: Discovering Electronics

© WJEC 2017

Example 2:Study the following logic system carefully and then complete the truth table that follows:

You can see that the truth table for a 3-input logic system contains eight possible input combinations. Notice the way the logic state of each input changes as you move down the table. First check the output column for the NOT gate (Column F) – {The input is B.}Then check the output column for the AND gate (Column G) – {The inputs are F and C.}Finally check the final output from the NOR gate (Column Q) – {The inputs are A and G.}

Inputs Outputs C B A F G Q 0 0 0 1 0 1 0 0 1 1 0 0 0 1 0 0 0 1 0 1 1 0 0 0 1 0 0 1 1 0 1 0 1 1 1 0 1 1 0 0 0 1 1 1 1 0 0 0

GCSE Electronics – Component 1: Discovering ElectronicsChapter 6 - Combinational logic systems

186

© WJEC 2017

Investigation 6.1

You will need to use a simulation program such as ‘Circuit Wizard’ or ‘Yenka Technology’ to complete this investigation.

Note: You can use the ’built-in‘ inputs and outputs that are available in these simulation programs. The input switches and logic indicator turn red to indicate logic 1.The circuit being tested would look something like this diagram:

Set up each of the logic systems using your simulation program and use the program to complete the truth table for each system:

1.

2.

Inputs Output B A Q 0 0 0 1 1 0 1 1

Inputs Output

C B A Q 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1

Chapter 6 - Combinational logic systems

187

GCSE Electronics – Component 1: Discovering Electronics

© WJEC 2017

Exercise 6.1

1. Look at the following logic symbols labelled A–E.

A B C D E

a) Which is the correct symbol for an AND gate. ……………

b) Which is the correct symbol for a NOT gate. ……………

c) Which is the correct symbol for a NOR gate. ……………

d) Which is the correct symbol for a NAND gate. ……………

e) Which is the correct symbol for an OR gate. ……………

2. Complete the following truth tables. a) AND gate. b) NOR gate.

c) NAND gate. d) OR gate

Inputs Output B A Q 0 0 0 1 1 0 1 1

Inputs Output B A Q 0 0 0 1 1 0 1 1

Inputs Output B A Q 0 0 0 1 1 0 1 1

Inputs Output B A Q 0 0 0 1 1 0 1 1

GCSE Electronics – Component 1: Discovering ElectronicsChapter 6 - Combinational logic systems

188

© WJEC 2017

3. Study the following logic system carefully and then complete the truth table that follows:

4. Study the following logic system carefully and then complete the truth table that follows:

Inputs Outputs B A K Q 0 0 0 1 1 0 1 1

Inputs Outputs C B A F G Q 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1

Chapter 6 - Combinational logic systems

189

GCSE Electronics – Component 1: Discovering Electronics

© WJEC 2017

5. Study the following logic system carefully and then complete the truth table that follows:

Inputs Outputs C B A D E F G Q 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1

GCSE Electronics – Component 1: Discovering ElectronicsChapter 6 - Combinational logic systems

190

© WJEC 2017

Pull-Up / Pull-Down Resistors

Up until now we have shown the input connections to a logic gate either with:

labelled input terminals or connected to a logic input

These diagrams are called schematic circuit diagrams and help us to concentrate on what is happening to the logic signals within the logic circuit without worrying too much how the inputs are wired up.

If we want to build a logic circuit we have to provide the logic gate with a suitable input sub-system to provide the correct logic levels.

The input to a logic gate can come from a number of different sources, but for the purposes of this unit we are going to concentrate on mechanical switches.

Whichever type of switch we use, they have to be used along with a series resistor as part of a voltage divider circuit.

We have to be careful which way around the resistor and switch are connected in the voltage divider circuit to produce either a logic 0 signal or a logic 1 signal when the switch is pressed.

Two input sub-system circuits using a push-to-make switch are shown below.

Signal at point X is at logic 0 when switch is pressed

Signal at point Y is at logic 1 when switch is pressed

The resistor used in Circuit A is called a pull-up resistor and the resistor used in Circuit B is called a pull-down resistor. This is because of their behavior in the circuit, either ‘pulling up’ the voltage at the input to logic 1 or ‘pulling down’ the voltage to logic 0 when the switch is not pressed.

Chapter 6 - Combinational logic systems

191

GCSE Electronics – Component 1: Discovering Electronics

© WJEC 2017

In Circuit A, before the switch is pressed, there is no connection to the 0 V line, and the input to the logic gate is ‘pulled up’ to 5 V, giving a logic 1 input to the logic system. When the switch is operated, the input to the logic system is connected to the 0 V line through the switch and the logic level falls to logic 0.

In Circuit B, before the switch is pressed, there is no connection to the 5 V line, and the input to the logic gate is ‘pulled down’ to 0 V, giving logic 0 input to the logic system. When the switch is operated, the input to the logic system is connected to the 5 V line through the switch, changing the logic level to logic 1.

In summary:

• Circuit A outputs a logic 0 signal until the switch is pressed. It then outputs logic 1.• Circuit B outputs a logic 1 signal until the switch is pressed. It then outputs logic 0.

Use of data sheetsThe data sheet for a particular logic gate package shows how the pins are connected to the logic gates inside it. When doing practical work you will need to use data sheets to examine the pinout diagrams for different logic gates. You could also be asked to identify certain pins on a pinout diagram.

Logic gates are available with up to eight inputs per gate, and the following diagrams show the pinouts for a selection of CMOS 4000 series ICs:

GCSE Electronics – Component 1: Discovering ElectronicsChapter 6 - Combinational logic systems

192

© WJEC 2017

Here are some of the more common pinout diagrams for 7400 Series TTL logic gates. Although you will not consider them in this course you might use TTL logic gates in your project.

Chapter 6 - Combinational logic systems

193

GCSE Electronics – Component 1: Discovering Electronics

© WJEC 2017

Investigation 6.2

You can set up the circuits in this investigation either on a simulation program or breadboard.

1. Set up the following circuits and use a logic probe to complete the tables below by inserting ‘high’ or ‘low’ for each state of the switches.

2. Set up this circuit and press switches A and B in the order shown in the truth table. Record the results and complete the truth table. If the LED is on, the output is high. If the LED is off, the output is low.

Note: If you are setting this circuit up on Circuit Wizard ensure the voltage setting for the logic gates is set to the same voltage as the power supply. Go to Project → Simulation → Power supply and check the voltage setting.

Switch SW1 Output A

Open

Closed

Switch SW1 Output A

Open

Closed

Inputs Output B A Q 0 0 0 1 1 0 1 1

GCSE Electronics – Component 1: Discovering ElectronicsChapter 6 - Combinational logic systems

194

© WJEC 2017

Exercise 6.2

1. The pinout diagram for a logic IC is shown below.

a) How many logic gates are contained in this IC? b) How many inputs does each gate have? c) Give the number of the pin connected to the output of gate G? d) Which two pins should be connected to the power supply? e) What is the name given to the type of logic gate contained in this IC? Choose from the following list:

AND OR NOT NAND NOR

Answer:

2. Study the circuits below and complete the statements that follow:

a) In circuit C with the switch open, the input to the logic system is at logic

b) In circuit C with the switch closed, the input to the logic system is at logic

c) In circuit D with the switch open, the input to the logic system is at logic

d) In circuit D with the switch closed, the input to the logic system is at logic

G

Chapter 6 - Combinational logic systems

195

GCSE Electronics – Component 1: Discovering Electronics

© WJEC 2017

3. These questions require the CMOS data sheets provided earlier.

a) What type of logic gate is contained in the 4011 package? b) How many inputs do the logic gates in the 4072 package have? c) How many logic gates are there in the 4002 package? d) Which 2 packages have some pins that are not connected to anything? e) What pin number is the positive supply for a 4081 package? f) What pin number(s) are the inputs of the logic gate, whose output is connected to pin 13 of the 4072 package?

4. Study the circuit below and complete the statements that follow:

a) Resistor R1 is a pull resistor and R2 is a pull resistor.

b) When switch SW2 is pressed input B is at logic

c) When both switches are pressed output Q is at logic

GCSE Electronics – Component 1: Discovering ElectronicsChapter 6 - Combinational logic systems

196

© WJEC 2017

Converting a Truth Table into a Logic Diagram

In the previous section we looked at how a system of logic gates could be used to complete a truth table to illustrate the conditions needed for the output to produce a logic 1. We will now consider how we can reverse this process and construct a logic circuit diagram from a truth table. This is best done by looking at a couple of examples.

Note: In the following examples the outputs have been chosen so that they are not the standard outputs of one of the five logic gates considered previously.

Example 1:

The truth table for a logic system is:

We first have to identify all the combinations of the inputs that produce a logic1 at the output. In this case it only occurs once, when input A is on and input B is not on.

The description of what is required to cause the output to operate gives a very good clue as to the logic gates required in this example. In this case two logic gates are required, a NOT gate and an AND gate.

The NOT gate is used to invert the B input, as shown below.

The output of this NOT gate is then connected to the AND gate with input A to provide the full solution, as follows:

Quick ruleIn any 2-input logic system, for every row of the truth table for which the output is logic 1, this output can be written in terms of the following input conditions: A, NOT A, B, NOT B depending whether there is a 0 or a 1 in that input cell. The two inputs are linked with an AND.

Inputs Output B A Q 0 0 0 0 1 1 1 0 0 1 1 0

Chapter 6 - Combinational logic systems

197

GCSE Electronics – Component 1: Discovering Electronics

© WJEC 2017

Going back to our example we identify the output row where Q is a logic 1 and note that A = 1 and B = 0. Because B is 0 we write it down as NOT B as shown:

This gives the same answer as the longer method.

Example 2:

The following truth table represents a particular logic function. Use the information in the table to draw a corresponding logic gate system that will produce this function.

We first have to identify all the combinations of the inputs that cause the output to be logic 1. In this case it occurs in two rows of the truth table.

We then label these outputs as explained above in the ‘Quick Rule’.

The output required for the first line ofthe truth table is:

and the output required for the last line of the truth table is:

Inputs Output B A Q 0 0 0 0 1 1 ← 1 0 0 1 1 0

Output Q = A AND NOT B

Inputs Output B A Q 0 0 1

0 1 0

1 0 0

1 1 1

Inputs Output B A Q 0 0 1 ←

0 1 0

1 0 0

1 1 1 ←

Output = NOT A AND NOT B

Output = A AND B

GCSE Electronics – Component 1: Discovering ElectronicsChapter 6 - Combinational logic systems

198

© WJEC 2017

There are two separate parts to the logic system providing the output Q. We need to link the two parts together so that either one part OR the other part produce the output Q. This is done by connecting the output of each part to an OR gate input as shown below:

We have some duplicated input terminals, so the circuit diagram can be simplified by linking these together as shown below.

Or in words, Q = [NOT A AND NOT B] OR [A AND B]

Converting a truth table with three inputs

The method shown above can be extended to cover 3-input truth tables as shown below:

Combining these two outputs gives:

Q = (A AND NOT B AND NOT C) OR (A AND NOT B AND C)

The logic diagram for this system would require 3-input AND gates which are not covered in this course.

Inputs Output C B A Q 0 0 0 0 0 0 1 1 ← 0 1 0 0 0 1 1 0 1 0 0 0 1 0 1 1 ← 1 1 0 0 1 1 1 0

Output = A AND NOT B AND NOT C

Output = A AND NOT B AND C

Chapter 6 - Combinational logic systems

199

GCSE Electronics – Component 1: Discovering Electronics

© WJEC 2017

Truth tables with multiple outputs

Quite often a logic system will have more than one output. For example a set of traffic lights might have three outputs.

For this type of system we can follow a simple set of rules.

For each output column of the truth table ask yourself the following questions in the order listed below

1. Is the output column pattern the same as one of the input column patterns?

If the answer is yes, then Q = ‘The Input‘ (e.g. Q = B)

2. Is the output column pattern the inverse of the input column pattern?

If the answer is yes, then Q = NOT ‘The Input’ (e.g. Q = NOT C)

3. Is the output column pattern the same as a logic gate output?

If the answer is yes, then Q = ‘logic gate expression’ (e.g. Q = A OR B)

4. Is the output column pattern the inverse of one of the other output patterns already identified?

If the answer is yes, then Q = NOT ‘Other Output’ (e.g. Q3 = NOT Q1)

5. If the answer is no, all four questions then use the ‘Quick rule’ by labelling rows of the outputs which are logic 1 and link with an OR gate.

e.g. Q = [NOT A AND NOT B] OR [A AND B]

GCSE Electronics – Component 1: Discovering ElectronicsChapter 6 - Combinational logic systems

200

© WJEC 2017

Example:

The following truth table shows the outputs required for three LEDs used to represent the operation of a set of traffic lights. Determine the combination of logic gates required to produce the output pattern shown.

Here we have three separate outputs to be produced by just two inputs. To solve this we just treat each individual output as a separate problem.

If you examine the input B column and Red output column carefully what do you notice? They are reproduced below with these columns highlighted.

Comparing the two highlighted columns we can see that the Red output is the exact opposite of the B input column. This means that if we simply invert the input B signal, this will produce the Red output.

i.e. Red = NOT B

Now for the Yellow output. Once again check the truth table carefully.The solution is that the Yellow output follows the A input exactly, and therefore to produce the Yellow output no logic gates are required. It is simply a case of connecting the Yellow output to the A input.

i.e. Yellow = A

Here is the solution for the Yellow output:

Inputs Outputs B A Red Yellow Green 0 0 1 0 0 0 1 1 1 0 1 0 0 0 1 1 1 0 1 0

Inputs Outputs B A Red Yellow Green 0 0 1 0 0 0 1 1 1 0 1 0 0 0 1 1 1 0 1 0

Chapter 6 - Combinational logic systems

201

GCSE Electronics – Component 1: Discovering Electronics

© WJEC 2017

Finally we have to consider the Green output. A check of the truth table shows there is no simple relationship to the inputs as was the case with the Red and Yellow outputs. Neither does the output correspond to the output of a logic gate. We have no choice therefore other than to use the ‘Quick rule’ to solve this part of the problem. You should be able to produce the system as shown below.

This gives;

If we connect all three sections together the final system design will look like this:

Note: If we were very observant we could have noticed that the Green output can be obtained from a NOR gate connected to the Red and Yellow outputs.

i.e. Green = Red NOR Yellow

Inputs Outputs B A Red Yellow Green 0 0 1 0 0

0 1 1 1 0

1 0 0 0 1 ← Green = NOT A AND B

1 1 0 1 0

Inputs Outputs B A Red Yellow Green 0 0 1 0 0 0 1 1 1 0 1 0 0 0 1 1 1 0 1 0

GCSE Electronics – Component 1: Discovering ElectronicsChapter 6 - Combinational logic systems

202

© WJEC 2017

The final system would then become:

Both of these solutions are equally valid.

In the next investigation you will be asked to confirm that both solutions produce the correct output pattern.

Chapter 6 - Combinational logic systems

203

GCSE Electronics – Component 1: Discovering Electronics

© WJEC 2017

Investigation 6.3

1. Set up the following traffic light system using your simulation program.

Complete the truth table for the traffic light sequence and compare you results with the truth table given in the previous example

Is the:

Red sequence correct …….

Yellow sequence correct …….

Green sequence correct …….

2. Repeat the investigation for the alternative solution provided in the example. Pull-down resistors and LED indicators have been included so the circuit can be built on breadboard.

Is the:

red sequence correct? …….

yellow sequence correct? …….

green sequence correct? …….

Inputs Outputs B A Red Yellow Green 0 0 0 1 1 0 1 1

Inputs Outputs B A Red Yellow Green 0 0 0 1 1 0 1 1

GCSE Electronics – Component 1: Discovering ElectronicsChapter 6 - Combinational logic systems

204

© WJEC 2017

Exercise 6.3

1. The following truth table represents a particular logic function. Use the information in the table to draw a corresponding logic gate system that will produce this function.

2. The following truth table represents a particular logic function. Use the information in the table to draw a corresponding logic gate system that will produce this function.

Inputs Output B A Q 0 0 0 0 1 1 1 0 0 1 1 0

Inputs Output B A Q 0 0 0 0 1 1 1 0 1 1 1 0

Chapter 6 - Combinational logic systems

205

GCSE Electronics – Component 1: Discovering Electronics

© WJEC 2017

3. An electronic system has two input sensors A and B, and three outputs P, Q and R. The truth table showing how the input sensors control the outputs is shown below.

a) Study the P output. It is the inverse of one of the inputs.

Write down an expression to describe this output. P = ...................................................................................

b) Study the Q output. There is one type of logic gate that will provide this.

What is the name of this gate? ............................................................. c) Study the R output. There is one type of logic gate that will provide this.

What is the name of this gate? .............................................................

d) You have a selection of AND, OR, NOT, NAND and NOR gates available. Draw a labelled diagram to show how the logic system can be made.

Inputs Outputs B A P Q R 0 0 1 0 1 0 1 0 0 0 1 0 1 0 0 1 1 0 1 0

GCSE Electronics – Component 1: Discovering ElectronicsChapter 6 - Combinational logic systems

206

© WJEC 2017

4. The following truth table shows the outputs required for three LEDs used to represent the operation of a set of traffic lights. Determine the combination of logic gates required to produce the outputs required. Draw a labelled diagram to show how the logic system can be made.

Inputs Outputs B A Red Yellow Green 0 0 0 1 0 0 1 0 0 1 1 0 1 1 0 1 1 1 0 0

Chapter 6 - Combinational logic systems

207

GCSE Electronics – Component 1: Discovering Electronics

© WJEC 2017

Boolean Notation

There is a shorthand way of writing down the function of logic gates, using a special type of algebra called Boolean algebra. This is used extensively for advanced work in digital electronics.

We shall briefly consider how to express the output of a truth table and logic gates in Boolean notation. We will start by looking at the five basic gates introduced previously.

There are three basic things to remember:

1. A dot ‘.’ between two input labels is read as ‘AND’.2. A plus ‘+’ between two input labels is read as ‘OR’.3. A bar ‘ ’ over the top of an input label is read as ‘NOT’.

Gate Symbol Boolean Notation

NOT Q = A read as Q = NOT A

AND Q = A.B read as Q = A AND B

OR Q = A + B read as Q = A OR B

NAND Q = A.B read as Q = A NAND B

NOR Q = A + B read as Q = A NOR B

In addition to the five Boolean notations shown above, each line of a truth table for which the output is a ‘1’ can also be written in Boolean notation

GCSE Electronics – Component 1: Discovering ElectronicsChapter 6 - Combinational logic systems

208

© WJEC 2017

Consider the solution to Example 2 on page 198:

Using Boolean notation the outputs can be labelled as follows:

Remember that these expressions need to be linked together with an OR to produce the output Q, so the full Boolean expression for Q can be written as:

Q = (A AND B) OR (A AND B)Q = (A.B) + (A.B)

We can extend this idea to larger systems with more inputs; the process is the same:

• Identify each line in the table that has logic 1 output.• Write down the combination of inputs that produce this output in Boolean notation.• Link together with an OR to produce the output Q.

Inputs Output B A Q 0 0 1 ←

0 1 0

1 0 0

1 1 1 ←

Output = NOT A AND NOT B

Output = A AND B

Inputs Output B A Q 0 0 1 ← 0 1 0

1 0 0

1 1 1 ←

Output = A AND B

Output = A AND B

Chapter 6 - Combinational logic systems

209

GCSE Electronics – Component 1: Discovering Electronics

© WJEC 2017

For example, in this table there are four combinations of inputs that will produce an output at Q. In order to write down the Boolean equation for the whole system, we first have to write down the Boolean equation for each line in the truth table where the output is a 1. All input variables (three in this case) must be included in each Boolean equation on each of these lines, as shown below:

To obtain the Boolean equation for the whole system we simply take each of these terms and ‘OR’ them together:

Q = A.B.C + A.B.C + A.B.C + A.B.C

The logic diagram for this system would require 3-input AND gates and OR gates. These are not covered in this course, but you are required to be able to produce the Boolean equation for 2-, 3- and 4-input truth tables.

C B A Q Boolean Equation

0 0 0 0

0 0 1 1 C.B.A 0 1 0 0

0 1 1 1 C.B.A 1 0 0 1 C.B.A 1 0 1 1 C.B.A 1 1 0 0

1 1 1 0

GCSE Electronics – Component 1: Discovering ElectronicsChapter 6 - Combinational logic systems

210

© WJEC 2017

Two special identities

1. The Boolean expression A.B is the same as A + B . We can check this by looking at the truth table below

This shows that the two logic expressions are the same.

2. The Boolean expression A + B, is the same as A.B . We can check this by looking at the truth table below.

This shows that the two logic expressions are the same.

B A B A B.A BA +

0 0 1 1 1 1

0 1 1 0 1 1

1 0 0 1 1 1

1 1 0 0 0 0

B A B A BA + B.A

0 0 1 1 1 1

0 1 1 0 0 0

1 0 0 1 0 0

1 1 0 0 0 0

Chapter 6 - Combinational logic systems

211

GCSE Electronics – Component 1: Discovering Electronics

© WJEC 2017

Exercise 6.4

1. The Boolean equations labelled A–G, below are to be used to answer the following questions.

A) Q = A.B

B) Q = A+B

C) Q = A + B

D) Q = A

E) Q = A.B

F) Q = A.B

G) Q = A + B

i. Which equation is correct for an AND gate?

ii. Which equation is correct for a NOT gate?

iii. Which equation is correct for a NOR gate?

iv. Which equation is correct for a NAND gate?

v. Which equation is correct for an OR gate?

vi. Which equation produces the same logic output as G?

vii. Which equation produces the same logic output as B?

2. Write down the Boolean equations for outputs X, Y and Z:

X = …………………………………………

Y = …………………………………………

Z = …………………………………………

B A X Y Z

0 0 1 0 0

0 1 1 0 0

1 0 0 0 1

1 1 0 1 0

GCSE Electronics – Component 1: Discovering ElectronicsChapter 6 - Combinational logic systems

212

© WJEC 2017

3. Complete the table with the Boolean equations when the output Q is at logic 1.

Hence write down the full Boolean equation for the system:

………………………………………………………………………………………………………

4. Complete the table with the Boolean equations when the output Q is at logic 1.

Hence write down the full Boolean Equation for the system:

………………………………………………………………………………………………………

C B A Q Boolean Equation 0 0 0 1

0 0 1 0

0 1 0 0

0 1 1 1

1 0 0 0

1 0 1 0

1 1 0 1

1 1 1 0

C B A Q Boolean Equation 0 0 0 0

0 0 1 0

0 1 0 1

0 1 1 0

1 0 0 0

1 0 1 1

1 1 0 0

1 1 1 1

Chapter 6 - Combinational logic systems

213

GCSE Electronics – Component 1: Discovering Electronics

© WJEC 2017

Logic System Design

In the previous two sections we have considered the logic gates available for us to use in electronic system design. We have derived truth tables from logic circuits, and have constructed logic circuits from truth tables.

In this section we will be completing the design process by converting a design brief of a problem into a truth table.

Design problems

Example 1: A logic system has two input sensors A and B and two outputs. Output 1 is high when sensor A is high and sensor B is high. Output 2 is high either when sensor A is low and sensor B is high, or when sensor A is high and sensor B is high.

a) Complete the truth table to satisfy these conditions.b) Draw the circuit diagram for the logic system.

Solution

a) Output 1 is high only when A = 1 and B = 1. Identify this cell in the output 1 column of the truth table and place a ‘1’ in it. Place zeros in the three other cells in the output 1 column.

Output 2 is high when A = 0 and B = 1, or when A = 1 and B = 1. Identify these two cells in the output 2 column of the truth table. Place a ‘1’ in these two cells and zeros in the other two.

Inputs Outputs B A Output 1 Output 2 0 0

0 1

1 0

1 1

GCSE Electronics – Component 1: Discovering ElectronicsChapter 6 - Combinational logic systems

214

© WJEC 2017

b) You should have obtained the following truth table.

Examine the output 1 pattern. You should realise that it is the same pattern as for an AND gate. Examine the output 2 pattern. You should realise that it is the same as input B.

The circuit diagram can then be drawn.

Example 2: A system is required to monitor a car’s cooling system. When the water level in the radiator is below a certain level a LED will light up. When the engine temperature is above a predetermined value and the water level is too low a buzzer should sound in addition to the LED lighting up. The positioning and signals out of the sensors used are shown below.

Inputs Outputs B A Output 1 Output 2 0 0 0 0

0 1 0 0

1 0 0 1

1 1 1 1

A

B

Moisture Sensor

Temperature Sensor

Radiator

Sensor A (moisture) state logic level Wet 0 Dry 1

Sensor B (temperature) state logic level Cool 0 Hot 1

Chapter 6 - Combinational logic systems

215

GCSE Electronics – Component 1: Discovering Electronics

© WJEC 2017

a) First we complete the truth table for the system.

From the specification, the LED must light every time the radiator water level falls below the minimum – this is when sensor A outputs a logic 1.

From the specification, the buzzer must sound when the temperature goes above a certain temperature – this is when sensor B outputs a logic 1 AND when the radiator water level falls below the minimum – this is when sensor A outputs a logic 1.

b) Determine the logic required to produce each output.

For the LED output, the pattern is the same as input A, so no logic gate is required.

For the buzzer output, there is one type of gate that will provide this output pattern – an AND gate

c) Complete the system diagram showing how the system can be made up.

Inputs Outputs B A LED Buzzer 0 0 0 0 1 1 1 0 0 1 1 1

Inputs Outputs B A LED Buzzer 0 0 0 0 0 1 1 0 1 0 0 0 1 1 1 1

GCSE Electronics – Component 1: Discovering ElectronicsChapter 6 - Combinational logic systems

216

© WJEC 2017

Example 3:

Before take-off, the pilot and co-pilot of an aircraft carry out preflight safety checks. When all checks have been completed they each move a switch from the up to the down position.

• When both switches are up, a red indicator on the instrument panel is on. • This changes to yellow when at least one of them operates their switch.• When both have operated their switches, a green indicator comes on. • The engines can only be started when the green indicator is on.

Assume that the switches provide logic level 0 in the up position and logic level 1 in their down position. The LED indicators operate on logic level 1.

a) Check the completed truth table for the system.

b) Now we need the logic system that can produce these outputs. Take each one in turn.

For the RED output – there is a standard gate that can produce this output – a NOR gate.

For the YELLOW output – there are actually two ways of generating the YELLOW output. First is a standard gate that can produce the output – an OR gate using inputs A and B.

Alternatively the output Y is the opposite of the RED output. So we could achieve the same by just inverting the RED output

Inputs Outputs B A R Y G 0 0 1 0 0 0 1 0 1 0 1 0 0 1 0 1 1 0 1 1

Chapter 6 - Combinational logic systems

217

GCSE Electronics – Component 1: Discovering Electronics

© WJEC 2017

For GREEN output – again a standard gate can produce this output – an AND gate.

The complete system therefore is:

GCSE Electronics – Component 1: Discovering ElectronicsChapter 6 - Combinational logic systems

218

© WJEC 2017

Investigation 6.4 Set up the logic system shown below using your simulation program.

a) Press switches A and B in the order shown in the truth table and record the results

b) Compare your results with truth table for design example 3 (aircraft preflight safety check) and comment on how well the logic system satisfies the design brief:

……………………………………………………………………………………………………… ……………………………………………………………………………………………………… ……………………………………………………………………………………………………… ………………………………………………………………………………………………………

Inputs Outputs B A R Y G 0 0 0 1 1 0 1 1

Chapter 6 - Combinational logic systems

219

GCSE Electronics – Component 1: Discovering Electronics

© WJEC 2017

Exercise 6.5

1. A logic system has two input sensors A and B and three outputs.

• Output 1 is high when sensor A is low. • Output 2 is high when sensor A is low and sensor B is low.• Output 3 is high when sensor A is high and sensor B is low.

a) Complete the truth table to satisfy these conditions.

Truth table

b) i) Examine the O/P 1 pattern. This can be generated from one of the input signals. Write down the logic function required to generate this output.

…………………………………………………………………………

ii) Examine the O/P 2 pattern. This can be generated from one of the standard logic gates. Write down the logic function required to generate this output.

…………………………………………………………………………

iii) Examine the O/P 3 pattern. This cannot be generated from the inputs using one of the standard logic gates. Write down the logic function required to generate this output.

…………………………………………………………………………

c) Draw the circuit diagram for the logic system.

Inputs Outputs B A O/P 1 O/P 2 O/P 3 0 0

0 1

1 0

1 1

GCSE Electronics – Component 1: Discovering ElectronicsChapter 6 - Combinational logic systems

220

© WJEC 2017

2. A system is required that will monitor a car’s cooling system. When the water level in the radiator is below a certain level a LED will light up. When the engine temperature is above a predetermined value and the water level is too low a buzzer should sound in addition to the LED lighting up. The positioning and signals out of the sensors used are shown below.

a) Complete the following truth table for the system.

b) Study the LED output and compare it with the inputs. What do you notice?

………………………………………………………………………………………………

………………………………………………………………………………………………

c) Study the buzzer output. There is one type of gate that will provide this output pattern.

What type of logic gate is required? …………………………………

d) Complete the following diagram showing how the system can be made up.

A

B

Moisture Sensor

Temperature Sensor

Radiator

Sensor A (moisture) state logic level Wet 1 Dry 0

Sensor B (temperature) state logic level Cool 1 Hot 0

Inputs Outputs B A LED Buzzer 0 0

0 1

1 0

1 1

Chapter 6 - Combinational logic systems

221

GCSE Electronics – Component 1: Discovering Electronics

© WJEC 2017

3. Before leaving port, the loading bay controller and captain of a car ferry carry out pre-departure safety checks. When all checks have been completed they each move a switch from the down to the up position.

• When both switches are down, a red indicator on the instrument panel is on. • When any one of the switches is in the up position, the indicator light changes to yellow.• When both switches are in the up position, a green indicator comes on. • The engines of the car ferry can only be started when the green indicator is on.

Assume that the switches provide logic level 0 in the up position and logic level 1 in their down position. The LED indicators operate on logic level 1.

a) Complete the following truth table for the system.

b) Study the R output. There is one type of gate which will provide the required output.

What type of gate is it? …………………………………

c) Study the Y output. Write down an expression to describe it. Y = …………………………………

d) Study the G output. There is one type of gate which will provide the required output.

What type of gate is it? ………………………………… e) Complete the following diagram showing how the system can be made up.

Inputs Outputs B A R Y G 0 0 0 1 1 0 1 1

GCSE Electronics – Component 1: Discovering ElectronicsChapter 6 - Combinational logic systems

222

© WJEC 2017

4. Two sensors A and B are used to control the paint mixing process at a local DIY store. Three output valves control the flow of cyan, magenta and yellow pigment. Valve V1 is the cyan, Valve V2 is the magenta, and Valve V3 is the yellow. Mixing occurs according to the following sequence. A logic 1 operates the valve.

• Valve 1 operates when input A is high and input B is high.• Valve 2 operates when input A is low and input B is low, or when input A is high and input B is

low.• Valve 3 operates when input A is low and input B is high, or when input A is low and input B is

low.

a) Complete the following truth table for the system.

b) Which type of gate will provide the V1 output? …………………………………

c) Write down an expression to describe V2 and V3 by comparing them with the inputs.

V2 = …………………………………………………………………………………………

……………………………………………………………………………………………….

V3 = …………………………………………………………………………………………

………………………………………………………………………………………………. d) Draw the circuit for the system

Inputs Outputs

B A V1 (cyan)

V2 (magenta)

V3 (yellow)

0 0

0 1

1 0

1 1

Chapter 6 - Combinational logic systems

223

GCSE Electronics – Component 1: Discovering Electronics

© WJEC 2017

NAND Gate Implementation

Earlier on in this chapter we found out how to construct logic systems from a truth table. This often resulted in logic systems that required a number of different types of logic gate (e.g. NOT, AND and OR) in order to fulfil the function required.

In some of the designs looked at we needed three different types of logic gate in the final design. As we have seen there could be as many as six identical logic gates in the IC package of which we are only going to use one.

This is wasteful in terms of both unused devices and in the space needed on circuit boards.

The inverted gates, NAND and NOR are special because the function of all other gates can be made from various combinations of NAND or NOR gates. In this course only NAND gate alternatives of the other logic functions will be discussed.

By using just one type of logic gate we may be able to reduce the number of types of logic gate required to make any particular design. This has a number of advantages:

• There will be less confusion about which type of gate goes where in the circuit as they are all the same.

• There will be no need to keep stocks of all the different types of logic gate, therefore saving money.

• Larger quantities of a single type of gate can be purchased, which makes cost lower.

We will now look at an example to show you how making this change can improve the situation.

GCSE Electronics – Component 1: Discovering ElectronicsChapter 6 - Combinational logic systems

224

© WJEC 2017

Consider the two logic circuits below, which perform the same logic function.

System 1: Mixture of gates.

System 2: NAND gates only

When system 2 is compared to system 1, you may think that we have made the circuit more complicated as we have more logic gates in system 2. However, in system 1 three different types of gates are required NOT, OR and AND.

To construct system 1 using these gates would require three different logic ICs, and many of the logic gates on these ICs would not be used.

Using system 2 requires four logic gates. Since these are all of the same type, only one logic IC would be required and all gates in the IC are used.

This would provide a considerable cost saving compared to the design in system 1.

In industry, if such systems are to be mass produced these savings can be considerable, and it is up to the engineers making the systems to use this technique to make the process as cost effective as possible.

Now that we know why NAND gate logic is used let’s find out how to carry out this procedure. We need to understand the combination of NAND gates required to replace each of our ‘standard’ gates.

Chapter 6 - Combinational logic systems

225

GCSE Electronics – Component 1: Discovering Electronics

© WJEC 2017

NAND gate equivalent circuits for the four other gates

1. The NOT gate

This is the simplest of the standard gates to form from NAND gates.

is the same as

Check that you agree with the truth table below for the NAND equivalent circuit.

Note: The NAND equivalent of a NOT gate is sometimes referred to as a NAND Inverter. You will need to remember this for later on.

2. The AND gate

This is the inverse of a NAND gate, and is simply a NAND gate followed by an inverter (NOT Gate).

Check that you agree with the truth table below for the NAND equivalent circuit.

Input Output A Q 0 1 1 0

Inputs Intermediate Output Output

B A X Q 0 0 1 0 0 1 1 0 1 0 1 0 1 1 0 1

GCSE Electronics – Component 1: Discovering ElectronicsChapter 6 - Combinational logic systems

226

© WJEC 2017

3. The OR gate

The OR gate is a little more complicated, and requires three NAND gates as shown below.

Check that you agree with the truth table below for the NAND equivalent circuit.

4. The NOR gate

The NOR gate is the inverse of the OR gate, so just one more gate is needed as shown below.Check that you agree with the truth table below for the NAND equivalent circuit.

Inputs Intermediate Outputs Output

B A X Y Q 0 0 1 1 0 0 1 0 1 1 1 0 1 0 1 1 1 0 0 1

Inputs Intermediate Outputs Output B A X Y Z Q 0 0 1 1 0 1 0 1 0 1 1 0 1 0 1 0 1 0 1 1 0 0 1 0

Chapter 6 - Combinational logic systems

227

GCSE Electronics – Component 1: Discovering Electronics

© WJEC 2017

Converting Logic Diagrams to NAND gates

The process for converting logic system diagrams into NAND gate format is quite straightforward if you work logically through the circuit. Each gate is replaced in turn by its NAND equivalent, and connected up in the same way. We will look at an example to show how this is done.

Example 1:

Convert the following logic system into NAND gates only.

In this case we need to replace a NOT gate, OR gate and an AND gate.

Stage 1: Redraw the NAND equivalent circuits of the gates shown above.Where possible retain the position of these gates so that you can identify the connections afterwards.

Drawing a box around each gate and its corresponding NAND equivalent will allow you to check that you have replaced every gate in the circuit.

GCSE Electronics – Component 1: Discovering ElectronicsChapter 6 - Combinational logic systems

228

© WJEC 2017

Stage 2: It is then just a matter of connecting the equivalent circuits together.

This circuit is now the equivalent circuit to that using a NOT, OR an AND gate given earlier. However, there is one further simplification we can make.

Stage 3 : Consider the circuit again as shown below.

If you look carefully at the two NAND gates labelled 1 and 2, we can see that these are both configured to be inverters (or NOT gates). If we consider what happens to signal A as it passes through these two gates we have the following:

A logic 1 at A, becomes a 0 after gate 1 and then a 1 again after gate 2A logic 0 at A, becomes a 1 after gate 1 and then a 0 again after gate 2

Therefore, gates 1 and 2 serve no useful purpose in this circuit. They are known as redundant gates and can be removed. We call this double inversion and it occurs commonly when creating NAND gate circuits from other logic systems. Remember a double inversion only occurs when 2 NAND Inverters are directly connected to one another.

1

2

Chapter 6 - Combinational logic systems

229

GCSE Electronics – Component 1: Discovering Electronics

© WJEC 2017

In a test or examination question you would usually be asked to cross out any redundant gates, so you would end up with the following circuit.

Occasionally, you will be asked to redraw the circuit, with redundant gates removed, or if you were going to build the circuit then the final circuit would be as follows:

We have methodically gone through this example to illustrate each stage of the simplification process. These steps can be reduced to just a few but there are a couple of things that will help to ensure that you don’t make mistakes.

Summary of process

i. Identify each of the gates from the original circuit and their NAND equivalent.ii. Connect each equivalent NAND gate circuit as per the original diagram.iii. Identify and cross out any redundant gates caused by double inversions.iv. Do not try to remove double inversions in your head, as you can easily forget which ones you

have done and leave some out.

GCSE Electronics – Component 1: Discovering ElectronicsChapter 6 - Combinational logic systems

230

© WJEC 2017

Example 2:

Convert the following logic diagram into NAND gates only.

First of all we will replace all of these gates with their NAND equivalent and connect them together.

Finally we check for any redundant gates, and identify these.

Note the way in which different pairs of redundant gates are marked.

Chapter 6 - Combinational logic systems

231

GCSE Electronics – Component 1: Discovering Electronics

© WJEC 2017

Investigation 6.5

1. a) Set up the following logic systems (which we looked at in example 1 earlier) on a simulation program and complete the truth table in each case for output Q.

b) Redraw the NAND gate circuit above to include pull-down resistors, input switches and a LED indicator. Build the circuit on breadboard and complete the truth table.

c) Compare the three truth tables to check you obtained the same result in each case.

C B A Q 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 C B A Q 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1

C B A Q 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1

GCSE Electronics – Component 1: Discovering ElectronicsChapter 6 - Combinational logic systems

232

© WJEC 2017

Exercise 6.6

1. a) Redraw the following logic circuit using 2 input NAND gates only.

b) Identify any redundant gates.

Chapter 6 - Combinational logic systems

233

GCSE Electronics – Component 1: Discovering Electronics

© WJEC 2017

2. a) Redraw the following logic circuit using 2-input NAND gates only.

b) Identify any redundant gates.

GCSE Electronics – Component 1: Discovering ElectronicsChapter 6 - Combinational logic systems

234