COMPUTER SCIENCE CAFÉ
  • WORKBOOKS
  • BLOCKY GAMES
  • GCSE
    • CAMBRIDGE GCSE
  • IB
  • A LEVEL
  • LEARN TO CODE
  • ROBOTICS ENGINEERING
  • MORE
    • CLASS PROJECTS
    • Classroom Discussions
    • Useful Links
    • SUBSCRIBE
    • ABOUT US
    • CONTACT US
    • PRIVACY POLICY
  • WORKBOOKS
  • BLOCKY GAMES
  • GCSE
    • CAMBRIDGE GCSE
  • IB
  • A LEVEL
  • LEARN TO CODE
  • ROBOTICS ENGINEERING
  • MORE
    • CLASS PROJECTS
    • Classroom Discussions
    • Useful Links
    • SUBSCRIBE
    • ABOUT US
    • CONTACT US
    • PRIVACY POLICY

COMPUTER ORGANISATION | LOGIC GATES

ON THIS PAGE
SECTION 1 | WHAT ARE LOGIC GATES
SECTION 2 | WHAT ARE TRUTH TABLES
​SECTION 3 | WHAT ARE LOGIC EXPRESSIONS
SECTION 4 | LOGIC GATES
​SECTION 5 | LOGIC CIRCUITS
ALSO IN THIS TOPIC
 COMPUTER ARCHITECTURE
SECONDARY MEMORY
OPERATING SYSTEMS

 BINARY REPRESENTATION
YOU ARE HERE |LOGIC GATES
TOPIC 2 REVISION | NEW
KEY TERMINOLOGY
TOPIC 2 ANSWERS

Picture
SECTION 1 | WHAT ARE LOGIC GATES
Logic gates are the basic building blocks of digital circuits. They perform basic logical operations on one or more binary inputs and produce a single binary output. The purpose of logic gates is to implement Boolean logic, which is a form of algebra used to model the behaviour of digital circuits.

Boolean logic defines two values, 0 and 1, to represent false and true, respectively. Logic gates use these values to perform operations such as AND, OR, NOT, NAND, NOR, XOR, and XNOR. Each of these operations corresponds to a different logic gate, which implements the operation in hardware.
​
The outputs of logic gates can be used as inputs to other logic gates, allowing complex circuits to be built from simple components. This makes logic gates a fundamental component of modern computing, as they are used in a wide range of digital devices, from microcontrollers and embedded systems to computers and servers.
The purpose of logic gates is to perform basic logical operations on binary inputs and produce a binary output, which can be used to build complex digital circuits and implement Boolean logic.

NOTE: At IB level you do not need to remember the shape of the logic gate when illustrating a circuit, you can simply draw a circle and label it.
SECTION 2 | TRUTH TABLES
A truth table is a table used in logic to represent the output of a logic gate or combination of logic gates for all possible combinations of inputs. The truth table lists all possible input combinations and the corresponding output of the logic gate for each combination. The output is typically represented using binary digits, where a 1 represents true or high voltage and a 0 represents false or low voltage. The truth table allows for easy evaluation of the logical function performed by the gate, as well as identifying any errors or inconsistencies in the gate's behaviour. Truth tables are an important tool in designing and analysing digital circuits.
SECTION 3 | LOGIC EXPRESSIONS
A logic expression is a mathematical representation of a logical function, typically defined using Boolean algebra. It represents the relationship between inputs and outputs in a logic circuit, and can be used to describe the behavior of a logic gate or a more complex digital system. Logic expressions can be written using logical operators such as AND, OR, and NOT, and variables that represent the input and output signals of the circuit. The expression is evaluated to determine the output of the circuit based on the input signals.
SECTION 4 | LOGIC GATES
THE NOT GATE
The NOT gate is the only gate with just one input. The NOT gate simply reverses the input, if the input is ON then the OUTPUT is OFF, if the input is OFF then the output is on.
The image below illustrates a NOT gate, it is the circle that symbolises the NOT and this circle is also used on other gates discussed later. Below is also the truth table for the NOT gate.
Picture
NOT GATE
Picture
NOT GATE TRUTH TABLE
The NOT gate can be represented in Boolean Algebra by placing a combining overbar over the values to pass through a NOT gate, so NOT A can be represented as Ā
THE OR GATE
The OR gate will give an output value of ON if any of the inputs are ON.
The OR gate can be viewed as the mathematical equivalent of addition. 
A + 0 = A
A + A = A
0 + 0 = 0
A + Ā = 1
Notably different from normal mathematics as in boolean logic the above shows the the sum of a variable will equal the variable, for example 1 + 1 = 1
Picture
OR GATE
Picture
OR GATE TRUTH TABLE
THE NOR GATE
The NOR Gate or NOT OR Gate will have an output if none of the inputs are 1. The NOR gate has a circle on the output to define the NOT part of the gate. You can see this as the opposite of an OR gate.
Picture
NOR GATE
Picture
NOR GATE TRUTH TABLE
THE AND GATE
The AND gate will only give an output when both inputs are ON, in other works input one AND input two need to be ON to make the output ON.
The AND gate can be viewed are the mathematical equivalent to multiplication.
A x 0 =  0
A x 1 = A
​A x A = A
A x Ā = 0
Picture
AND GATE
Picture
AND GATE TRUTH TABLE
THE NAND GATE
The NAND Gate or NOT AND Gate will have an output when the two inputs are not ON. Or with a three input NAND gate when all 3 inputs are not ON.
Picture
THE NAND GATE
Picture
NAND GATE TRUTH TABLE
THE XOR GATE
The XOR gate or eXclusive OR will only produce an output it the two inputs are different values.
Picture
XOR TRUTH TABLE
Picture
THE XOR GATE
SECTION 5 | LOGIC CIRCUITS
Logic gates form the basis of how computers work and they are in most items of technology we use in our everyday lives. By combining logic gates we can create complex logic circuits to perform an unlimited number of tasks. Here we will look an an example of how logic circuits are used in a baby monitor which uses logic gates to help alert parents when their baby is crying or needs attention.

A logic circuit can be used in a baby monitor to turn on an alarm when either an audio sensor or a motion sensor are triggered and the monitor is currently switched on.
To create the logic circuit for this, we can use an OR gate to combine the signals from the audio sensor and motion sensor, and an AND gate to ensure the alarm only works when it is actually switched on.
The logic circuit can be expressed as:
X = (A OR B) AND C
Where:
  • A represents the signal from the audio sensor
  • B represents the signal from the motion sensor
  • C represents the signal from the switch
  • X represents the output signal that triggers the alarm

In this circuit, the OR gate outputs a high signal when both A or B inputs are high. This means that the alarm will  be triggered when either the audio sensor or motion sensor detect activity.
The AND gate then combines this result with the switch signal, which allows the user to turn the monitor on and off. This means that the alarm will not be triggered if the switch is turned off, even if both the audio sensor and motion sensor detect activity.
By using logic gates to combine the signals from multiple sensors and a switch, we can create a circuit that triggers an alarm only when specific conditions are met, making the baby monitor more reliable and effective.

​The truth table for the logic expression for the baby monitor would be as follows:
Picture
The logic circuit for the baby monitor would be as follows:
Picture
Remember to list binary in a logical order when completing your truth table.  Listing binary in a logical order is important when completing truth tables because it helps to ensure that all possible combinations of inputs are considered and that the resulting outputs are accurate. In a truth table, the binary digits represent the possible combinations of input values for the logic circuit being analysed.
​
By listing the binary in a logical order, such as in ascending or descending order, it makes it easier to identify all possible combinations of input values without missing any or repeating any. This ensures that the truth table is complete and accurate, which is essential for analysing the behaviour of the logic circuit.
Additionally, listing binary in a logical order helps to maintain consistency and clarity throughout the truth table, which makes it easier to read and interpret the results. It also helps to avoid errors or confusion when analysing the circuit or designing a new circuit based on the truth table.

Picture
  1. Using AND and OR gates, create a circuit and truth table for the expression (A AND B) OR (C AND D).
  2. What is the output of an OR gate when both inputs are 0? Provide a truth table to support your answer.
  3. Using NOT, AND and OR gates, create a circuit and truth table for the expression NOT (A AND B) OR C.
  4. What is the output of a NAND gate when both inputs are 1? Provide a truth table to support your answer.
  5. A traffic light system has three lights: red, yellow, and green. The lights are controlled by a circuit that uses NOT, AND, and OR gates. Create a logic expression, truth table, and circuit for the traffic light system, such that the lights change from red to green, with a brief yellow interval, and then back to red.
Picture
ALSO IN THIS TOPIC
COMPUTER ARCHITECTURE
SECONDARY MEMORY
OPERATING SYSTEMS
BINARY REPRESENTATION
LOGIC GATES
TOPIC 2 REVISION | NEW
KEY TERMINOLOGY
TOPIC 2 ANSWERS
Picture
SUGGESTIONS
We would love to hear from you
SUBSCRIBE 
To enjoy more benefits
We hope you find this site useful. If you notice any errors or would like to contribute material then please contact us.