Lesson Plan

Lesson Plan
Grade: Date: 17/01/2026
Subject: Computer Science
Lesson Topic: Show understanding of how bit manipulation can be used to monitor/control a device
Learning Objective/s:
  • Describe how individual bits can represent device inputs and outputs.
  • Explain the purpose of bit masks and how to create them using left‑shift.
  • Apply bitwise operators (&, |, ~, ^) to read, set, clear, and toggle device signals in code.
  • Combine multiple masked flags to implement conditional control logic.
Materials Needed:
  • Projector and screen for slides.
  • Computer with Python or C IDE.
  • Printed handout of bitwise operator table and mask examples.
  • Microcontroller development board (e.g., Arduino) with LEDs and switches.
  • Breadboard and jumper wires.
Introduction:
Begin with a quick demonstration of an LED array controlled by a single byte, asking students how many devices can be managed simultaneously. Recall previous work on binary numbers and logical operators. Today they will learn to use bit manipulation to monitor and control hardware, and will be able to write code that reads sensor flags and drives actuators.
Lesson Structure:
  1. Do‑now (5') – binary‑to‑decimal conversion worksheet.
  2. Mini‑lecture (10') – review bitwise operators and mask creation with projector.
  3. Guided practice (15') – create masks for LED0, LED1, SW0, SW1 and use & and | in the IDE.
  4. Hands‑on activity (20') – program the microcontroller to read switch states and toggle LEDs on a breadboard.
  5. Check for understanding (5') – quick quiz on interpreting masked expressions.
Conclusion:
Summarise the four‑step process of identifying bits, building masks, applying operators, and preserving other bits. Students complete an exit ticket describing how they would detect an over‑temperature alarm using a mask. For homework, they will write pseudo‑code to handle a different sensor register using the techniques learned.