ALevel-CS Chapter 04 Logic gates and logic circuits

4.01 Boolean logic and problem statements

Key Terms

Boolean logic and problem statements

Logic proposition can have only one of the two alternative Boolean logic values: TRUE or FALSE.

4.02 Boolean operators

Key Terms

Boolean operators

The three basic Boolean operators are AND, OR and NOT.

Truth tables

The truth table for the AND operator

4.04 Logic circuits and logic gates

Key Terms

Logic circuits and logic gates

Example Constructing a logic circuit from a problem statement or logic expression

Consider the following problem statement: A bank offers a special lending rate to customers subject to certain conditions. To qualify, a customer must satisfy certain criteria.

To convert this statement to a logic expression using symbols we can choose:

The logic expression can then be written as:

A AND (((B AND C) OR (B AND D)) OR (C AND D))

This could alternatively be presented with an outcome:

Special_rate IF A AND (((B AND C) OR (B AND D)) OR (C AND D))

alternatively as

X = A AND (((B AND C) OR (B AND D)) OR (C AND D))

NOT Gate

AND Gate

OR Gate

NAND Gate (NOT AND)

NOR Gate (NOT OR)

XOR Gate (XOR Gate)

Example Constructing a truth table from a logic expression or logic circuit

Logic circuits, logic expressions, truth tables and problem statements

Type 1 - produce a truth table for a given logic circuit

step 1 - find the intermediate values P and Q

step 2 - find intermediate values R use P and Q

step 3 - find final part X use intermediate R and C

final result

Type 2 - write logic expressions from given logic circuits

Type 3 - produce a logic circuit and a truth table from given logic expression

Given logic expression: (A XOR C) OR (NOT C NAND B)

first step: A XOR C

second step: NOT C NAND B

third step : combine

fourth step: truth table

Type 4 - produce a logic expression and logic circuit from given truth table **(optional)

example 1

logic circuit

example 2

logic circuit

example 3

(NOT A AND NOT B AND NOT C) 
(A AND NOT B AND NOT C) 
(A AND B AND NOT C)

final logic expression

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

Type 4 - Produce a logic circuit and truth table from real work case

A safety system uses three inputs to a logic circuit. An alarm, X, sounds if input A represents ON and input B represents OFF; or if input B represents ON and input C represents OFF.

Type 5 Produce the working space (optional)

Consider the logic statement:

((A NOR B) AND C) NAND (A OR NOT B)
  1. Draw a logic circuit to represent the given logic statement.
  2. Complete the truth table for the given logic statement.

first - break down the logic statement

  1. P = (A NOR B)
  2. Q = (A OR NOT B)
  3. R = (P AND C)