Logic Construction (Cambridge (CIE) A Level Computer Science) : Revision Note

Robert Hampton

Written by: Robert Hampton

Reviewed by: James Woodhouse

Updated on

From problem statements

  • A problem statement is typically a written interpretation of a scenario that requires a specific logical outcome

  • Logic circuits can be constructed using from problem statements

Worked Example

A server room has an automatic cooling fan (F)
The fan turns on based on the following input parameters:

Parameter

Description

Binary Value

Condition

T

Temperature

1 = Too high

0 = Acceptable

H

Humidity

1 = Too high

0 = Acceptable

M

Maintenance mode

1 = Active

0 = Inactive

D

Door sensor

1 = Door open

0 = Door closed

The fan (F = 1) turns on if:

  • The temperature is too high

  • AND humidity is too high

  • AND the door is closed

  • UNLESS maintenance mode is active (if maintenance is active, the fan must stay off)

Draw a logic circuit to represent how the fan (F) operates based on the input conditions. [3]

Answer

Logic circuit with three inputs: T and H to an AND gate, D and M to NOT gates, outputs combined through further AND gates, resulting in output F.
  • NOT gates on D and M inputs [1 mark]

  • AND gate combines T AND H or NOT D AND NOT M [1 mark]

  • Combines two previous AND outputs (e.g. (T AND H) AND (NOT D AND NOT M)) [1 mark]

From logic expressions

  • A logic expression is a way of showing how a logic circuit works using symbols and Boolean logic (AND, OR, NOT)

  • It describes the conditions that must be met for the output to be true (1) or false (0)

  • From a logic expression, a logic circuit and/or truth table can be constructed

Worked Example

A logic expression is given:

S = (A AND B AND C) OR (B XOR C)

(a) Draw the logic circuit for the given expression [4]

(b) Complete the truth table for the logic expression: [2]

S = (A AND B AND C) OR (B XOR C)

Answer

(a)

Logic circuit diagram with three inputs, A, B, and C, using two AND gates, two OR gates, and one NOT gate, producing output S.
  • Each correct gate [1 mark]

(b)

A

B

C

S

0

0

0

0

0

0

1

1

0

1

0

1

0

1

1

0

1

0

0

0

1

0

1

1

1

1

0

1

1

1

1

1

  • Rows 1 to 4 correct [1 mark]

  • Rows 5 to 8 correct [1 mark]

From truth tables

  • To create a truth table for the expression P = (A AND B) AND NOT C 

    • Calculate the numbers of rows needed (2number of inputs)

    • In this example there are 3 inputs (A, B, C) so a total of 8 rows are needed (23)

    • To not miss any combination of inputs, start with 000 and count up in 3-bit binary (0-7)

A

B

C

0

0

0

0

0

1

0

1

0

0

1

1

1

0

0

1

0

1

1

1

0

1

1

1

  • Add a new column to show the results of the brackets first (A AND B)

A

B

C

A AND B

0

0

0

0

0

0

1

0

0

1

0

0

0

1

1

0

1

0

0

0

1

0

1

0

1

1

0

1

1

1

1

1

  • Add a new column to show the results of NOT C

A

B

C

A AND B

NOT C

0

0

0

0

1

0

0

1

0

0

0

1

0

0

1

0

1

1

0

0

1

0

0

0

1

1

0

1

0

0

1

1

0

1

1

1

1

1

1

0

  • The last column shows the result of the Boolean expression (P) by comparing (A AND B) AND NOT C // 

A

B

C

A AND B

NOT C

P

0

0

0

0

1

0

0

0

1

0

0

0

0

1

0

0

1

0

0

1

1

0

0

0

1

0

0

0

1

0

1

0

1

0

0

0

1

1

0

1

1

1

1

1

1

1

0

0

Examiner Tips and Tricks

It is possible to create a truth table when combining expressions that show only the inputs and the final outputs.

The inclusion of the extra columns supports the process but can be skipped if you feel able to do those in your head as you go.

From logic circuits

  • From a logic circuit you can create the logic expression and/or truth table

Worked Example

Write the logic expression for the given logic circuit. [3]

Logic circuit diagram with inputs A, B, C; involving NOT, AND, and OR gates, outputting X.

Answer

(A NAND B) OR (B XOR C)

  • A NAND B [1 mark]

  • B XOR C [1 mark]

  • OR [1 mark]

You've read 0 of your 5 free revision notes this week

Unlock more, it's free!

Join the 100,000+ Students that ❤️ Save My Exams

the (exam) results speak for themselves:

Did this page help you?

Robert Hampton

Author: Robert Hampton

Expertise: Computer Science Content Creator

Rob has over 16 years' experience teaching Computer Science and ICT at KS3 & GCSE levels. Rob has demonstrated strong leadership as Head of Department since 2012 and previously supported teacher development as a Specialist Leader of Education, empowering departments to excel in Computer Science. Beyond his tech expertise, Robert embraces the virtual world as an avid gamer, conquering digital battlefields when he's not coding.

James Woodhouse

Reviewer: James Woodhouse

Expertise: Computer Science Lead

James graduated from the University of Sunderland with a degree in ICT and Computing education. He has over 14 years of experience both teaching and leading in Computer Science, specialising in teaching GCSE and A-level. James has held various leadership roles, including Head of Computer Science and coordinator positions for Key Stage 3 and Key Stage 4. James has a keen interest in networking security and technologies aimed at preventing security breaches.