Appearance
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
| Gate | Symbol description | Operation | Truth table |
|---|---|---|---|
| AND | Both inputs must be 1 | A AND B | Output is 1 only if A=1 AND B=1 |
| OR | At least one input is 1 | A OR B | Output is 1 if A=1 OR B=1 (or both) |
| NOT | Inverts the input | NOT A | Output is 1 if A=0; output is 0 if A=1 |
| NAND | AND followed by NOT | NOT(A AND B) | Output is 0 only if both A=1 AND B=1 |
| NOR | OR followed by NOT | NOT(A OR B) | Output is 1 only if both A=0 AND B=0 |
| XOR | Exclusive OR | A XOR B | Output is 1 if inputs are different |
Truth tables
AND gate:
| A | B | A AND B |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
OR gate:
| A | B | A OR B |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 1 |
NOT gate:
| A | NOT A |
|---|---|
| 0 | 1 |
| 1 | 0 |
XOR gate:
| A | B | A XOR B |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
Boolean expressions
Logic can be written as expressions:
| Expression | Meaning |
|---|---|
| AND | |
| OR | |
| NOT |
Example: A security door opens if the user has a valid card AND the PIN is correct AND it is not outside working hours.
Boolean laws
| Law | Expression |
|---|---|
| Identity | |
| Null | |
| Idempotent | |
| Complement | |
| De Morgan's |
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
| Symbol | Shape | Used for |
|---|---|---|
| Terminator | Rounded rectangle | START and END |
| Process | Rectangle | An operation or calculation |
| Decision | Diamond | A yes/no question branching the flow |
| Input/Output | Parallelogram | Reading input or displaying output |
| Flow arrow | Arrow | Shows 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
ENDSystem 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
| Term | Meaning |
|---|---|
| AND gate | Output is 1 only when all inputs are 1 |
| OR gate | Output is 1 when at least one input is 1 |
| NOT gate | Inverts the input |
| XOR gate | Output is 1 when inputs are different |
| De Morgan's theorem | NOT(A AND B) = (NOT A) OR (NOT B) |
| Decision diamond | Flow chart symbol for a yes/no branch |
| DFD | Diagram showing how data flows through a system |