Logic gates are the basic building blocks of digital circuits. They perform logical operations on one or more binary inputs to produce a single binary output. Common logic gates include:
Example: OR Gate Truth Table: A | B | Output 0 | 0 | 0 0 | 1 | 1 1 | 0 | 1 1 | 1 | 1
De Morgan’s laws are used to simplify Boolean expressions and circuits:
Example: Using De Morgan’s First Law: Original: \( \overline{A + B} \) Simplified: \( \overline{A} \cdot \overline{B} \)
Boolean algebra laws are rules for simplifying Boolean expressions. Key laws include:
Example: Simplify \( A \cdot (A + B) \): Using Distributive Law: Result: \( A \cdot A + A \cdot B = A + A \cdot B = A \)
A Boolean expression in SOP form is a sum of minterms where each minterm is a product of literals.
Example: Expression: \( AB + \overline{A}B + A\overline{B} \) Circuit: OR gate combines outputs of three AND gates.
A Boolean expression in POS form is a product of maxterms where each maxterm is a sum of literals.
Example: Expression: \( (A + B)(\overline{A} + B)(A + \overline{B}) \) Circuit: AND gate combines outputs of three OR gates.
K-Map is a graphical method for simplifying Boolean expressions by grouping adjacent cells representing minterms or maxterms.
Example: Given Truth Table: A | B | Output 0 | 0 | 0 0 | 1 | 1 1 | 0 | 1 1 | 1 | 1 Simplified Expression: \( A + B \)
A multiplexer (MUX) is a combinational circuit that selects one of many input signals and forwards the selected input to a single output line based on control signals.
Example: A 4:1 MUX has 4 inputs (I0, I1, I2, I3), 2 control lines (S0, S1), and 1 output (Y). Output Equation: \( Y = S1'S0'I0 + S1'S0I1 + S1S0'I2 + S1S0I3 \)
A decoder is a combinational circuit that converts binary information from \( n \) input lines into a maximum of \( 2^n \) unique output lines. It is used in applications like memory addressing and data routing.
Example: A 3:8 decoder has 3 inputs (A, B, C) and 8 outputs (Y0 to Y7). Output Logic: Y0 = A'B'C', Y1 = A'B'C, ..., Y7 = ABC
An encoder is the reverse of a decoder. It takes \( 2^n \) inputs and produces an \( n \)-bit output. Encoders are used for data compression and priority encoding.
Example: An 8:3 encoder has 8 inputs (I0 to I7) and 3 outputs (A, B, C). Output Logic: A = I4 + I5 + I6 + I7, B = I2 + I3 + I6 + I7, C = I1 + I3 + I5 + I7
A half adder is a combinational circuit that adds two single-bit binary numbers and produces a sum (S) and a carry (C).
Truth Table: A | B | Sum (S) | Carry (C) 0 | 0 | 0 | 0 0 | 1 | 1 | 0 1 | 0 | 1 | 0 1 | 1 | 0 | 1 Sum = A ⊕ B, Carry = A · B
A full adder is a combinational circuit that adds three single-bit binary numbers (A, B, and Cin) and produces a sum (S) and a carry-out (Cout).
Truth Table: A | B | Cin | Sum (S) | Carry (Cout) 0 | 0 | 0 | 0 | 0 0 | 1 | 0 | 1 | 0 1 | 0 | 1 | 0 | 1 Sum = A ⊕ B ⊕ Cin, Carry = (A · B) + (Cin · (A ⊕ B))
A half subtractor subtracts two single-bit binary numbers (A and B) and produces a difference (D) and a borrow (B).
Truth Table: A | B | Difference (D) | Borrow (B) 0 | 0 | 0 | 0 0 | 1 | 1 | 1 1 | 0 | 1 | 0 1 | 1 | 0 | 0 Difference = A ⊕ B, Borrow = A' · B
A full subtractor subtracts three binary inputs (A, B, and Bin) and produces a difference (D) and a borrow-out (Bout).
Truth Table: A | B | Bin | Difference (D) | Borrow (Bout) 0 | 0 | 0 | 0 | 0 0 | 1 | 1 | 1 | 1 Difference = A ⊕ B ⊕ Bin, Borrow = (B · Bin) + (B · A') + (Bin · A')
ROM is non-volatile memory that stores data permanently. It is used to store firmware or software that rarely changes.
Example: A ROM chip stores the bootloader for initializing a computer.
PROM is a type of ROM that can be programmed once after manufacturing using a special device called a PROM programmer.
Example: A microcontroller’s specific configuration stored on a PROM chip.
EPROM can be erased and reprogrammed using ultraviolet light. It is used for development and testing purposes.
Example: EPROMs are used in development boards for testing firmware.
RAM is volatile memory used for temporary storage during processing. It allows both read and write operations.
Example: RAM stores data and instructions for active applications.
The hard disk is a non-volatile storage device that uses magnetic storage to store and retrieve data.
Example: A hard disk stores operating systems, applications, and user data.
A floppy disk is an outdated magnetic storage device used for transferring small amounts of data.
Example: Early computer systems used floppy disks for booting and data storage.
CD-ROM is an optical storage device that can store data in a read-only format.
Example: Software installers were distributed on CD-ROMs before the advent of digital downloads.
A flip-flop is a basic sequential circuit element that stores a single bit of data. It has two stable states and can be triggered by a clock signal.
The RS (Set-Reset) flip-flop sets or resets its output based on the inputs.
Truth Table: S | R | Q (Next State) | Q' (Complement) 0 | 0 | No Change | No Change 0 | 1 | 0 | 1 1 | 0 | 1 | 0 1 | 1 | Invalid | Invalid
The D (Data or Delay) flip-flop ensures a single input to avoid invalid states.
Truth Table: D | Q (Next State) 0 | 0 1 | 1
The JK flip-flop resolves the invalid state of RS flip-flops and toggles the output when both inputs are high.
Truth Table: J | K | Q (Next State) 0 | 0 | No Change 0 | 1 | 0 1 | 0 | 1 1 | 1 | Toggle
The T (Toggle) flip-flop toggles its state with each clock pulse.
Truth Table: T | Q (Next State) 0 | No Change 1 | Toggle
The Master-Slave flip-flop consists of two flip-flops connected in series. The master operates on the leading edge of the clock, and the slave operates on the trailing edge, ensuring synchronization.
A register is a group of flip-flops used to store multiple bits of data. Registers are used in processors for temporary data storage and manipulation.
Shift registers move data in a serial fashion, either left or right, with each clock pulse.
Example: A 4-bit SIPO shift register shifts the binary sequence 1010 into parallel outputs.
A counter is a sequential circuit that counts the number of clock pulses. Counters are classified as synchronous or asynchronous.
All flip-flops are triggered by the same clock signal.
Example: A 3-bit synchronous counter counts from 0 to 7.
Flip-flops are triggered by the output of the previous flip-flop, creating a ripple effect.
Example: A 4-bit ripple counter counts from 0 to 15.
Sequential circuits can be designed using different methods:
SRAM stores data using flip-flops. It is faster and more reliable but consumes more power and is expensive.
Example: SRAM is used in processor registers for quick data access.
DRAM stores data using capacitors and requires periodic refreshing to retain information.
Example: DRAM is used in the main memory of computers for storing active processes.
Large memories are constructed by combining smaller memory chips to achieve the desired capacity and configuration. Common techniques include:
Example: To build a 1 KB memory using 256-byte chips, 4 chips are connected with address decoding.
Associative memory (or content-addressable memory) allows data retrieval based on content rather than address.
Example: Associative memory is used in routers for efficient IP address lookup.
Cache memory is a small, high-speed memory located close to the CPU to store frequently accessed data.
Example: A 4-way set-associative cache with 64 blocks uses 16 sets, where each set can store 4 blocks.
Virtual memory is a memory management technique that uses secondary storage to extend the apparent memory available to programs.
Example: A system with 4 GB of virtual memory can run applications larger than the physical RAM available.