Digital Technologies · Logic gates and Boolean algebra
Logic gates and truth tables
Switch the inputs of AND, OR, NOT, NAND, NOR and XOR gates and build each truth table.
- Curriculum: Digital Technologies, Logic gates and Boolean algebra
- Class: SSS 1 – SSS 2
- For WAEC, NECO practicals
- Readings, table
- Quiz with answers explained
Start this experimentAll Digital Technologies experiments
Aim
To investigate the behaviour of the basic logic gates and construct their truth tables.
Apparatus
- Logic gate ICs or a logic trainer board
- Switches for the inputs
- LED for the output
- 5 V supply
Theory
A logic gate takes binary inputs (0 = off/low, 1 = on/high) and gives one binary output.
- AND: output is 1 only when all inputs are 1.
- OR: output is 1 when at least one input is 1.
- NOT: output is the opposite of the input.
- NAND and NOR are AND and OR followed by NOT.
- XOR: output is 1 when the inputs are different.
Procedure
- Choose a gate.
- Set inputs A and B to 0 and 0 and note whether the lamp lights.
- Record the row, then try 0 1, 1 0 and 1 1.
- Repeat for every gate.
- In Results, check which truth tables are complete.
What you do in the virtual lab
Set up the apparatus on screen, take readings and record them in a table (Gate; A; B; Output; Boolean expression). Simulated instruments give slightly different readings each time, as real ones do. Finish with a short quiz; every answer is explained.
Teachers can set the experiment for a class, see each student’s results and use it as a WAEC- or NECO-style practical paper in exam practice.
Practice questions
Which gate gives an output of 1 only when both inputs are 1?
- AND
- OR
- NOR
- XOR
Show the answer
A. AND AND needs every input to be 1.
The output of a NAND gate with inputs A = 1 and B = 1 is
- 1
- 2
- 0
- undefined
Show the answer
C. 0 AND gives 1, and NAND inverts it to 0.
An XOR gate gives 1 when
- both inputs are 0
- both inputs are 1
- the inputs are the same
- the inputs are different
Show the answer
D. the inputs are different Exclusive OR is true when exactly one input is 1.
Related Digital Technologies experiments
- Binary, octal and hexadecimalFlip eight bit-switches to see how computers store numbers, then hit target values in binary.
- Programming a robot: sequence and loopsWrite a program of moves and turns to steer a robot to its goal, then shorten it with a loop.
- How strong is a password?Test made-up passwords, measure their strength in bits and see how long an attacker would need to guess them.
- Spreadsheet formulas and functionsUse cell references, SUM, AVERAGE, MAX and IF to complete a shop sales record and a class result sheet.
- Coding in PythonWrite real Python – print, variables, loops and if statements – and have each program checked automatically.
- Train a simple AITeach a computer to tell ripe plantain from unripe by giving it labelled examples, then test how accurate it is.