Digital data - CCEAComplex logic gates

What is digital data, and how do computers understand it? How is digital data represented, stored, shared and manipulated?

Part ofDigital Technology (CCEA)Digital development concepts (programming)

Complex logic gates

We can represent Boolean logic by creating circuit diagrams that combine simple logic gates. Logic gates can be built up into chains of logical decisions. Some logic gates may have more than two inputs.

The diagram below shows a complex logic gate combining three simple gates. It is possible to work out intermediate outputs (D, the output of the NOT gate, and E, the output of the AND gate) along with the final output. For example:

Z = NOT A OR (B AND C)

NOT gate has input A, output D. AND gate has inputs B&C, output E. OR gate has inputs D&E, output Z

This logic gate truth table is written as:

Input AInput BInput CD = NOT A (intermediate output - NOT gate)E = B AND C (intermediate output - AND gate)Z = D OR E (final output - OR gate)
000101
001101
010101
011111
100000
101000
110000
111011
Input A0
Input B0
Input C0
D = NOT A (intermediate output - NOT gate)1
E = B AND C (intermediate output - AND gate)0
Z = D OR E (final output - OR gate)1
Input A0
Input B0
Input C1
D = NOT A (intermediate output - NOT gate)1
E = B AND C (intermediate output - AND gate)0
Z = D OR E (final output - OR gate)1
Input A0
Input B1
Input C0
D = NOT A (intermediate output - NOT gate)1
E = B AND C (intermediate output - AND gate)0
Z = D OR E (final output - OR gate)1
Input A0
Input B1
Input C1
D = NOT A (intermediate output - NOT gate)1
E = B AND C (intermediate output - AND gate)1
Z = D OR E (final output - OR gate)1
Input A1
Input B0
Input C0
D = NOT A (intermediate output - NOT gate)0
E = B AND C (intermediate output - AND gate)0
Z = D OR E (final output - OR gate)0
Input A1
Input B0
Input C1
D = NOT A (intermediate output - NOT gate)0
E = B AND C (intermediate output - AND gate)0
Z = D OR E (final output - OR gate)0
Input A1
Input B1
Input C0
D = NOT A (intermediate output - NOT gate)0
E = B AND C (intermediate output - AND gate)0
Z = D OR E (final output - OR gate)0
Input A1
Input B1
Input C1
D = NOT A (intermediate output - NOT gate)0
E = B AND C (intermediate output - AND gate)1
Z = D OR E (final output - OR gate)1

Case study – Boolean logic

School children are rewarded for healthy eating in the school canteen. If they buy a combination of a healthy starter, main and dessert, they receive bonus points on their loyalty card.

The school canteen will always offer one healthy starter, a choice of two healthy mains and one healthy dessert option.

A sample menu is shown below:

Starters

  • Vegetable soup (healthy option)
  • Chicken wings
  • Garlic mushrooms

Mains

  • Vegetable lasagne (healthy option)
  • Fish cakes (healthy option)
  • Hamburger
  • Lasagne

Dessert

  • Fruit salad (healthy option)
  • Ice cream

The selections that will qualify for bonus points can be represented as:

An example of Boolean logic, offering a reward in school for students who make healthy meal choices

Vegetable soup AND (vegetable lasagne OR fish cakes) AND fruit salad.