HelpContactFor teachers and institutes
>_StemPy Lab
Mock TestsClasses

>_StemPy Lab

Learn. Solve. Code the solutions. Test yourself.

Live examsFree mock exams, timed and rankedEveryone starts together, and your score and rank come the moment it ends.See the exams →

Learn

  • Physics
  • Chemistry
  • Mathematics
  • Biology
  • Python Programming
  • Statistics & Data Science
  • Computer Science
  • Classes
  • Groups

Practice

  • Problems
  • Quizzes
  • Mock Tests
  • Prepare for an Exam
  • Question Sets
  • Exams
  • Certificates
  • Python Labs
  • AI Practice Generator
  • Student-Created Tests

Community

  • Discussions
  • Resources
  • Notes
  • Glossary
  • Blog

Account

  • Log in
© 2026 senLearn. All rights reserved.HelpFor SchoolsAboutContactPrivacy PolicyTerms of UseRefund Policy
  1. Problems
  2. /A street lamp is controlled by a light sensor L through a NOT gate…
EasyComputer ScienceHigh School (9–10)Computer Science › Boolean LogicConceptualNumericalIGCSE

A street lamp is controlled by a light sensor L through a NOT gate…

StemPy LabContributed by StemPy Lab

Try it on paper first. A hint, the key idea and the worked solution are here when you need them.

A street lamp is controlled by a light sensor L through a NOT gate. The sensor gives 1 when it is light and 0 when it is dark. The lamp X is on when the output of the NOT gate is 1.

The sensor reads, once an hour for seven hours, 1, 1, 1, 0, 0, 0, 1.

  1. Write the logic expression for the lamp.
  1. For how many of the seven hours is the lamp on?
  1. What is the output of the NOT gate when the sensor reads 1?

Check your answer

Work it out on paper, then type your number. The answer itself stays hidden.

Need a reminder? The key ideaShowHide

A logic gate takes inputs of 0 or 1 and gives one output of 0 or 1. NOT gives the opposite of its one input: X = NOT A. NOT is the only gate with one input; every other gate in the syllabus has two. A truth table lists every input combination with its output.

The worked solution

Have you tried it?

Work it out on paper first. It is fine to get stuck or make a mistake: that is how we learn. When you are ready, go through the solution one step at a time, and check each step against your own.

Plan. The lamp follows X = NOT L. It is on exactly when the sensor reads 0.

Step 1. The expression. X = NOT L.

Step 2. Count the hours. The readings are 1, 1, 1, 0, 0, 0, 1. Three of them are 0, so the lamp is on for 333 hours.

Step 3. The sensor reads 1. NOT 1 = 0, so the lamp is off.

Check. It is light for the first three hours and the last hour, and the lamp is off then. That makes sense for a street lamp.

Answer: (a) X = NOT L. (b) 333 hours. (c) 000.

Log in to save this for later
← All Problems
← A restaurant stores its staff in a table Staff…A student has to learn the six logic gate symbols of the syllabus: NOT, AND, OR, NAND, NOR and XOR… →
More onComputer Science › Boolean Logic

Discussion (0)

Log in to join the discussion.

Loading…

Learn it in

  1. Logic gates and the NOT gateNOT, AND and OR Gates

More on this topic

  1. A truth table with inputs A, B and C has the output column 0, 1, 0, 1, 0, 1, 0, 0 in the usual row…Hard
  2. A water heater has a safety cut-out. The cut-out switches the heater off (X = 1) when the water is…Hard
  3. A logic analyser records X for every input pattern of A, B and C, from 0 0 0 up to 1 1 1: 0, 0, 0…Medium
A lift moves (X = 1) when its door is shut (S = 1) and a button is pressed…Easy
  • A traffic-light controller contains the circuit drawn below…Hard
  • All problems on this topic →