This demonstrates the operation of the five Boolean logic gates (AND, OR, NAND, NOR, XOR) used by computers for mathematical computation.
Step 1: Setup
No setup is need for this app as no peripherals are used.
Step 2: Running the app
Navigate to the Logic app and press Button B to run
What is showing on the Home screen?
- Top: Name of app
- Middle: Graphic of gate.
- When inputs at P4 and P5 are ON, a “1” will appear instead of “0”
- When the logic contained within the gate is satisfied [IF p4 AND P5 are both ON; then P2 will be ON in the case shown in the screenshot above]. then P2 will be turned ON, and the “0” will be replaced with “1”.
- Bottom: Button A is Exit, and Buttons C and D turn P4 and P5 ON and OFF respectively. Button B switches the screen to show the next gate.
Step 3: Using the app
- Press Button C to turn P4 ON. The green LED on the front of the Kookaberry will light and “1” will appear at P4. There will be no output at P2
- Press Button D to turn P5 ON. The amber LED will light as well as the red because the gate has determined that the logic is correct to turn on P2 as well.
- Press Button D to turn P5 ON. The amber LED on the front of the Kookaberry will light as well as the red (P2) because the gate has determined that the logic is correct to turn on P2 as well.
- Press Button again to turn P5 OFF and then press Button C to turn P4 ON. The green and red LED’s will light. Same logic- same result
- Press Buttons C and D to turn both P4 and P5 ON. All the LED’s will light – including red which indicates that the OR logic will turn P2 ON when there the two inputs (P3 and P4) are both ON. If we want an output at P2 ONLY if there is an input at either P$ or P5 (but not both at once) we need an Exclusive OR (XOR) gate – which is the fifth of our gates (see below)
- Press Button C to turn P4 ON. The green and red LED’s on the front of the Kookaberry will light – indicating that P2 is also ON.
- Press Button D to turn P5 ON. The amber LED will light as well as the green but not the red – indicating that P2 is OFF. This is therefore NOT the AND gate – which is why it is called a NAND gate.
[You can work this one out by yourselves including why it is called a NOR gate!]
This is the Exclusive OR gate described in the description of the OR gate above.