A logic gate is a fundamental electronic circuit that performs a basic Boolean logic operation on one or more binary inputs (0 or 1) to produce a single binary output, forming the building blocks of all digital systems. The primary logic gates are AND, OR, NOT, NAND, NOR, XOR, and XNOR, each implementing a specific logical function defined by a truth table. Logic gates are implemented using transistors and are combined in large numbers to create complex digital circuits such as processors, memory units, and controllers.
Problem
Design a circuit using NAND gates only to implement the expression Y = A · B + C (AND-OR logic). Verify for A=1, B=1, C=0.
Solution
Step 1: NAND is a universal gate — any logic can be built from NANDs. Step 2: A · B = NAND(A, B) inverted = NAND(NAND(A,B), NAND(A,B)). Step 3: To get OR from NAND: A + B = NAND(NAND(A,A), NAND(B,B)). Step 4: For A=1, B=1, C=0: NAND(1,1) = 0; NAND(0,0) = 1 → so A·B = 1. NAND(C,C) = NAND(0,0) = 1 → NOT C = 1. Step 5: Final OR: Y = NAND(NAND(A·B result, A·B result), NAND(C result, C result)) → Y = 1.
Answer
Y = 1 (confirmed: A·B = 1, so A·B + C = 1 regardless of C)
| Gate | Symbol | Operation (A=1, B=1) | Operation (A=1, B=0) | Boolean Expression |
|---|---|---|---|---|
| AND | D-shape with flat input | 1 | 0 | Y = A · B |
| OR | Curved D-shape | 1 | 1 | Y = A + B |
| NOT (Inverter) | Triangle with bubble | N/A (1 input → 0) | N/A | Y = Ā |
| NAND | AND + bubble at output | 0 | 1 | Y = ̄(A · B) |
| NOR | OR + bubble at output | 0 | 0 | Y = ̄(A + B) |
| XOR | Curved D with extra arc | 0 | 1 | Y = A ⊕ B |
| XNOR | XOR + bubble at output | 1 | 0 | Y = ̄(A ⊕ B) |
Wikimedia Commons, CC BY-SA
Boolean algebra is a branch of algebra in which the variables can only take the values 0 (false) or 1 (true), and the operations are AND (conjunction, ·), OR (disjunction, +), and NOT (negation, ‾). It provides the mathematical framework for analysing and simplifying digital logic circuits, and is the theoretical foundation of computer science and digital electronics. Boolean expressions can be simplified using theorems and laws such as De Morgan's Theorems, the absorption law, and consensus theorem to reduce the number of logic gates required in a circuit.
A transistor is a semiconductor device with three terminals that can amplify electrical signals or act as an electronic switch by controlling current flow between two terminals using a small input signal at the third. The two main types are the Bipolar Junction Transistor (BJT), which is current-controlled, and the Metal-Oxide-Semiconductor Field-Effect Transistor (MOSFET), which is voltage-controlled. Transistors are the fundamental building blocks of modern electronics, with billions packed into a single integrated circuit chip.
The Superposition Theorem states that in any linear circuit with multiple independent sources, the response (voltage or current) at any element equals the algebraic sum of the responses caused by each independent source acting alone, with all other independent sources deactivated. Voltage sources are deactivated by replacing them with short circuits, while current sources are deactivated by replacing them with open circuits. This theorem greatly simplifies the analysis of circuits with multiple sources and applies only to linear systems.
The word "gate" is used by analogy with a physical gate that controls passage — a logic gate controls the flow of binary information. "Logic" derives from Greek "logike" (the art of reasoning), from "logos" (word, reason). The concept of electronic logic gates emerged in the 1930s with Claude Shannon's application of Boolean algebra to circuits.