Digital data - CCEABoolean operators and truth tables

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)

Boolean operators and truth tables

Computers use electrical circuits which have two states – on or off. This can also be represented as 1 or 0 or True and False.

Logic gates take an input of True or False and give an output of True or False. Each operator has a standard symbol that can be used when drawing logic gate circuits.

The three main logic gates are: AND, OR and NOT.

AND gate

In an AND gate, both inputs need to be 1 for the output to be 1.

AND gate symbol: a semicircle with two inputs (A&B) and one output (Q)

If input A AND Input B are true then output (Q) will be true. This can be seen in the truth table for the AND gate. The Boolean expression is written as Q = A AND B.

Input AInput BOutput Q
000
010
100
111
Input A0
Input B0
Output Q0
Input A0
Input B1
Output Q0
Input A1
Input B0
Output Q0
Input A1
Input B1
Output Q1

OR gate

In an OR gate, at least one input must be 1 for the output to be 1. This can be seen in the truth table for the OR gate.

OR gate symbol: a semicircle with a concave side, with two inputs (A&B) and one output (Q)

If input A OR input B is true, then output (Q) will be true. The Boolean expression is written as Q = A OR B.

Input AInput BOutput Q
000
011
101
111
Input A0
Input B0
Output Q0
Input A0
Input B1
Output Q1
Input A1
Input B0
Output Q1
Input A1
Input B1
Output Q1

NOT gate

A NOT gate is also known as an inverter as it inverts the input. The output is always the opposite of the input.

NOT gate symbol: triangle with a circle on the point, with one input (A) and one output (Q)

This can be seen in the truth table below. If input A is true then output Q is NOT true, if input A is false then output Q will NOT be false (i.e., true). The Boolean expression is Q = NOT A.

Input AOutput Q
01
10
Input A0
Output Q1
Input A1
Output Q0