Track progress, take quizzes and save notes on this lesson.

Free forever · no card needed

Start free
Intermediate

Logic Gates and Circuits

4.6.4 Logic gates

Aligned to the AQA 7517 specification

Level
Intermediate
Reading time
5 min
Published
13 June 2026
Updated
1 July 2026
On this page
  1. 1.Logic Gates
  2. 2.Reading and Drawing Circuits
  3. 3.Half Adder
  4. 4.Full Adder
  5. 5.D-type Flip-Flop
  6. 6.Common Exam Mistakes

Key takeaways

  • OR outputs 1 when at least one input is 1, while XOR outputs 1 only when the inputs are different, so XOR(1,1) = 0; the half adder Sum uses XOR, not OR.
  • NAND is AND followed by NOT (output 0 only when both inputs are 1); NOR is OR followed by NOT (output 1 only when both inputs are 0).
  • A half adder adds two single bits with Sum = A XOR B and Carry = A AND B; it is called half because it has no carry-in input and cannot chain for multi-bit addition.
  • A full adder adds two bits plus a carry-in, producing a Sum and a carry-out, and can be chained (n full adders) to add two n-bit binary numbers.
  • A D-type flip-flop stores one bit: output Q takes the value of D only on a rising clock edge and otherwise holds its previous value, making it the building block of sequential circuits.

Logic Gates

Logic gates are the basic building blocks of digital circuits. Each gate takes one or more binary inputs (0 or 1) and produces a single binary output according to a fixed logical rule.

Six fundamental gates — you must know their truth tables and ANSI/IEEE symbols:

NOT (Inverter)

ANOT A
01
10

Boolean: or . Flips the input.

AND

ABA AND B
000
010
100
111

Boolean: . Output is 1 only when both inputs are 1.

OR

ABA OR B
000
011
101
111

Boolean: . Output is 1 when at least one input is 1.

XOR (Exclusive OR)

ABA XOR B
000
011
101
110

Boolean: . Output is 1 when inputs are different.

NAND (NOT AND)

ABA NAND B
001
011
101
110

Boolean: . AND followed by NOT. Output is 0 only when both inputs are 1.

NOR (NOT OR)

ABA NOR B
001
010
100
110

Boolean: . OR followed by NOT. Output is 1 only when both inputs are 0.

Reading and Drawing Circuits

Logic gates are connected in circuits to implement more complex Boolean functions. Each gate's output can feed into another gate's input.

Example circuit — two gates in sequence:

AND followed by NOT (NAND)ABANDNOTX

Boolean expression: — this is a NAND.

Completing a truth table for a circuit:

Circuit:

ABCA AND BX = (A AND B) OR C
00000
00101
01000
01101
10000
10101
11011
11111

Method: add intermediate columns for each gate's output, working left to right through the circuit. Never try to evaluate the whole expression in one column.

Half Adder

A half adder adds two single bits (A and B) and produces two outputs: a Sum bit and a Carry bit.

ABSum (A XOR B)Carry (A AND B)
0000
0110
1010
1101

Circuit: one XOR gate (Sum) and one AND gate (Carry), both taking A and B as inputs.

Why "half"? It has no carry-in input. It can add two bits but cannot chain together to add multi-bit numbers without modification.

Full Adder

A full adder adds two bits (A and B) plus a carry-in () — allowing it to be chained for multi-bit addition. It produces a Sum and a carry-out ().

ABSum
00000
00110
01010
01101
10010
10101
11001
11111

A full adder is built from two half adders and an OR gate. Chain full adders together to add two -bit binary numbers.

Studying this for an exam?

Generate a personalised learning path for this subject. Free to get started.

Create a learning path

D-type Flip-Flop

A D-type flip-flop is a simple memory element — it stores one bit. Unlike combinational logic (which depends only on current inputs), a flip-flop has state that persists until changed.

Behaviour:

  • Has a Data input (D) and a Clock input (CLK)
  • Output Q changes only on a rising edge (low→high transition) of the clock signal
  • At the rising clock edge: Q takes the value of D at that moment
  • Between clock edges: Q holds its previous value regardless of D
CLK edgeDQ (after edge)
Rising ↑00
Rising ↑11
No edgeanyQ unchanged

Why it matters: flip-flops are the fundamental building block of sequential circuits — registers, counters, memory cells. They allow circuits to remember and store information between clock cycles.

Common Exam Mistakes

1. Confusing XOR and OR

OR outputs 1 when at least one input is 1 (including when both are 1). XOR outputs 1 only when inputs are different — so XOR(1,1) = 0, not 1. For the half adder Sum, it is XOR, not OR.

2. Forgetting intermediate columns in circuit truth tables

For a three-gate circuit, you need at least one intermediate column. Trying to evaluate the whole expression in one step leads to errors — show your working gate by gate.

3. Confusing NAND and NOR

NAND = AND then NOT (output is 0 only when all inputs are 1). NOR = OR then NOT (output is 1 only when all inputs are 0). Remember: NAND's all-ones input gives 0; NOR's all-zeros input gives 1.

4. Confusing the half adder's Sum and Carry gates

Sum = XOR (adds the bits modulo 2). Carry = AND (set only when 1+1 overflows). The exam regularly asks you to state the Boolean expressions — memorise both.

Key terms

Logic gate
A basic building block of digital circuits that takes one or more binary inputs and produces a single binary output according to a fixed logical rule.
AND gate
A gate whose output (A AND B) is 1 only when both inputs are 1.
OR gate
A gate whose output (A OR B) is 1 when at least one input is 1.
XOR gate
A gate whose output (A XOR B) is 1 only when the inputs are different.
NAND gate
An AND gate followed by NOT (NOT(A AND B)); its output is 0 only when both inputs are 1.
NOR gate
An OR gate followed by NOT (NOT(A OR B)); its output is 1 only when both inputs are 0.
Half adder
A circuit that adds two single bits, producing Sum = A XOR B and Carry = A AND B, with no carry-in input.
Full adder
A circuit that adds two bits plus a carry-in, producing a Sum and a carry-out, and can be chained for multi-bit addition.
D-type flip-flop
A memory element that stores one bit, where output Q takes the value of input D on a rising clock edge and otherwise holds its previous value.
Sequential circuit
A circuit, such as a register, counter, or memory cell, built from flip-flops that can remember and store information between clock cycles.

Frequently asked questions

OR outputs 1 when at least one input is 1, including when both are 1. XOR outputs 1 only when the inputs are different, so XOR(1,1) = 0, not 1. For the half adder Sum it is XOR, not OR.

A half adder adds two single bits A and B, producing Sum = A XOR B and Carry = A AND B, but has no carry-in. A full adder adds two bits plus a carry-in, producing a Sum and a carry-out, so it can be chained to add multi-bit binary numbers.

A D-type flip-flop has a Data input D and a Clock input CLK. Output Q takes the value of D only on a rising (low to high) edge of the clock, and between clock edges Q holds its previous value regardless of D, giving it state that persists.

Generate revision on any topic you study

Type any topic you're studying and Aicademy generates a complete lesson, quiz, and flashcard set, personalised to your level.

Lessons on anything

Structured, level-matched lessons on any topic you study

Practice quizzes

Find out what you actually know before the exam does

Flashcard sets

Lock in key concepts with instant revision cards

Ask Aica

Stuck on something? Get a clear explanation, any time

Prev

Programming Languages and Translators

Next

Boolean Algebra

Related lessons

Top students don’t revise more. They revise what counts.

Start revising free

Free to start. No card needed.