Vous êtes sur la page 1sur 45

# COMBINATIONAL LOGIC: EXEMPLAR QUESTIONS AND SOLUTIONS

COMBINATIONAL LOGIC
Outcome 1

?1
(a)

(i) 10

(b)

(iii) 00111110

(iv) 10010011

(ii) 2A

(iii) 68

(iv) 0F

(ii) 11011000

(iii) 01001110

(iv) 10010111

numbers:
(i) 62

(f)

(ii) 11100011

(i) 00111011

(e)

(iv) 182

(i) F3

(d)

(iii) 120

(i) 10101010

(c)

(ii) 59

(ii) 5

(iii) 251

(iv) 129

(i) BC

(ii) F4

(iii) 56

(iv) AA

133

?1
Solution
(a)

## There a number of different ways in which decimal to binary

conversion can be done. The quickest and simplest is to use an
engineering calculator that lets you convert between bases. Even
the windows-based calculator supports base conversion. Given
below is an illustration of how this is done using the windows
calculator.

Only 6 binary digits appear as this is all that is required to represent 59 in binary,
however to convert to an 8-bit representation just add two zeros, i.e. 00111011

## Alternatively we can calculate the binary value of a decimal number

using the binary weightings for 8 bits as shown below.

134

## Finally we can calculate the result using the divide by 2 technique.

Again using 59 as an example:

(i)

10 converts to 00001010
MSB

LSB

(ii)

LSB

MSB

135

LSB

MSB

(b) (i)

(ii)

136

(iii)

(iv)

137

(c)

## Hexadecimal is number system based on 16 digits compared with

decimal, which has 10, and binary, which has 2. The popularity of
hexadecimal within the study and use of digital systems is that it
provides a shorthand (efficient) method of representing binary
patterns. Converting from hexadecimal to binary and binary to
hexadecimal is also extremely easy.
The table below shows the relationship between every hexadecimal
digit and its 4-bit binary equivalent. Notice that the table is
simply a binary count and all that really needs to be remembered
are the binary patterns for A, B, C, D, E and F.
B3

B2

B1

B0

0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1

0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1

0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1

0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1

(i)

value
0
1
2
3
4
5
6
7
8
9
A
B
C
D
E
F

Decimal value
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

## To convert the hexadecimal number F3 simply look at the

table and extract the appropriate 4-bit binary pattern.
F = 1111

3 = 0011

138

2 = 0010

A = 1010

(iii) For 68
6 = 0110

8 = 1000

(iv) For 0F
0 = 0000

F = 1111

(d)

## The process of converting from binary to hexadecimal is simply a

case of reversing the previous process. Divide the binary pattern
into groups of four bits and read off the equivalent hexadecimal
digit.
In example (i) 00111011is broken into 0011 = 3 and 1011 = B.
The hexadecimal representation of 00111011 is 3B.
(ii) 11011000 = 1101

1000 = D8

1110 = 4E

## (iv) 10010111 = 1001

0111 = 97

Note: if the binary pattern does not divide into groups of four bits
add 0s to the left-hand side, i.e. the MSB side until the pattern does
divide.
For example, 11001 only contains five binary digits (bits). If we add
three 0s to the left-hand side we do not affect the value but we can
now divide the pattern into groups of four bits:
00011001 = 19 in hexadecimal

139

(e)

## There are three methods that we can use to convert decimal to

The simplest of all is to use an engineering calculator that has the
facility to convert between bases. Again if we look at the
calculator provide in Microsoft Windows we can see how this is
done.

## The second method is to convert the decimal number into binary

and then convert the binary number into hexadecimal. All of this
has been demonstrated in the previous examples (a) (d).
The third method involves conversion using a table containing the
weighted values of the hexadecimal digits. This is similar to the
conversion between binary and decimal.

140

(ii)

141

(f) (i)

(ii)

142

?2
(a)

(b)

143

?2
Solution
(a)

## The decimal numbers in this question have already been converted

to binary in SAQ 1.
The rules applied to binary addition are identical to those applied
to decimal except that we must always remind ourselves that we
are working in binary.

(i)

(ii)

(iii)

(iv)

144

(b)

## The decimal numbers in this question have already been converted

to binary in SAQ 1.
The rules applied to binary subtraction are identical to those
applied to decimal except that we must always remind ourselves
that we are working in binary.

(i)
11=0
32=1

2 cannot be
subtracted from 0
therefore a 1 is
borrowed from the
next column. This
upper digit is now 2

21=1

(ii)

(iii)

(iv)

145

?3
(a)

numbers:
(i) 10

(ii) 10

(v) 120

(vi) 120

(iii) 59

(iv) 59

(b)

## Explain why the decimal numbers 182 and 182 cannot be

represented using 8-bit 2s complement representation.

(c)

## Perform the following calculations using 8-bit 2s complement

binary representation:

146

?3
Solution
(a)

## 2s complement is a binary method of representing negative

numbers. In 2s complement representation the MSB is used as a
sign bit with 1 indicating a negative number and 0 representing a
positive number.
We will use (i) to illustrate the 2s complement system.
(i)

147

## It is difficult to tell the value of this 8-bit 2s complement

number simply by looking at it. To check the value of a
negative number simply repeat the previous operations, i.e.
invert all bits and add 1:

(ii)

## Notice that there is no difference in representation, i.e. this

looks like a standard 8-bit binary representation of 10.

(iii)

(iv)

148

(v)

(vi)

(b)

## If we use 8-bit 2s complement representation then the sign bit

effectively reduces the size of the number to 7 bits. In 2s
complement form the range of numbers that can be represented is:

As can be seen, 182 and 182 fall outwith this range and so cannot
be represented using 8-bit 2s complement.

149

## COMBINATIONAL LOGIC: EXEMPLAR QUESTIONS AND SOLUTIONS

(c) (i)

(ii)

(iii)

(iv)

If a carry is generated into the ninth bit simply ignore; the 8bit answer will be correct

150

## COMBINATIONAL LOGIC: EXEMPLAR QUESTIONS AND SOLUTIONS

Outcome 2

?1
(a)

Identify the ANSI standard logic symbols shown and complete the
truth tables in Fig SAQ 1 (i).

## Fig SAQ 1(i)

(b)

Draw the British Standard symbols for the logic gates shown Fig
SAQ 1(i).

(c)

Write down the Boolean expression for each of the gates shown in
Fig SAQ 1(i).

151

?1
Solution
(a)

152

(b)

153

## COMBINATIONAL LOGIC: EXEMPLAR QUESTIONS AND SOLUTIONS

?2
For the ANSI logic gates given in Fig SAQ 2:
(a)

(b)

## write down the logic output for the inputs shown.

Fig SAQ 2

?3
For the BS logic gates given in Fig SAQ 3:
(a)

(b)

Fig SAQ 3

154

?2
Solution
(a), (b)

155

?3
Solution
(a), (b)

156

## COMBINATIONAL LOGIC: EXEMPLAR QUESTIONS AND SOLUTIONS

Outcome 3

?1
(a)

For the circuit shown in Fig SAQ 1(i) write down the Boolean
expression for X.

(b)

## Using the integrated circuit diagram sheet identify the Integrated

Circuits used in this circuit and place appropriate pin numbers
beside the gates.

(c)

157

?1
Solution
(a), (b)

(c)

158

## COMBINATIONAL LOGIC: EXEMPLAR QUESTIONS AND SOLUTIONS

?2
(a)

For the circuit shown in Fig SAQ 2(i) write down the Boolean
expression for X.

(b)

Using the integrated circuit diagram sheet identify the ICs used in
this circuit and place appropriate pin numbers beside the gates.

(c)

159

?2
Solution
(a), (b)

(c)

160

## COMBINATIONAL LOGIC: EXEMPLAR QUESTIONS AND SOLUTIONS

?3
For the following Boolean expressions:

(i)

(ii)

(a)

draw the logic circuit using ANSI symbols (your diagram should
show the ICs selected and the appropriate pin connections)

(b)

Fig SAQ 3

161

?3
Solution
(i)

162

(ii)

(b)

163

## COMBINATIONAL LOGIC: EXEMPLAR QUESTIONS AND SOLUTIONS

?4
The truth table for a two-input logic circuit is shown in Fig SAQ 4.
(a)

From the truth table derive the Boolean expression that describes
this table.

(b)

Using ANSI symbols draw the logic circuit that meets the
requirements of this table. Your schematic should clearly show
ICs used and pin numbers.

Fig SAQ 4

164

## COMBINATIONAL LOGIC: EXEMPLAR QUESTIONS AND SOLUTIONS

?4
Solution
In this problem you are trying to generate a circuit from a truth table.
To do this consider each input combination that provides a logic 1
output and work out how this could be achieved using an AND gate.
These combinations are indicated by arrows in the diagram below.

## To illustrate consider the first combination, A = 0 and B = 0. In order

to generate a logic 1 at the output an AND gate needs all its inputs to be
logic 1 therefore we need to invert A and B:

## If we follow this argument for the second combination, A = 0 and B = 1,

we need to invert A only to obtain a 1 from the AND gate output:

165

## COMBINATIONAL LOGIC: EXEMPLAR QUESTIONS AND SOLUTIONS

The final step is to combine all the AND combinations into an OR gate.
Recall that the OR gate will generate a logic 1 output when either of its
inputs are logic, which is exactly what is needed for this circuit.

166

## COMBINATIONAL LOGIC: EXEMPLAR QUESTIONS AND SOLUTIONS

?5
The truth table for a three-input logic circuit is shown in Fig SAQ 5.
(a)

From the truth table derive the Boolean expression that describes
this table.

(b)

Using ANSI symbols draw the logic circuit that meets the
requirements of this table. Your schematic should clearly show
ICs used and pin numbers.

Fig SAQ 5

167

## COMBINATIONAL LOGIC: EXEMPLAR QUESTIONS AND SOLUTIONS

?5
Solution
The only difference between this problem and SAQ 4 is the number of
inputs. The way in which we solve the problem is identical.
Identify the input combinations that give a logic 1 output and work out
how a logic 1 could be achieved using an AND gate:

## The first combination is ABC = 001. As we have three inputs we will

require a three-input AND gate. To obtain a logic 1 output for this
combination we need to invert A and B:

168

## The second combination is ABC = 100. To obtain a logic 1 output for

this combination we need to invert B and C:

As before the final step is to combine all the AND combinations into an
OR gate. Recall that the OR gate will generate a logic 1 output when
either of its inputs are logic 1:

169

## COMBINATIONAL LOGIC: EXEMPLAR QUESTIONS AND SOLUTIONS

Outcome 4

?1
A simple logic control system for a central heating system has the
following inputs:

## 0 = outwith time period for central heating to be on

1 = within time period for central heating to be on

## 0 = room temperature above the set value

1 = room temperature below set value

## 0 = room temperature above 4C

1 = room temperature below 4C

When the output from the control system = 1 then the boiler will be
ignited, allowing the system to produce heat. The frost protection will
override the timer clock and the room thermostat should the
temperature fall below 4C.
Design the logic control system to meet the above requirements. Your
design should include the following:
truth table
Boolean logic expression
logic diagram using ANSI symbols (this diagram must include IC
identification and pin numbering).

170

## COMBINATIONAL LOGIC: EXEMPLAR QUESTIONS AND SOLUTIONS

?1
Solution
This outcome advances the combinational design processes one step
further. In this outcome we are given a specification for a digital
system and from that a practical circuit must be designed.
The first step in this process is to generate a truth table. This problem has three
inputs, C, T and F, therefore we need a three-input truth table. Each input
condition must be carefully considered before placing a 1 or 0 in the output
column.

OUT

## Output will be 0 as frost setting is above 4 and timer outwith

ON period.
Output will be 1 as the frost setting is indicating that the
temperature is below 4. This overrides everything else.
Output will be 0 as the frost setting is above 4 and timer
outwith ON period. Note it doesnt matter that the
temperature in the house is below the required value.
Output will be 1 as the frost setting is indicating that the
temperature is below 4. This overrides everything else.
Although we are within the ON period the temperature is
above the frost setting and the set value so the central
heating should be OFF and the output at 0.
Output will be 1 as the frost setting is indicating that the
temperature is below 4. This overrides everything else.
Output will be at 1 as we are in the ON period and the
temperature is below the set value.
Output will be 1 as the frost setting is indicating that the
temperature is below 4. This overrides everything else.

171

## COMBINATIONAL LOGIC: EXEMPLAR QUESTIONS AND SOLUTIONS

The remaining steps are identical to those carried out in Outcome 3, i.e.
generate an AND expression for each OUT = 1 condition and then OR
all of these AND expression together:

172

173

174

## COMBINATIONAL LOGIC: EXEMPLAR QUESTIONS AND SOLUTIONS

?2
The control logic for a simple alarm system in a house has three inputs
and a single output, which activates an alarm. The three inputs are:
windows sensor
doors sensor
master key.
The sensors operate as follows:
window sensor (W)

## 0 = all windows closed

1 = a window is open

## 0 = all doors closed

1 = a door is opened

## 0 = alarm system is disarmed

1 = alarm system is armed

If the alarm system is disarmed then the logic signals from the sensors
are ignored and the alarm will not sound. The alarm is activated by a
logic 1 from the output of the control logic.
Design the circuit to meet the requirements of this control logic. Your
design should include the following:
truth table
Boolean logic expression
logic diagram using ANSI symbols (this diagram must include IC
identification and pin numbering).

175

## COMBINATIONAL LOGIC: EXEMPLAR QUESTIONS AND SOLUTIONS

?2
Solution
As with the previous example a truth table must be generated and all
input permutations carefully considered. The required output and
associated reasons are shown below.
W

OUT

## Alarm is disarmed so it doesnt matter what the other sensors

are outputting, the output will be 0.
System is armed but no doors or windows are open therefore
the output is 0.
Alarm is disarmed so it doesnt matter what the other sensors
are outputting, the output will be 0.
System is armed and a door is open therefore the output is 1
in order to activate the alarm-driving circuitry.
Alarm is disarmed so it doesnt matter what the other sensors
are outputting, the output will be 0.
System is armed and a window is open therefore the output is
1 in order to activate the alarm-driving circuitry.
Alarm is disarmed so it doesnt matter what the other sensors
are outputting, the output will be 0.
System is armed and a door and a window are open therefore
the output is 1 in order to activate the alarm-driving circuitry.

## Generate an AND expression for each OUT = 1 condition and then OR

all of these AND expressions together to create the Boolean expression
that fully describes the requirements of the truth table.

176

177