memory

Logic Gates

Logic, Boolean algebra, logic gates, logic circuits... it's all the same. If you know your logic, you can program almost anything you can dream of.

Interact with the live gates below to understand their mechanics, and then test your skills on the real-world assignments.

Buffer
NOT
AND
OR
XOR
Buffer Gate
A buffer simply passes its input to the output without change. Used to boost signal strength or add intentional delay.
BUF
Input A
OUTPUT
0
Input A Output
0 0
1 1

Real World Assignments

Logic tasks can be solved using the browser software Logic.ly to simulate the circuits.

Task 1 Traffic Lights
expand_more

You have been asked to program traffic lights at an intersection.

  • Program two traffic lights so that when one light turns green, the other will always be red, and vice versa.
Solution 1
Task 2 Gate Control
expand_more

A customer wants a smart system for their garage.

  • License plate recognition installed at the entrance opens the garage door when they drive in.
  • A button inside the garage opens the door from the inside when they leave.
  • Program a solution that opens the garage door whenever either the button or the recognition is activated.
Solution 2
Task 3 Home Alarm System
expand_more

Your customer wants a simple alarm system for their home, with the ability to disable the alarm. The home has 6 windows with glass break detectors, and 1 door with a contact.

  • If any of the glass break detectors is triggered, an alarm should sound.
  • If the door contact is triggered, an alarm should also sound.
  • The alarm should NOT sound if it is disarmed using a code or button.
Solution 3
Task 4 Parking Garage Access
expand_more

A company issues two types of access cards: guest cards and employee cards.

  • Employees always have access to the parking garage (24/7).
  • Guests have access only on weekdays, during working hours.
Solution 4
Task 5 Outdoor Lighting
expand_more

The customer wants to increase energy savings and daily comfort with automated outdoor lighting and a garden gate that remains unlocked for deliveries.

  • Outdoor lights should turn on automatically at dusk.
  • Outdoor lights should turn off automatically after midnight.
  • Outdoor lights should turn on if it’s dark and the garden gate is opened.
  • Outdoor lights should NOT turn on if it’s daylight, even when the garden gate is opened.
Solution 5
Task 6 Building Automation
expand_more

Your customer has a large building with fire alarm (ABA), intrusion alarm (AIA), and KNX installations, all integrated into a Building Management System (BMS).

  • In case of fire, all doors and grilles should open completely to allow evacuation and fire department access.
  • In case of a break-in, the building should go into lockdown (all doors and grilles locked).
  • The fire department should be notified in the event of a fire.
  • G4S should be alerted in the event of a break-in.
  • In case of a false alarm on either system, a technician should be called.
Solution 6
Task 7 Folding Walls in Conference Room
expand_more

A hotel has a large hall with three lighting zones. They recently installed two new folding walls to divide the hall into three separate rooms.

  • Automate the system to split the lighting controls so each switch controls its respective lighting zone when walls are closed.
  • Allow for flexibility: If only one wall is closed (creating one large and one small room), the lighting controls should adjust to match this configuration.
Solution 7
Task 8 Smart Home Automation
expand_more

A family wants to automate their lights, thermostat, and security cameras for energy efficiency and security.

  • When no one is home: All lights off, thermostat off, cameras activated.
  • When someone is home: Lights on, thermostat adjusts to presets, cameras turned off.
  • If a break-in alarm triggers: All lights turn on, thermostat turns off, cameras activate (overriding the "someone is home" rules).
Solution 8
Task 9 Access Control for Laboratory
expand_more

A laboratory needs an access control mechanism with three specific clearance levels.

  • Regular employees have access only during working hours (07:00 to 16:00).
  • Managers have access on weekdays at any time (but not on weekends or holidays).
  • Technicians always have access (24/7/365).
  • If a person without an access card attempts to enter, an alarm should be triggered.
Solution 9
Task 10 Intelligent Lighting Control
expand_more

An office building wants to optimize energy consumption by implementing intelligent lighting control.

  • When no one is present, lights should automatically turn off.
  • If motion is detected, lights should automatically turn on.
  • If there is enough natural daylight, lights should turn off (regardless of motion detection).
  • Lights should be scheduled to turn on before the workday begins and off after working hours.
Solution 10

History of logic gates