Digital Logic and Computer Organisation Exhaustive Study Guide
Number Systems, Radix Complements, and Boolean Foundations
Number Systems and Base Conversions
Decimal to Binary Conversion:
To convert a decimal integer to binary, repeatedly divide the number by 2 and record the remainder until the quotient becomes 0. The binary equivalent is formed by reading the remainders from bottom to top (Most Significant Bit to Least Significant Bit).
Example Calculation (Decimal 141):
remainder
remainder
remainder
remainder
remainder
remainder
remainder
remainder
Reading remainders from MSB to LSB gives:
Octal to Hexadecimal Conversion (Without Decimal Intermediate):
To convert an octal number directly to hexadecimal, convert each octal digit into its 3-bit binary equivalent, group the resulting binary bits into 4-bit clusters starting from the least significant bit, and translate each 4-bit group into its corresponding hexadecimal digit.
Example Calculation (Octal ):
Convert each octal digit to 3-bit binary: , , ,
Combine binary streams:
Group into 4-bit clusters:
Convert clusters to hexadecimal: , ,
Result:
Hexadecimal to Octal Conversion via Binary:
Example Calculation (Hexadecimal ):
Convert each hex digit to 4-bit binary: , , ,
Combined binary representation:
Group into 3-bit clusters from LSB:
Convert 3-bit clusters to octal: , , , , , ,
Result:
Fractional Base Conversions to Decimal:
Conversion of to Decimal:
Conversion of to Decimal:
Gray Code Conversion:
Gray code is an unweighted binary code where two consecutive values differ by only one bit.
To convert binary to Gray code: keep the MSB same, and XOR each binary bit with the adjacent bit on its left.
Conversion for Decimal 12:
Gray MSB
Result: Decimal 12 in Gray code is
Radix and Diminished Radix Complements
Definitions of Complements with Respect to Base :
For a given base and an -digit number :
Radix Complement ('s complement): Defined mathematically as for non-zero numbers, and if .
Diminished Radix Complement ('s complement): Defined mathematically as .
For binary numbers ():
's complement is the Radix complement ( or 1's complement + 1).
's complement is the Diminished Radix complement ( or bitwise NOT).
Subtraction Using 2's Complement:
Given two 4-bit numbers (Decimal 12) and (Decimal 9):
Operation ():
Take 2's complement of : 1's complement of is ; add 1 to get
Add : \begin{array}{r@{\quad}l} 1100 \\ + 0111 \\ \hline 10011 \end{array}
An end carry of occurs, indicating the result is positive. Discard the end carry.
Result: (Decimal 3).
Operation ():
Take 2's complement of : 1's complement of is ; add 1 to get
Add : \begin{array}{r@{\quad}l} 1001 \\ + 0100 \\ \hline 1101 \end{array}
No end carry occurs, indicating the result is negative and in 2's complement form.
Take 2's complement of to get magnitude: 1's complement is ; add 1 to get (Decimal 3).
Result: (Decimal -3).
Universal Logic Gates and Logic Implementation
Implementation of AND and OR Gates Using NAND Gates:
AND Gate using NAND Gates: Requires 2 NAND gates.
Gate 1 performs NAND on inputs and :
Gate 2 acts as an inverter by feeding to both inputs:
OR Gate using NAND Gates: Requires 3 NAND gates.
Gate 1 inverts input :
Gate 2 inverts input :
Gate 3 combines and with NAND:
Implementation of Logic Functions Using NOR Gates:
AND Gate using NOR Gates:
OR Gate using NOR Gates:
NAND Gate using NOR Gates:
Canonical Boolean Forms, Logic Gates, and Gate Minimization
Boolean Laws and Complement Proofs
Fundamental Laws of Boolean Algebra:
Associative Law: The grouping of variables does not affect the operation result.
AND Operation:
OR Operation:
Distributive Law: Multiplication distributes over addition, and addition distributes over multiplication.
AND over OR:
OR over AND:
Proof of Distributive Law using Truth Table:
0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 |
0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 |
0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
1 | 0 | 0 | 0 | 1 | 1 | 1 | 1 |
1 | 0 | 1 | 0 | 1 | 1 | 1 | 1 |
1 | 1 | 0 | 0 | 1 | 1 | 1 | 1 |
1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
Proof of DeMorgan's Laws for Three Variables:
Law 1:
Law 2:
Truth Table for Truth Table Function :
0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 |
0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 |
0 | 1 | 0 | 0 | 1 | 1 | 1 | 1 |
0 | 1 | 1 | 1 | 1 | 0 | 0 | 1 |
1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 |
1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 |
1 | 1 | 0 | 0 | 0 | 1 | 0 | 0 |
1 | 1 | 1 | 1 | 0 | 0 | 0 | 1 |
Complements of Functions:
For :
For : Apply DeMorgan's laws systematically.
Theorem: The logical sum of all minterms of a Boolean function of variables is identically equal to 1.
Proof for 3 variables: The sum of all minterms is .
Karnaugh Map (K-Map) Optimization
Purpose of K-Map: A Karnaugh Map is a graphical representation technique used to minimize Boolean functions systematically without requiring complex algebraic manipulations. It arranges minterms in a grid where adjacent cells differ by only one binary variable (Gray code sequence).
Structure of a Three-Variable K-Map: Contains cells representing minterms through , arranged in 2 rows (for variable ) and 4 columns (for variables labeled ).
Don't Care Condition ( or ): Conditions in logic design where certain input combinations are guaranteed never to occur or where the output value does not matter. In K-Maps, don't cares can be assigned as either 0 or 1 to form the largest possible adjacent groups.
POS Expressions and Conversion:
To convert POS expression to SOP form:
K-Map Simplification Examples:
Problem 1: Simplify into equivalent POS form.
The maxterms given are .
Plotting zeros at these positions in a 4-variable K-map:
Corners form a quad yielding .
Middle quad forms a quad yielding .
Simplified POS Expression:
Problem 2: Simplify using 4-variable map.
Convert terms to minterms:
Combined minterms:
Groupings:
Quad
Quad (with added if simplified) or Quad yielding simplified SOP:
Problem 3: Simplify with don't cares .
Minterms + Don't cares:
Quad
Quad
Quad
Single term
Simplified Sum-of-Minterms Form:
Problem 4: Simplify with don't cares .
Since all maxterms and don't care maxterms cover all cells from 0 to 7, the function simplifies to a constant
Multi-Level Gate Circuits
Multi-Level NOR Implementation:
To implement using NOR gates:
Convert all AND/OR operations using double complement and DeMorgan's rule to format the logic trees as multi-stage inverted ORs.
Multi-Level NAND Implementation:
To implement using NAND gates:
Convert the expression into an inverted AND-OR configuration where intermediate gates are all configured as NAND logic.
Combinational Logic Design, Arithmetic Circuits, and Multiplexers
Combinational Circuit Design
Definition: A combinational circuit consists of logic gates whose outputs at any given time are determined directly from the present combination of inputs, without relying on past storage elements or feedback paths.
Design Example 1: Three inputs (), output when binary value .
Binary values less than 3 correspond to input combinations .
Truth Table:
Binary Value | Output | |||
|---|---|---|---|---|
0 | 0 | 0 | 0 | 1 |
0 | 0 | 1 | 1 | 1 |
0 | 1 | 0 | 2 | 1 |
0 | 1 | 1 | 3 | 0 |
1 | 0 | 0 | 4 | 0 |
1 | 0 | 1 | 5 | 0 |
1 | 1 | 0 | 6 | 0 |
1 | 1 | 1 | 7 | 0 |
* K-Map simplification gives output equation: Design Example 2: Three inputs (), output when binary value is even.
Even binary numbers end in for the LSB (), covering binary values
Output equation simplified directly:
Arithmetic Circuits
Half Adder:
Adds two single binary bits ( and ).
Truth Table:
Sum () | Carry () | ||
|---|---|---|---|
0 | 0 | 0 | 0 |
0 | 1 | 1 | 0 |
1 | 0 | 1 | 0 |
1 | 1 | 0 | 1 |
* Equations:
*
* Full Adder Construction Using Two Half Adders:
Full Adder adds three bits: , , and Carry-in .
Half Adder 1: Takes and , produces and
Half Adder 2: Takes and , produces final Sum and carry
Final Carry Generation: Combine intermediate carries with an OR gate:
Ripple Carry Adder:
A cascade of Full Adders connected in series where the carry output of each full adder is connected as the carry input to the next higher-order full adder.
Limitation: Propagation delay increases linearly with the number of bits because high-order bits must wait for the carry to ripple through all lower stages.
Carry-Save Addition Technique:
An addition method used in high-speed multipliers where three or more numbers are added together simultaneously. Instead of propagating carries immediately, a Carry-Save Adder (CSA) produces two outputs for each stage: a Sum vector and a Carry vector. The carries are propagated only in the final addition step using a conventional ripple-carry or carry-lookahead adder, reducing total execution time.
Booth's Multiplication Algorithm:
An efficient algorithm for multiplying signed binary numbers in 2's complement notation.
Operates by scanning multiplier bits and an extra adjacent bit (initially set to 0):
If : Subtract multiplicand from accumulator (), then arithmetic shift right .
If : Add multiplicand to accumulator (), then arithmetic shift right .
If or : Arithmetic shift right directly.
Repeat process for clock cycles where is the bit length.
Floating-Point Arithmetic Operations:
Represented as , where is the mantissa, is the radix, and is the exponent.
Addition/Subtraction: Requires exponent alignment (shifting the mantissa of the smaller exponent right until exponents match), followed by mantissa addition/subtraction, and finally normalizing the result.
Multiplication: Multiply mantissas, add exponents, and normalize.
Division: Divide mantissas, subtract exponents, and normalize.
Decoders, Multiplexers, and Logic Implementation
Decoder and Enable Input Significance:
A decoder converts an -bit binary input code into up to unique output lines.
Significance of Enable Input (): Acts as a master switch. When disabled (), all outputs remain inactive regardless of input selections. Enable lines allow expansion of decoders into larger matrices.
Implementation of 3x8 Decoder using 2x4 Decoders: Uses two 2x4 decoders and an inverter connected to the most significant input bit (). When , the inverted signal enables the first 2x4 decoder (outputs to ); when , it enables the second 2x4 decoder (outputs to ).
Multiplexer (MUX) Selection Lines:
A Multiplexer routes one of data inputs to a single output.
The required number of selection lines is determined by the formula:
Multiplexer Implementations of Functions:
Implementation of using 8x1 MUX:
Select lines connected to . Input lines to are configured based on variable :
(minterms 0, 2)
(minterm 5)
(minterm 8, 10)
(minterm 14)
Implementation of 8x1 MUX using 2x1 MUXes: Arranged in a tree structure using four 2x1 MUXes at the first level, two 2x1 MUXes at the second level, and one 2x1 MUX at the final level.
Magnitude Comparators:
A magnitude comparator compares two binary numbers and and determines whether , , or .
2-Bit Magnitude Comparator: Takes inputs and . Output functions:
equation:
equation:
equation:
Basic Computer Organization, Bus Architecture, and Instruction Cycles
Basic Computer Hardware Organization
Functional Units of a Computer:
Input Unit: Accepts data and instructions from external peripheral sources.
Memory Unit: Stores instructions, raw input data, and intermediate results (Primary RAM/ROM and Secondary Storage).
Arithmetic Logic Unit (ALU): Performs all arithmetic computations (addition, subtraction) and logical evaluations (AND, OR).
Control Unit (CU): Fetches instructions from memory, decodes them, and generates control timing signals to coordinate all system operations.
Output Unit: Transforms binary processed data back into human-readable or external actionable signals.
Computer Register Organization:
Register Symbol | Register Name | Bit Size | Function Description |
|---|---|---|---|
DR | Data Register | 16 bits | Holds memory operands |
AR | Address Register | 12 bits | Holds memory address |
AC | Accumulator | 16 bits | Processor register for arithmetic/logic computation |
IR | Instruction Register | 16 bits | Holds opcode of instruction fetched from memory |
PC | Program Counter | 12 bits | Holds address of next instruction to be fetched |
TR | Temporary Register | 16 bits | Holds temporary data during execution |
INPR | Input Register | 8 bits | Carries input character from input device |
OUTR | Output Register | 8 bits | Holds output character for output device |
Significance of Program Counter (PC): Keeps track of execution flow by holding the memory address of the next instruction. It automatically increments after each instruction fetch, unless a branch/jump directive occurs.
Bus Architecture and Memory Reference Instructions
Common Bus System:
A shared collection of signal wires configured to transfer data, address, and control signals among multiple internal computer registers efficiently without interconnecting every register pair directly.
Construction of Common Bus System for 4 Registers of 4 Bits Each: Uses four 4x1 Multiplexers. Bit from each of the four registers () is connected to the four data inputs of Multiplexer . Two select lines choose which register drives the 4-bit bus lines simultaneously.
Instruction Cycle Flowchart and Operation:
Fetch: Load instruction at memory address into Instruction Register (), then increment .
Decode: Decode opcode bits inside ; load effective address bits into Address Register ().
Read Effective Address: If the instruction specifies an indirect address, fetch the ultimate operand address from memory ().
Execute: Perform the control operation dictated by opcode.
Effective Address: The precise physical memory address that contains the actual operand required for an instruction execution.
Addressing Modes:
Immediate Mode: Operand is explicitly specified within the instruction word itself.
Direct Addressing Mode: Address field directly specifies memory location of the operand.
Indirect Addressing Mode: Address field points to a memory location containing the effective address of operand.
Register Mode: Operand resides inside a designated internal register.
Register Indirect Mode: Register holds the memory address of the operand.
Displacement / Relative Mode: Effective Address = Base Register / PC value + offset value.
CPU Architecture, Stack Organization, and Computer Generations
CPU Instruction Formats:
Three-Address Instructions: Specify two source operands and one destination operand (e.g., ).
Two-Address Instructions: Destination register doubles as one of the source operands (e.g., ).
One-Address Instructions: Uses implicit Accumulator () register for one operand and destination (e.g., ).
Zero-Address Instructions: Uses an implicit Last-In-First-Out (LIFO) Pushdown Stack for processing (e.g., ).
Stack Organization:
Register Stack: Fixed array of internal registers governed by a Stack Pointer () register.
PUSH Operation:
POP Operation:
Memory Stack: Dedicated logical segment of main RAM designated as stack space.
Computer Generations Summary:
Generation | Primary Component Technology | Key Characteristics / Innovations |
|---|---|---|
1st Generation | Vacuum Tubes | High heat emission, slow speed, machine language |
2nd Generation | Transistors | Magnetic core memory, assembly language |
3rd Generation | Integrated Circuits (ICs) | Operating systems, SSI/MSI technology |
4th Generation | Microprocessors (VLSI / LSI) | Personal computers, semiconductor RAM/ROM |
5th Generation | Ultra Large Scale Integration (ULSI) | Parallel processing, AI applications |
Multicomputer vs. Multiprocessor:
Multiprocessor: Tightly coupled architecture where multiple CPUs share a common memory space and unified clock.
Multicomputer: Loosely coupled architecture consisting of autonomous processing nodes, each with its own local memory, communicating via message-passing networks.
Von Neumann Architecture Principles: Characterized by stored-program concept where instructions and data reside in a shared single memory unit, executed sequentially by a single processing unit containing ALU and CU registers.
Memory Systems, Cache Organization, Virtual Memory, and Secondary Storage
Memory Hierarchy and DRAM Technology
Memory Hierarchy Structure: Arranged in descending speed and ascending capacity/cost parameters:
Processor Registers (Fastest access, smallest capacity, highest cost)
Cache Memory (L1, L2, L3 SRAM)
Main Memory (DRAM)
Secondary Storage (SSD, Hard Disk Drives)
Auxiliary / Off-line Storage (Magnetic Tapes, Optical Disks)
Synchronous vs. Asynchronous DRAM:
Asynchronous DRAM: Operates independently of the system bus clock. Memory access is controlled via asynchronous handshaking control signals (, ).
Synchronous DRAM (SDRAM): Synchronizes access directly with the system bus clock signal, allowing pipelined execution and faster burst mode data access.
ROM Variants and Internal Memory Organization
ROM Variants:
ROM (Read-Only Memory): Mask-programmed during manufacturing; contents cannot be modified.
PROM (Programmable ROM): Blank OTP (one-time programmable) memory written using electrical programmer devices.
EPROM (Erasable PROM): Data erased by exposing chip to high-intensity Ultraviolet light through quartz window.
EEPROM (Electrically Erasable PROM): Byte-level erasing/rewriting performed electrically.
Flash Memory: Advanced variant of EEPROM providing block-level electrical erasing and rapid writing.
Internal Chip Organization: Memory cells are arranged in a 2D matrix array. A Row Decoder activates a specific word line based on higher address bits, while Column Decoders select specific bit lines to read/write target data words onto data lines.
Cache Memory Concepts and Mapping
Cache Efficiency Metrics:
Hit Ratio (): The fraction of memory references found inside cache memory.
Average Access Time (): Where is cache access time and is main memory access time.
Direct Mapping Cache Numerical Example:
System Specifications: Main Memory size = 1 MB ( bytes), Cache Memory size = 4 KB ( bytes).
Address Bit Fields Calculation: Total Address Bits = 20 bits.
Cache Index / Block Field = 12 bits (determines line inside 4KB cache)
Tag Field = Total Address Bits - Cache Index Bits = bits.
Virtual Memory, Address Mapping, and Page Replacement
Virtual Memory Principles: An operational memory management technique that gives software the illusion of a large continuous main memory by combining dynamic RAM hardware with secondary block storage.
Address Space vs. Memory Space:
Address Space (Virtual Address): Logical set of addresses generated by the CPU.
Memory Space (Physical Address): Actual set of physical memory addresses existing in primary RAM.
Virtual Memory Numerical Problem:
System Parameters: Virtual Address Space = 16 bits (), Physical Memory Space = 13 bits (), Page / Block Size = 1 KB ( bytes).
Number of Pages Calculation:
Number of Blocks (Frames) Calculation:
Page Faults and FIFO Page Replacement:
A Page Fault occurs when a referenced virtual page is not currently present in physical main memory (RAM).
FIFO (First-In-First-Out) Page Replacement Algorithm: Replaces the oldest page that has resided in physical memory frame longest when a new page fault occurs.
Content Addressable Memory (CAM) and Secondary Storage
Content Addressable Memory (CAM) / Associative Memory:
A memory device where content is accessed directly by matching input data patterns rather than specifying binary address locations. All memory words compare input search keys simultaneously in parallel.
Argument Register: Contains the specific multi-bit data pattern being searched across all CAM memory cells.
Key/Mask Register: Mask register that specifies which specific bit positions within the Argument Register are actively evaluated during the simultaneous match operation.
Secondary Storage Devices and Memory Interleaving:
Secondary Devices: Magnetic Hard Disk Drives (HDD), Solid State Drives (SSD using Flash NAND technology), Optical Media (CD/DVD/Blu-Ray), and Magnetic Tapes.
Memory Interleaving: A technique that splits main RAM into multiple independent memory modules operating in parallel. By spreading sequential memory block addresses across different modules (Low-Order Interleaving), read/write access bottlenecks are reduced and overall system throughput increases.