Web Development and Web Design
What is a Logic Gate; The AND Gate; The OR Gate; The NOT Gate; How Gates Combine Inside a Computer; Logic Gate Principles; Truth Tables for AND, OR and NOT; Combined Gate Circuits: NAND, NOR and XOR
On this page12 sections
- 01Learning Objectives
- 02Starter Scenario
- 03What is a Logic Gate
- 04The AND Gate
- 05The OR Gate
- 06The NOT Gate
- 07How Gates Combine Inside a Computer
- 08Logic Gate Principles
- 09Truth Tables for AND, OR and NOT
- 10Combined Gate Circuits: NAND, NOR and XOR
- 11Practical Work
- 12Scenario-Based Questions
Learning Objectives
- Explain what a logic gate is and how it uses bits.
- State the rule of the AND, OR and NOT gates.
- Draw truth tables for the basic gates.
- Describe how gates are combined in a computer.
Starter Scenario
A school laboratory will only let a computer start when two conditions are both true, the door key card is inserted and the power switch is on. If either one is missing, the computer stays off. This is a real world AND decision, because both conditions must be true together. In a computer, a small circuit called an AND gate makes exactly this kind of choice.
What is a Logic Gate
A logic gate is a small electronic circuit that takes one or more inputs, each being 0 or 1, and gives a single output, also 0 or 1. Because every part of a computer stores data as bits, gates are the building blocks that move and combine those bits. The three basic gates are AND, OR and NOT. Each follows a fixed rule, no matter what it is connected to, and its rule can be shown in a truth table. Computers contain millions of gates packed onto a tiny silicon chip, and by combining many gates the computer can add numbers, compare values and follow instructions.
The AND Gate
An AND gate has two inputs and one output. Its rule is simple. The output is 1 only when both inputs are 1. In any other case the output is 0. The AND rule is like two switches in one room light circuit. The bulb lights, giving output 1, only when both switches are on, because the electricity must pass through both. The truth table for an AND gate shows four rows for all possible input combinations. When both inputs are 0, the output is 0. When input A is 0 and input B is 1, the output is 0. When input A is 1 and input B is 0, the output is 0. When both inputs are 1, the output is 1.
Everyday AND decisions include taking your book home only if it is at school and it is your book. A bus departs only when all passengers are seated and the door is closed. You hand in your drawing only when it is finished and your name is on it. In each example both conditions must be true at once, which is exactly what an AND gate checks.
The OR Gate
An OR gate has two inputs and one output. Its rule is that the output is 1 when at least one of the inputs is 1. The output is 0 only when both inputs are 0. The OR gate is like two switches joined in parallel, where either switch on its own completes the path and lights the bulb. The truth table for an OR gate shows that when both inputs are 0 the output is 0. When input A is 0 and input B is 1, the output is 1. When input A is 1 and input B is 0, the output is 1. When both inputs are 1, the output is 1.
Everyday OR decisions include entering the park if you have a ticket or a staff card. A pupil stays for the club if it is raining or if her ride is late. You can pay with cash or with transfer at the market stall. In each case only one true condition is enough, which is the heart of the OR gate.
The NOT Gate
A NOT gate has only one input and one output. Its rule is to flip the value, so a 0 becomes 1 and a 1 becomes 0. It is sometimes called an inverter. The NOT gate is like a light that is on when the switch is off, and off when the switch is on, always showing the opposite of what you expect. The truth table for a NOT gate has just two rows. When the input is 0, the output is 1. When the input is 1, the output is 0.
How Gates Combine Inside a Computer
When the output of one gate feeds into the input of the next, the gates work in a chain. You can trace a signal through the chain, deciding the value at each step using the truth tables. For example, take the output of an AND gate and feed it into a NOT gate. If the AND gives 1, the NOT then gives 0, and if the AND gives 0, the NOT gives 1. The combined circuit gives the opposite of the AND result.
Gates are built into the processor chip, the memory and many other parts of a computer. Their tiny size lets millions of them fit on one chip, and the speed of their switching controls how fast the computer works. Addition is a good example. A simple binary adder is made by connecting a few AND, OR and NOT gates, and the same gate building blocks appear again and again in circuits that compare numbers, follow rules and store values. For learners, the key idea is that there is no magic in a computer, only many simple gates arranged in clever ways to make bigger decisions.
Logic Gate Principles
Logic gates are the fundamental building blocks of every digital circuit inside a computer. A logic gate is a small electronic circuit that takes one or more binary inputs, each either 0 or 1, and produces a single binary output according to a fixed rule. By combining millions of these simple gates on a silicon chip, computers perform complex calculations and make decisions.
There are three basic logic gates: AND, OR and NOT. The AND gate produces 1 only when both inputs are 1. The OR gate produces 1 when at least one input is 1. The NOT gate takes a single input and reverses it, turning 0 into 1 and 1 into 0.
Each gate has one or more inputs and exactly one output.
Gate outputs depend only on the current inputs, not on past values.
Gates are combined in circuits to perform arithmetic, logic and control tasks inside the CPU.
Truth Tables for AND, OR and NOT
A truth table is a simple chart that shows every possible combination of inputs for a logic gate and the resulting output. Truth tables list all outcomes without leaving anything out, making them the most reliable way to understand how a gate behaves.
The AND gate truth table has four rows because each of the two inputs can be 0 or 1. The output is 1 only when both inputs are 1. The OR gate truth table also has four rows, with output 1 in three of them, because it activates when at least one input is 1. The NOT gate has just two rows, because it has one input that it simply flips.
AND truth table: output is 1 only when both inputs are 1.
OR truth table: output is 1 when at least one input is 1.
NOT truth table: output is the opposite of the single input.
Combined Gate Circuits: NAND, NOR and XOR
When basic gates are connected together, they form new gates with different behaviour. A NAND gate is an AND gate followed by a NOT gate. It produces 0 only when both inputs are 1. A NOR gate is an OR gate followed by a NOT gate. It produces 1 only when both inputs are 0.
An XOR gate, short for Exclusive OR, produces 1 when the inputs are different and 0 when they are the same. XOR gates are used in arithmetic circuits inside the CPU for binary addition. A half adder uses one XOR gate and one AND gate to add two single-bit numbers.
NAND gate output is 0 only when both inputs are 1.
NOR gate output is 1 only when both inputs are 0.
XOR gate output is 1 when inputs are different, 0 when they are the same.
| Gate | Inputs | Output Rule |
|---|---|---|
| AND | Two | 1 only when both are 1 |
| OR | Two | 1 when at least one is 1 |
| NOT | One | Always the opposite (flip) |
Practical Work
- Draw the truth table for the AND gate.
- Draw the truth table for the OR gate.
- Draw the truth table for the NOT gate.
- Trace the output of an AND gate fed into a NOT gate for every pair of inputs.
Scenario-Based Questions
- A school door has a lock that opens only when two conditions are both true, the teacher inserts the key and the teacher enters the correct PIN. Name the logic gate that represents this rule and write its truth table.
- A traffic light system turns on the pedestrian signal if button A is pressed OR button B is pressed. Name the gate, write its truth table, and explain why only one button needs to be pressed.
- A security camera sends a 1 signal when there is NO movement in the restricted zone, so it can focus on that area. Name the gate being used and explain what happens to the output when the input changes from 0 to 1.
- A teacher sets a rule: a pupil scores 1 if the homework is submitted on time AND the work is neat. Two pupils, Tunde and Emeka, submit on time but Tunde's work is neat while Emeka's is not. Predict the output for each pupil and name the gate.
- An alarm rings when the door sensor reads 1 OR the window sensor reads 1 OR the fire sensor reads 1. Name the type of gate needed and explain why at least one input must be 1 for the alarm to ring.
- A lab computer starts only when the power switch is ON and the network cable is plugged in and the login is correct. Draw a simple diagram showing three AND gates feeding into a final output.
- A pupil says a NOT gate has two inputs. Correct this and explain what a NOT gate actually does, giving one example from everyday life.
LEARNING OBJECTIVES: BY THE END OF THE LESSON PUPILS SHOULD BE ABLE TO:
| Cognitive | i. Explain what a logic gate is and how it uses bits. ii. State the rule of the AND, OR and NOT gates. iii. Draw truth tables for the basic gates. iv. Describe how gates are combined in a computer. |
| Affective | i. Appreciate the value of Logic Gates in school, at home and in the community. ii. Show willingness to use digital tools carefully, safely and responsibly. |
| Psychomotor | i. Draw the truth table for the AND gate. ii. Draw the truth table for the OR gate. iii. Draw the truth table for the NOT gate. iv. Trace the output of an AND gate fed into a NOT gate for every pair of inputs. |
Rationale: A logic gate is a small electronic circuit that takes one or more inputs, each being 0 or 1, and gives a single output, also 0 or 1. Understanding starter Scenario, what is a Logic Gate, the AND Gate, the OR Gate helps learners use digital technology confidently, safely and responsibly.
Pre-requisite Knowledge: In Week 6, learners studied Binary Numbers and Data Representation, including bits and Bytes, reading Binary Place Values, converting Between Binary and Decimal. The knowledge from that week is used again in this lesson.
Learning Material/Teaching Aid: Whiteboard, markers, computer or laptop where available, printed notes and charts on Logic Gates, practical task sheets, learners' notebooks and pens.
Reference Materials: Digital Technology for Junior Secondary Schools (JSS 3); NERDC Digital Technology Curriculum; Digital Technology JSS 3 First Term Notes (Week 7); First Term examination and Continuous Assessment question papers.
LESSON DEVELOPMENT
| Stage/Step (Time) | Teacher's Activities | Student's Activities | Learning Points |
|---|---|---|---|
| Introduction 5 MINUTES | Welcomes learners, revises Week 6 (Binary Numbers and Data Representation) with two quick oral questions, and asks what they already know about Logic Gates. Elicits responses and writes the topic on the board. | Recall the previous lesson and share what they already know about Logic Gates. | Connecting prior knowledge to Logic Gates. |
| Step 1 6 MINUTES | Covers Starter Scenario: A school laboratory will only let a computer start when two conditions are both true, the door key card is inserted and the power switch is on. Covers What is a Logic Gate: A logic gate is a small electronic circuit that takes one or more inputs, each being 0 or 1, and gives a single output, also 0 or 1. Covers The AND Gate: An AND gate has two inputs and one output. | Listen, take notes and answer oral questions on "Starter Scenario" and related points. | Understanding: Starter Scenario; What is a Logic Gate; The AND Gate. |
| Step 2 6 MINUTES | Covers The OR Gate: An OR gate has two inputs and one output. Its rule is that the output is 1 when at least one of the inputs is 1. Covers The NOT Gate: A NOT gate has only one input and one output. Its rule is to flip the value, so a 0 becomes 1 and a 1 becomes 0. | Copy the key points, give examples from school and everyday life, and ask questions on "The OR Gate" and related points. | Understanding: The OR Gate; The NOT Gate. |
| Step 3 6 MINUTES | Covers How Gates Combine Inside a Computer: When the output of one gate feeds into the input of the next, the gates work in a chain. You can trace a signal through the chain, deciding the value at each step using the truth tables. Covers Logic Gate Principles: Logic gates are the fundamental building blocks of every digital circuit inside a computer. A logic gate is a small electronic circuit that takes one or more binary inputs, each either 0 or 1, and produces a single binary output according to a fixed rule. | Discuss in pairs, then report one point on "How Gates Combine Inside a Computer" and related points to the class. | Understanding: How Gates Combine Inside a Computer; Logic Gate Principles. |
| Step 4 6 MINUTES | Covers Truth Tables for AND, OR and NOT: A truth table is a simple chart that shows every possible combination of inputs for a logic gate and the resulting output. Truth tables list all outcomes without leaving anything out, making them the most reliable way to understand how a gate behaves. Covers Combined Gate Circuits: NAND, NOR and XOR: When basic gates are connected together, they form new gates with different behaviour. A NAND gate is an AND gate followed by a NOT gate. | Respond to questions, complete the examples on the board and note down "Truth Tables for AND, OR and NOT" and related points. | Understanding: Truth Tables for AND, OR and NOT; Combined Gate Circuits: NAND, NOR and XOR. |
| Practical Work 6 MINUTES | Guides learners through the practical work: (i) Draw the truth table for the AND gate. (ii) Draw the truth table for the OR gate. (iii) Draw the truth table for the NOT gate. Moves round the class to check progress and correct unsafe or careless use. | Carry out the practical tasks individually or in pairs and record what they did in their notebooks. | Applying the lesson through hands-on practice. |
| Evaluation 3 MINUTES | Asks learners to: i. Explain what a logic gate is and how it uses bits. ii. State the rule of the AND, OR and NOT gates. iii. Draw truth tables for the basic gates. iv. Describe how gates are combined in a computer. | Respond verbally and in writing to the evaluation questions. | Assessment and consolidation of the lesson content. |
| Conclusion 2 MINUTES | Recaps the main points: starter Scenario, what is a Logic Gate, the AND Gate, the OR Gate, the NOT Gate. Links them to the assignment and previews Week 8: Algorithms and Flowcharts. | Listen, ask questions and copy the assignment. | Reinforcement of key concepts and a preview of the next lesson. |
Assignment: i. A school door has a lock that opens only when two conditions are both true, the teacher inserts the key and the teacher enters the correct PIN. Name the logic gate that represents this rule and write its truth table. ii. A traffic light system turns on the pedestrian signal if button A is pressed OR button B is pressed. Name the gate, write its truth table, and explain why only one button needs to be pressed.
On this page9 sections
- 01Lesson objectives
- 02Key vocabulary
- 03Common misconceptions
- 04Teacher activities
- 05Student activities
- 06Practical / learning evidence
- 07Resources and preparation
- 08Assessment for learning
- 09Inclusion and homework
Lesson objectives
By the end of the week, learners should be able to:
- Define HTML and explain its role as the structure of web pages.
- Name at least five HTML tags and describe each role.
- Build a simple webpage using headings, paragraphs and lists.
- Add a hyperlink to link sections within one page.
- Save the HTML file and open it in a browser.
Key vocabulary
- HTML: markup language defining page structure.
- Tag: a labelled instruction such as <h1>.
- Heading: a title tag used for hierarchy.
- Paragraph: a container for flowing text.
- List: bulleted or numbered items made of list tags.
- Hyperlink: a link connecting one page to another.
- Structure: the skeletal layout of content.
- Markup language: a language describing content via tags.
- Browser: software rendering HTML into visible pages.
Common misconceptions
- "HTML is the same as the web." HTML is one markup language among many; the web includes CSS and JavaScript too.
- "Every tag carries its own behaviour." Tags mostly carry structure; behaviour comes from scripting and styling.
- "An HTML page needs no closing tag." Every opening tag needs a matching closing tag in well-formed HTML.
Teacher activities
- Starter: show a heading and a paragraph and ask which carries structure.
- Define HTML and name five tags one by one with a brief description.
- Demonstrate building a simple webpage with headings, paragraphs and lists.
- Add a hyperlink linking one page to another.
- Save the HTML file and open it in a browser to confirm.
- Close with the build-your-own-page task and exit question.
Student activities
- Choose the structure carrier from the starter and explain the reason.
- Define HTML in their own words and name five tags with descriptions.
- Build a simple webpage with headings, paragraphs and lists.
- Add a hyperlink linking one page to another.
- Save the HTML file under a clear filename and reopen it to confirm.
- Answer the exit question in one sentence about HTML versus the web.
Practical / learning evidence
A saved HTML file with headings, paragraphs, lists and one hyperlink, plus an inspection checklist confirming the browser renders it. Submit the file and checklist for marking.
Resources and preparation
Computers with a text editor and a browser, blank templates and sample HTML. Check the editor opens cleanly and that browsers render HTML instantly. Disable Caps Lock before typing. Verify the computer starts reliably.
Assessment for learning
Inspect the saved HTML for correct opening and closing tags. Check the inspection checklist for browser rendering confirmation. Ask a learner to describe the difference between HTML and CSS behaviour. Flag any learner who thinks HTML runs on its own.
Inclusion and homework
Provide the template with sample HTML prebuilt so learners focus on structure. Allow extra time for saving and reopening. Extend confident learners with three tags and a second homework listing real websites built with HTML alone. Homework: add one heading, one paragraph and one list to an existing HTML page.