AQA · GCSE · Computer Science
Course version: 8525 · Version from Sept 2020
Boolean operations in a programming language: NOT
NOT is a unary Boolean operator: it takes a single Boolean value and reverses it.
Checked against the AQA 8525 specification (opens in a new tab) on .
- Point 2 of 4
Study notes
From the checked teaching notes for this specification point.
The idea
NOT is a unary Boolean operator: it takes a single Boolean value and reverses it. NOT true gives false and NOT false gives true. Because it works on one operand, it is applied before binary operators such as AND and OR unless brackets change the order, so NOT A AND B means (NOT A) AND B. In code it is often written as NOT, ! or a similar keyword depending on the language. It is useful for negating a condition, for example looping while NOT finished, or testing that a value is not equal to something. When evaluating an expression, work out the NOT of each operand first, then combine with AND and OR using their truth tables. Remember NOT never changes a value into anything other than the opposite Boolean.
What earns the marks
- Identifies NOT as a unary operator acting on a single Boolean operand.
- States that NOT reverses the value: NOT true is false and NOT false is true.
- Applies NOT before AND and OR unless brackets dictate otherwise.
- Evaluates a compound expression correctly by negating operands first, then combining with AND/OR truth tables.
- Recognises practical uses such as negating a condition or testing inequality.
Common mistakes and how to put them right
Treating NOT as a binary operator needing two operands.
Put it right: Is that NOT is unary and takes one value.
Applying NOT after AND/OR in an unbracketed expression.
Put it right: Is that NOT binds more tightly and is applied first.
Thinking NOT changes a value to zero or an empty string.
Put it right: Is that NOT returns the opposite Boolean value only.
Exam tips
- Write out the truth table for NOT before tackling a compound expression.
- Insert brackets to show the order of evaluation when NOT combines with AND or OR.
- Check each operand's Boolean value first, then apply NOT, then combine.
Try the lesson
The start of the Boolean operations in a programming language: NOT lesson, made from checked teaching notes for this specification point.
Have a go first
A Boolean variable loggedIn has the value True. What is the value of NOT loggedIn?
There is more to this lesson
The full lesson goes on to check your understanding and help you earn the marks. Create a free account to carry on, with your progress saved.
A week of Premium from your first lesson · Then the free plan continues · No card, no charge
Test your understanding of Boolean operations in a programming language: NOT
Active recall beats re-reading. Take an instant quiz now to test what you’ve learned and lock it into long-term memory.
A week of Premium from your first lesson · Then the free plan continues · No card, no charge