Computer Science Class 11: Boolean logic and truth tables

Boolean logic gives Computer Science Class 11 students a precise way to describe conditions that are either true or false. It sits behind database filters, if-statements, search controls and digital circuits, so learning it connects abstract symbols with real computing. Australian schools usually call the equivalent stage Year 11, and a student using Pakistani course material may be working across both systems: Years 11 and 12 requirements vary by state and territory, while the underlying Boolean principles remain the same.

A structured set of subject explanations, solved examples and practice questions on exam preparation notes can provide the lesson sequence, while an Australian teacher or tutor checks alignment with the local syllabus. The aim is not to memorise symbols alone; students should translate an English condition, evaluate it accurately and explain why each output is true or false.

Core ideas behind Boolean logic

A proposition is a declarative statement that can be evaluated as true or false. “The file has been saved” is a proposition because it has a definite truth value at a particular moment; “Save the file” is an instruction. Questions and commands are not propositions. In Boolean work, T and F may be written as 1 and 0, while a letter such as A represents the condition “the user is enrolled.”

The three core operators are AND, OR and NOT. AND is true only when every condition is true, as in “enrolled AND has a valid device.” OR is true when at least one condition is true, such as “uses the library OR has a printed pass.” NOT reverses a proposition, turning “account is active” into “account is not active.” Combining operators lets one statement represent a decision that would otherwise need several sentences.

Operator precedence fixes the order of evaluation: NOT acts first, AND second and OR last. Parentheses override that order, so A AND (B OR C) differs from (A AND B) OR C. Two expressions are logically equivalent when they produce matching outputs for every possible input. Useful checks include double negation, A OR A = A, and De Morgan’s rules, which convert NOT over an AND into an OR of negated inputs, and vice versa.

Building and reading truth tables

A truth table records every possible input and the resulting output. For one proposition, the two rows are T and F. For two propositions, the four rows are TT, TF, FT and FF; for three, all eight combinations appear. Begin by naming the input variables, listing one complete combination on each row, and evaluating the expression from the innermost brackets outwards. A disciplined layout prevents a result from being copied into the wrong row.

Consider A AND (NOT B OR C). When A is 0, the outer AND forces the result to 0 in all four rows. When A is 1, evaluate the bracket: for B, C equal to 0, 0 the result is 1; for 0, 1 it is 1; for 1, 0 it is 0; and for 1, 1 it is 1. Following the standard order 000, 001, 010, 011, 100, 101, 110, 111, the outputs are 0, 0, 0, 0, 1, 1, 0, 1. The intermediate column makes the final result checkable rather than a guess.

Common errors include changing the order of rows, applying NOT only to the nearest symbol, and reading an OR as if it were an AND. Another useful method is a sanity check: evaluate the expression with all inputs 0, all inputs 1 and selected mixed rows, then confirm that a final NOT reverses every output. With n independent propositions, there are 2^n rows, so a four-variable expression needs 16 rows even when the final expression looks simple.

From expressions to logic gates

A logic gate is the physical implementation of a Boolean operator. An AND gate passes a high signal only when all its inputs are high; an OR gate does so when any input is high; a NOT gate inverts its single input. In diagrams, wires carry signals, gates process them and an output wire carries the decision. These same symbols appear in electronics, embedded systems and circuit diagrams for computers.

NAND and NOR are called universal gates because combinations of either can construct every other Boolean function. XOR produces 1 when its two inputs differ, which makes it useful for parity checks and the sum output of a half-adder; the half-adder’s carry output is A AND B. Knowing whether a question asks for a gate, a truth table or an expression helps students avoid confusing the symbol with the operation it represents.

Boolean conditions also appear in website permissions and promotional rules, so judging their structure is a useful digital-literacy skill. An unrelated page such as high volatility pokies may make claims built from conditions about eligibility or risk; a logically formed statement is still not reliable evidence for a school assignment. Australian law combines the federal Interactive Gambling Act 2001 with state and territory licensing and advertising rules, and people under 18 cannot gamble legally.

Logic in programming and everyday technology

In programming, Boolean values control which branch a computer follows. An English requirement such as “the student is signed in and the submission is before the deadline” becomes signed_in AND before_deadline. OR can provide an alternative route, while NOT excludes an unwanted case. For students travelling on trains or buses in Sydney and Melbourne, downloadable notes and a school-managed laptop make it practical to test these patterns in a lightweight code editor before class.

Logic is also physical. Breadboards, LEDs, switches and standard gate chips are sold through Australian electronics retailers such as Jaycar, making small experiments possible beyond a screen. A switch supplies input values, a gate implements the operator and an LED shows the output. Building a simple night-light or alarm makes errors visible: a wrongly wired NOT gate can reverse the intended decision even when the Boolean expression is correct.

The same judgement applies to online revision material. A result advertising a prepaid card casino bonus may be unrelated to the syllabus, while search ranking gives it no authority. Students should check the publisher, syllabus match, date and worked reasoning before using a source. If a page teaches the operator but uses an unsuitable example, extract the general rule and replace the example with one about access, safety or study.

Compare, practise, and apply Boolean logic

A compact comparison clarifies the standard behaviour of each gate:

Gate Symbol Output is 1 when Typical use
AND A ∧ B Both inputs are 1 Controlling access
OR A ∨ B At least one input is 1 Providing alternative choices
NOT ¬A The input is 0 Reversing a condition
XOR A ⊕ B The two inputs differ Parity and half-adder sums
NAND ¬(A ∧ B) It is not the case that both are 1 Universal-gate construction
NOR ¬(A ∨ B) Neither input is 1 Universal-gate construction

Revision works best when symbols are repeatedly connected to decisions rather than learned in isolation. Use this sequence:

Today’s concrete next step is to draw the eight-row truth table for A OR (B AND NOT C) before your next study session, then check each row from the innermost brackets outwards.