Logic Gates
Logic gates are the building blocks of digital circuits that take binary inputs and give a single binary output.
▶ Interact
Play with the controls to see the idea in action.
📘 Learn
Logic gates are the building blocks of digital circuits that take binary inputs and give a single binary output.
- AND needs both inputs to be 1
- OR needs at least one input to be 1
- NOT flips the input
🧠 Quick quiz
Three questions. Score 2 or more to complete the topic.
What is Logic Gates?
Within Computer Science, which covers algorithms, programming, data, networks, hardware and safe, responsible use of technology, this topic explains Logic Gates. Computing topics explain how software, hardware and data work, with diagrams and models that show each step in order.
Check that you can explain Logic Gates in your own words and give one example from everyday life. If you can do that, you have understood the core idea.
Understanding Logic Gates helps you design, test and explain programs, websites and systems, from small projects to exam questions.
Logic Gates in detail
Logic gates are the building blocks of digital circuits, performing basic logical operations on binary inputs. A NOT gate inverts its input, an AND gate outputs 1 only if both inputs are 1, an OR gate outputs 1 if at least one input is 1, and XOR outputs 1 if the inputs differ. NAND and NOR are the inverses of AND and OR.
Each gate has a standard symbol. Combining gates builds circuits that add numbers, store data and make decisions, and processors contain billions of them built from transistors. Boolean expressions describe the logic, such as Q = A AND (NOT B).
How the interactive helps you understand Logic Gates
Watch the binary display in the interactive. Use any sliders or buttons it offers to change the values and see how the binary display responds.
Before you change anything, predict the result. Then change one value at a time and check whether your prediction was right. This is a quick way to build a correct mental model of Logic Gates.
Real-life uses and examples
- Explain Logic Gates to someone new to computing by comparing it to a familiar process.
- Trace through a process that uses Logic Gates to check what it does step by step.
- Recognise Logic Gates in an app or device you use every day.
Common mistakes to avoid
- Using the term without being able to say what the computer actually does.
- Testing only the normal case and forgetting the edge cases.
- Learning the definition without testing it. Use the quiz and the interactive to check that you can apply the idea.
Frequently asked questions about Logic Gates
What is Logic Gates?
Logic gates are the building blocks of digital circuits that take binary inputs and give a single binary output.
What are the most important points about Logic Gates?
The main points are: AND needs both inputs to be 1; OR needs at least one input to be 1; NOT flips the input.
Why is Logic Gates useful?
Understanding Logic Gates helps you design, test and explain programs, websites and systems, from small projects to exam questions.
How can I practise Logic Gates?
Open the interactive at the top of this page and change the controls one at a time. Predict the result before each change, then take the three-question quiz. A score of two or more marks the topic as complete on this device.
Which topics are related to Logic Gates?
Related topics in Computer Science include Flowcharts, Pattern Recognition, Operators and Expressions.