Logic Circuits II (Alternative logic gates)
Download the Lessonotes Mobile Nigeria 2025 app for faster lesson access on Android and iPhone.
Subject: Computer & IT
Class: Senior Secondary 2
Term: 3rd Term
Week: 1
Theme: Computer Hardware
This page supports the lesson note with a companion video and a short classroom-ready summary.
For class groups and homework, share this lesson page so learners also get the summary, objectives, and full lesson context.
Describe alternative logic gates. List types of alternative logic gates Identify symbols of each logic gate Recognize and state the in/out put signals of each logic gate Construct truth table for each logic gate. Write simple equation for each logic gate State the uses of logic gates Construct a simple comparator using XOR
they are the same (0,0 or 1,1) and '0' when they are different (0,1 or 1,0). This is precisely the function of an XNOR gate (which is an XOR gate followed by a NOT gate).
Construction for Equality (1-bit): If we use an XOR gate, the output `Q = A ⊕ B`. If Q = 0, it means A and B are equal. If Q = 1, it means A and B are not equal.
Therefore, an XOR gate itself can act as a simple "inequality comparator". If we want an explicit "equality" output (1 for equal, 0 for unequal), we simply invert the output of the XOR gate, effectively making it an XNOR gate.
Diagram: ``` A ---|= |--- Output_Unequal (Q) | | B ---|__| ``` If Output_Unequal (Q) = 0, then A =
B. If Output_Unequal (Q) = 1, then A ≠
B. For an explicit "Output_Equal": ``` A ---|= O |--- Output_Equal | | B ---|___| ``` This is an XNOR gate. If Output_Equal = 1, then A = B. If Output_Equal = 0, then A ≠ B. This section provides in-depth explanations for the teacher to deliver the lesson comprehensively.
Introduction to Alternative Logic Gates: Alternative logic gates are digital logic gates that perform specific Boolean functions, similar to basic gates (AND, OR, NOT).
However, they are often referred to as "universal gates" (NAND and NOR) because any other logic gate can be constructed using only one type of these gates. XOR and XNOR gates are also alternative gates, performing unique "exclusive" operations. They are derived from combinations of basic gates but are represented by their own distinct symbols for simplicity and efficiency in circuit design.
Types of Alternative Logic Gates:
1. NAND Gate (NOT-AND Gate): Description: The NAND gate is a combination of an AND gate and a NOT gate. Its output is HIGH (1) if any of its inputs is LOW (0). The output is LOW (0) only if all its inputs are HIGH (1). It is essentially an AND gate with an inverted output.
Symbol: The standard symbol is an AND gate symbol with a small circle (inversion bubble) at its output. ``` A ---| |--- Q | & O | B ---|_____| ``` (Where 'O' represents the inversion bubble)
Boolean Expression (Equation): For two inputs A and B, the output Q is: `Q = (A . B)'` or `Q = NOT (A AND B)` (The prime or apostrophe denotes inversion).
Truth Table (for 2-input NAND Gate): | Input A | Input B | A . B (AND) | (A . B)' (NAND Output Q) | | :------ | :------ | :---------- | :------------------------ | | 0 | 0 | 0 | 1 | | 0 | 1 | 0 | 1 | | 1 | 0 | 0 | 1 | | 1 | 1 | 1 | 0 | In/Out Put Signals: Input (0, 0) -> Output (1) Input (0, 1) -> Output (1) Input (1, 0) -> Output (1) Input (1, 1) -> Output (0)
Universality: Any basic logic gate (AND, OR, NOT) can be constructed using only NAND gates.
2. NOR Gate (NOT-OR Gate): Description: The NOR gate is a combination of an OR gate and a NOT gate. Its output is HIGH (1) only if all of its inputs are LOW (0). The output is LOW (0) if any of its inputs is HIGH (1). It is an OR gate with an inverted output.
Symbol: The standard symbol is an OR gate symbol with a small circle (inversion bubble) at its output. ``` A ---|> |--- Q | O | B ---|____| ``` (Where 'O' represents the inversion bubble)
Boolean Expression (Equation): For two inputs A and B, the output Q is: `Q = (A + B)'` or `Q = NOT (A OR B)` Truth Table (for 2-input NOR Gate): | Input A | Input B | A + B (OR) | (A + B)' (NOR Output Q) | | :------ | :------ | :--------- | :---------------------- | | 0 | 0 | 0 | 1 | | 0 | 1 | 1 | 0 | | 1 | 0 | 1 | 0 | | 1 | 1 | 1 | 0 | In/Out Put Signals: Input (0, 0) -> Output (1) Input (0, 1) -> Output (0) Input (1, 0) -> Output (0) Input (1, 1) -> Output (0)
Universality: Any basic logic gate (AND, OR, NOT) can be constructed using only NOR gates.
3. Exclusive OR Gate (XOR Gate): Description: The XOR gate produces a HIGH (1) output only when its inputs are different. If the inputs are the same (both LOW or both HIGH), the output is LOW (0). It acts as a single-bit inequality detector.
Symbol: Similar to an OR gate, but with an additional curved line at the input. ``` A ---|= |--- Q | | B ---|__| ``` Boolean Expression (Equation): For two inputs A and B, the output Q is: `Q = A ⊕ B` or `Q = A'B + AB'` (A NOT B OR A B NOT) *Truth HIGH (1) output only when its inputs are different. If the inputs are the same (both LOW or both HIGH), the output is LOW (0). It acts as a single-bit inequality detector.
Symbol: Similar to an OR gate, but with an additional curved line at the input. ``` A ---|= |--- Q | | B ---|__| ``` Boolean Expression (Equation): For two inputs A and B, the output Q is: `Q = A ⊕ B` or `Q = A'B + AB'` (A NOT B OR A B NOT)
Truth Table (for 2-input XOR Gate): | Input A | Input B | Output Q (A ⊕ B) | | :------ | :------ | :--------------- | | 0 | 0 | 0 | | 0 | 1 | 1 | | 1 | 0 | 1 | | 1 | 1 | 0 | In/Out Put Signals: Input (0, 0) -> Output (0) Input (0, 1) -> Output (1) Input (1, 0) -> Output (1) Input (1, 1) -> Output (0)
4. Exclusive NOR Gate (XNOR Gate): Description: The XNOR gate is the complement of the XOR gate. It produces a HIGH (1) output only when its inputs are the same (both LOW or both HIGH). If the inputs are different, the output is LOW (0). It acts as a single-bit equality detector.
Symbol: The standard symbol is an XOR gate symbol with a small circle (inversion bubble) at its output. ``` A ---|= O |--- Q | | B ---|___| ``` (Where 'O' represents the inversion bubble)
Boolean Expression (Equation): For two inputs A and B, the output Q is: `Q = (A ⊕ B)'` or `Q = A ◎ B` or `Q = AB + A'B'` (A AND B OR A NOT AND B NOT)
Truth Table (for 2-input XNOR Gate): | Input A | Input B | A ⊕ B (XOR) | (A ⊕ B)' (XNOR Output Q) | | :------ | :------ | :---------- | :----------------------- | | 0 | 0 | 0 | 1 | | 0 | 1 | 1 | 0 | | 1 | 0 | 1 | 0 | | 1 | 1 | 0 | 1 | In/Out Put Signals: Input (0, 0) -> Output (1) Input (0, 1) -> Output (0) Input (1, 0) -> Output (0) Input (1, 1) -> Output (1)
Uses of Logic Gates: Logic gates are the fundamental building blocks of all digital electronic circuits.
Their applications are widespread: Computers and Microprocessors: Forming arithmetic logic units (ALUs), memory cells, control units.
Control Systems: Automated industrial processes, traffic light controllers, automated security gates.
Communication Systems: Data encoding/decoding, error detection/correction.
Household Appliances: Washing machines, microwave ovens, remote controls.
Security Systems: Alarm systems, access control systems.
Digital Comparators: For comparing two binary numbers (e.g., checking if two values are equal). Data Selectors (Multiplexers) and De-selectors (Demultiplexers).
Flip-flops and Registers: Essential for memory storage. Constructing a Simple Comparator using XOR Gate: A digital comparator is a combinational logic circuit that compares two binary numbers and determines whether they are equal, or if one is greater than the other. A simple 1-bit comparator determines if two single bits (A and B) are equal or not.
Concept: The XOR gate inherently performs an inequality check. Its output is '1' if inputs are different, and '0' if inputs are the same.
Equality Check: To determine if two bits are equal, we need an output of '1' when they are the same (0,0 or 1,1) and '0' when they are different (0,1 or 1,0). This is precisely the function of an XNOR gate (which is an XOR gate followed by a NOT gate).
Construction for Equality (1-bit): If we use an XOR gate, the output `Q = A ⊕ B`. If Q = 0, it means A and B are equal. If Q = 1, it means A and B are not equal.
Therefore, an XOR gate itself can act as a simple "inequality comparator".
Resources: Whiteboard/chalkboard, markers/chalk, prepared diagrams of logic gate symbols and truth tables, projector (if available), worksheets, optionally a simple logic gate simulator (online or software).
Introduction (5-7 minutes): Teacher Activity: Begin by briefly reviewing basic logic gates (AND, OR, NOT) from previous lessons. Ask students to recall their symbols, truth tables, and Boolean expressions. Emphasize that these gates are the foundation.
Student Activity: Students respond to questions, recall definitions, and potentially draw symbols of basic gates.
Development - Part 1: NAND and NOR Gates (20-25 minutes): Teacher Activity: Introduce NAND gate as a "NOT-AND" gate. Draw the NAND gate symbol clearly on the board, pointing out the AND part and the inversion bubble.
Explain its function: "Output is 0 only if ALL inputs are 1; otherwise, it's 1." Construct the 2-input truth table for NAND gate step-by-step, relating it to the AND truth table first and then inverting the output. Write the Boolean expression `Q = (A . B)'`. Repeat the process for the NOR gate, explaining it as "NOT-OR." Draw the NOR gate symbol, explain its function: "Output is 1 only if ALL inputs are 0; otherwise, it's 0." Construct its 2-input truth table, relating it to the OR truth table and then inverting. Write the Boolean expression `Q = (A + B)'`. Briefly explain the concept of "universality" for NAND and NOR gates, stating that any basic gate can be made from them. (Detailed construction can be an extension activity).
Student Activity: Observe and listen attentively. Copy symbols, truth tables, and Boolean expressions for NAND and NOR gates into their notebooks. Ask clarifying questions. Actively participate in constructing truth tables by suggesting outputs for given inputs.
Development - Part 2: XOR and XNOR Gates (20-25 minutes): Teacher Activity: Introduce the XOR gate as "Exclusive OR." Draw the XOR gate symbol, highlighting the unique input curve.
Explain its function: "Output is 1 only if the inputs are DIFFERENT; output is 0 if inputs are the SAME." Construct its 2-input truth table. Write the Boolean expression `Q = A ⊕ B` or `Q = A'B + AB'`. Repeat the process for the XNOR gate as "Exclusive NOR" or "NOT-XOR." Draw the XNOR gate symbol (XOR with inversion bubble).
Explain its function: "Output is 1 only if the inputs are THE SAME; output is 0 if inputs are DIFFERENT." Construct its 2-input truth table, relating it to the XOR truth table and then inverting. Write the Boolean expression `Q = (A ⊕ B)'` or `Q = A ◎ B` or `Q = AB + A'B'`.
Student Activity: Observe and listen. Copy symbols, truth tables, and Boolean expressions for XOR and XNOR gates. Engage in predicting outputs based on input conditions.
Development - Part 3: Uses of Logic Gates & Comparator (15-20 minutes): Teacher Activity: Discuss the general importance of logic gates as building blocks of digital systems. Brainstorm with students real-life applications in Nigeria, linking to technology they see (e.g., traffic lights, automated gate openers at offices, mobile phones). Focus on the concept of a digital comparator. Explain that an XOR gate can be used as a simple 1-bit inequality detector (output 1 if different, 0 if same). Explain that an XNOR gate (XOR + NOT) acts as a simple 1-bit equality detector (output 1 if same, 0 if different). Draw the simple comparator circuit using an XOR gate (for inequality) and an XNOR gate (for equality).
Student Activity: Contribute ideas for real-life applications of logic gates. Understand the concept of a comparator. Draw the simple XOR/XNOR comparator circuit. Ask questions about how these gates are used in specific devices.
Conclusion (5 minutes): Teacher Activity: Recap the main points: four alternative logic gates, their unique functions, symbols, truth tables, and key applications. Emphasize their importance in digital electronics. Assign homework if applicable.
Student Activity: Ask any remaining questions. Pack up materials.
Automated Car Park/Toll Gate Barrier Control (e.g., at Muritala Mohammed International Airport or toll plazas): Logic gates are used to manage the barrier. Sensors detect a vehicle's presence (input 1), payment confirmation is received (input 2). An AND gate would ensure the barrier only opens if both conditions are met. After the car passes, another sensor triggers a NOT gate to close the barrier. This system ensures efficient traffic flow and revenue collection. Basic Security Alarm Systems in Nigerian Homes/Offices: Imagine an alarm system with two sensors: a door sensor (A) and a window sensor (B). If either the door is opened OR a window is opened, the alarm should trigger. An OR gate can combine the signals from these sensors. If a 'master switch' (C) is also required to be ON for the alarm to be active, then a more complex circuit involving AND/OR gates would be used to ensure the alarm only sounds when (A OR B) AND C is true. This protects properties from burglary. Industrial Process Control (e.g., water pumping stations, manufacturing plants): In a water pumping station in Abuja, logic gates can control pumps based on water levels and system pressure. For example, if the 'reservoir level is low' (Input A = 1) AND the 'pump is not overheating' (Input B = 1), then an AND gate can activate the pump. A NOR gate might be used to trigger an alert if either the pump fails or the water pressure drops critically. This ensures reliable operation and prevents equipment damage.