Skip to content

F1 · Boolean Logic and F2 · Flow Charts

Spec reference: Sections F1 and F2 - Logic and Data Flow Key idea: Use Boolean logic and flow charts to represent and solve data flow problems in computer systems.


Boolean logic

Boolean logic uses two values: TRUE (1) and FALSE (0). All decisions in a computer system are made using combinations of these values.

Logic gates

GateSymbol descriptionOperationTruth table
ANDBoth inputs must be 1A AND BOutput is 1 only if A=1 AND B=1
ORAt least one input is 1A OR BOutput is 1 if A=1 OR B=1 (or both)
NOTInverts the inputNOT AOutput is 1 if A=0; output is 0 if A=1
NANDAND followed by NOTNOT(A AND B)Output is 0 only if both A=1 AND B=1
NOROR followed by NOTNOT(A OR B)Output is 1 only if both A=0 AND B=0
XORExclusive ORA XOR BOutput is 1 if inputs are different

Truth tables

AND gate:

ABA AND B
000
010
100
111

OR gate:

ABA OR B
000
011
101
111

NOT gate:

ANOT A
01
10

XOR gate:

ABA XOR B
000
011
101
110

Boolean expressions

Logic can be written as expressions:

ExpressionMeaning
AB or A AND BAND
A+B or A OR BOR
A or NOT ANOT

Example: A security door opens if the user has a valid card AND the PIN is correct AND it is not outside working hours.

Open=ValidCardCorrectPINOutsideHours

Boolean laws

LawExpression
IdentityA+0=A, A1=A
NullA+1=1, A0=0
IdempotentA+A=A, AA=A
ComplementA+A=1, AA=0
De Morgan'sAB=A+B, A+B=AB

De Morgan's theorem

De Morgan's is commonly tested. It says: the NOT of an AND is the same as the OR of the NOTs. And vice versa.


Flow charts and system diagrams

Flow charts represent the step-by-step logic of a process or system visually.

Flow chart symbols

SymbolShapeUsed for
TerminatorRounded rectangleSTART and END
ProcessRectangleAn operation or calculation
DecisionDiamondA yes/no question branching the flow
Input/OutputParallelogramReading input or displaying output
Flow arrowArrowShows the direction of flow

Flow chart rules

  • Every flow chart must have exactly one START and at least one END.
  • Decision diamonds must have exactly two labelled exits: Yes and No (or True and False).
  • Compass arcs must remain visible in exam constructions.
  • Flow charts should be unambiguous: every path must eventually lead to an END.

Example: Login system

START
  |
  v
Input username and password
  |
  v
<Valid credentials?> --No--> Display error message --> END
  | Yes
  v
Grant access
  |
  v
END

System diagrams

System diagrams show how data flows between different components of a system. They are used to represent:

  • Input sources and output destinations.
  • Processes that transform data.
  • Storage components.
  • Communication links between systems.

Data flow diagram (DFD) notation:

  • Rectangle: External entity (person, system).
  • Rounded rectangle / oval: Process.
  • Open rectangle (two parallel lines): Data store.
  • Arrow: Data flow, labelled with the data being transferred.

Exam approach

When asked to draw or complete a flow chart, check that every decision has two clearly labelled exits and that every path leads to a terminator. Missing labels or dangling arrows lose marks.


Summary

TermMeaning
AND gateOutput is 1 only when all inputs are 1
OR gateOutput is 1 when at least one input is 1
NOT gateInverts the input
XOR gateOutput is 1 when inputs are different
De Morgan's theoremNOT(A AND B) = (NOT A) OR (NOT B)
Decision diamondFlow chart symbol for a yes/no branch
DFDDiagram showing how data flows through a system

Test Yourself

Ad

PassMaven - revision made simple.