NAND, NOR, XOR — Composite Logic
Logic Gates
Author: Mark Higgins
© Mark Anthony Higgins 11 October 2025
Revised Date: 20 April 2026
NAND, NOR, and XOR gates are composite logic components formed by combining basic logic operations. They extend the functionality of simple gates, enabling more complex conditions and behaviours within digital systems.
In physical terms, these gates integrate AND, OR, and NOT operations to produce new logical relationships. Within a structured flow perspective, composite gates are understood as higher-order transformations—elements that combine multiple logic rules into a single functional unit.
This flow reframes composite gates as building blocks for advanced logic systems. They allow more expressive conditions and are essential for constructing complex circuits and computational structures.
By viewing composite gates as structured logic expansions, systems can be analysed in terms of how simple rules combine to produce complex behaviour. This perspective is essential for understanding digital circuit design, optimisation, and computational architecture.
This page includes an executable teaching flow that can run inside any modern AI system (ChatGPT, Google AI, Claude, and others). It is designed to teach the concept interactively and adapt to your level of understanding.
The more you interact (ask questions, answer checks, request examples), the better the system adapts to you.
Flow: CompositeLogic_NAND_NOR_XOR_v1_0
Purpose:
Model NAND, NOR, and XOR gates as composite logic operators derived from basic gates, enabling structured teaching of combined logic behaviour, inversion, and conditional relationships in digital systems.
System:
S = (I, R, B, K)
----------------------------------------
Teaching Directive
----------------------------------------
Execution_Mode:
Teaching
Audience:
Beginner to Intermediate learner
Teaching_Flow:
Explain → Visualise → Formalise → Apply
Instruction:
- Begin with intuitive explanation that composite gates combine basic logic operations
- Explain NAND as NOT-AND, NOR as NOT-OR, and XOR as exclusive condition logic
- Relate each gate to real-world decision behaviour
- Introduce binary inputs and outputs
- Reinforce with truth tables and comparisons
Constraints:
H = ∅
Clarity before formalism
Goal:
Student understands that:
- composite gates combine basic logic functions
- NAND and NOR include inversion of AND and OR
- XOR outputs HIGH only when inputs differ
- these gates expand logical control capabilities
----------------------------------------
State
----------------------------------------
I = {
input_A,
input_B,
logical_inputs,
output_value,
gate_type,
signal_levels,
system_context,
time_state
}
----------------------------------------
Rules
----------------------------------------
R = {
detect_input_states,
identify_gate_type,
apply_composite_logic,
determine_output_state,
propagate_output_signal,
update_gate_state
}
----------------------------------------
Boundaries
----------------------------------------
B = {
inputs_must_be_binary,
valid_gate_type_required,
logical_mapping_defined,
no_unphysical_intermediate_states_in_ideal_model,
output_must_follow_defined_logic_function
}
----------------------------------------
Invariants
----------------------------------------
K = {
NAND_output_is_inverse_of_AND,
NOR_output_is_inverse_of_OR,
XOR_output_is_1_when_inputs_differ,
XOR_output_is_0_when_inputs_are_same,
binary_logic_values_in_set_0_or_1,
gate_behaviour_is_deterministic,
composite_logic_extends_basic_gate_behaviour
}
----------------------------------------
Execution
----------------------------------------
E_t = expand(I, R)
V_t = {
x ∈ E_t | x satisfies (B ∧ K)
}
Selection:
x* = argmax_(x ∈ V_t) P(x | I, R, B, K)
Update:
I_(t+1) = update(I_t, x*)
----------------------------------------
Output
----------------------------------------
O = composite_logical_output | (B, K)
----------------------------------------
Failure Condition
----------------------------------------
V_t = ∅ ⇒ O = FAIL
Meaning:
If no valid inputs or gate definition can be established, no coherent composite logic output can be evaluated.
----------------------------------------
Interpretation
----------------------------------------
Composite logic gates combine basic logical operations to produce more complex behaviour.
A NAND gate outputs LOW only when all inputs are HIGH, acting as the inverse of an AND gate. A NOR gate outputs HIGH only when all inputs are LOW, acting as the inverse of an OR gate. An XOR gate outputs HIGH only when the inputs are different, representing exclusive logic.
These gates are essential building blocks in digital systems, enabling complex decision-making, control logic, and computation.
----------------------------------------
Core Relations
----------------------------------------
NAND = NOT (A AND B)
NOR = NOT (A OR B)
XOR = A ≠ B
----------------------------------------
Derived Relations
----------------------------------------
NAND truth table:
A B | Output
0 0 | 1
0 1 | 1
1 0 | 1
1 1 | 0
NOR truth table:
A B | Output
0 0 | 1
0 1 | 0
1 0 | 0
1 1 | 0
XOR truth table:
A B | Output
0 0 | 0
0 1 | 1
1 0 | 1
1 1 | 0
----------------------------------------
Teaching Outcome
----------------------------------------
Student can:
- Understand NAND, NOR, and XOR logic behaviour
- Interpret composite gate truth tables
- Explain inversion and exclusive conditions
- Apply composite logic in digital circuits
- Recognise their role in building complex systemsVoltage represents the difference in electrical potential between two points—the driving force behind all circuit behaviour.
This section frames voltage as a structured gradient, showing how energy conditions are established, compared, and measured across a system.
Current is the realised movement of charge through a conductive path—the observable expression of system activity.
Here, current is explored as a continuous flow, revealing how charge propagates, how paths constrain movement, and how flow defines system dynamics.
Resistance defines how a system constrains and shapes the movement of charge.
This section examines resistance as an opposition flow—where material structure, geometry, and conditions regulate how easily current can pass.
Power captures the rate at which energy is transferred within a system.
This section explores how voltage and current combine to produce real energy flow, revealing how systems do work, dissipate energy, and operate over time.