Computer_Architecture_Detailed_Notes
Computer_Architecture_Detailed_Notes
Detailed Notes
Unit 1: Data Representation
Number Systems
Decimal (Base-10): The standard system for denoting integer and non-integer numbers.
Uses digits from 0 to 9.
Binary (Base-2): Used internally by almost all modern computers and computer-based
devices. Consists of only two digits: 0 and 1.
Octal (Base-8): Uses digits from 0 to 7. Each octal digit corresponds to exactly three
binary digits.
Hexadecimal (Base-16): Uses digits 0 to 9 and letters A to F. Each hex digit represents
four binary digits.
Alphanumeric Representation: Includes letters and numbers. Used for data such as
ASCII (American Standard Code for Information Interchange).
Complements
1’s Complement: Invert all the bits of a binary number.
2’s Complement: Add 1 to the 1’s complement of a binary number. Used for
representing negative numbers in binary.
9’s Complement: Subtract each digit of a number from 9. Used in decimal subtraction.
10’s Complement: Add 1 to the 9’s complement.
[r-1]’s and r’s Complement: Generalized form used for numbers in base-r.
Arithmetic Operations
Addition/Subtraction of Sign Magnitude Numbers: The sign bits are compared first. If
same, magnitudes are added; if different, smaller magnitude is subtracted from larger.
2's Complement Addition: Add the numbers including sign bits. Discard final carry.
2's Complement Subtraction: Convert subtrahend to its 2’s complement and add to
minuend.
Multiplication Algorithms
Binary Multiplication: Repeated addition of multiplicand and shifting.
Booth’s Algorithm: Handles signed multiplication efficiently by encoding runs of 1s in
the multiplier.
Division Algorithms
Restoring Division: Subtract divisor, check sign, restore if needed.
Non-Restoring Division: Avoids the restoring step, slightly faster in some cases.
Overflow Detection
Occurs when the result exceeds the range representable with given bits.
For 2’s complement: If adding two positives yields a negative or two negatives yield a
positive.
Memory Transfers
Memory Read: Data from memory copied to register.
Memory Write: Data from register stored into memory.
Micro-Operations
Arithmetic: ADD, SUB, INC, DEC.
Logic: AND, OR, XOR, NOT.
Shift: Logical, Arithmetic, Circular.
Register Transfer: Moving data between registers.
Other Circuits
Binary Adder/Subtractor: Performs addition or subtraction based on control input.
Incrementer: Adds 1 to binary number.
Masking: Used to clear or set specific bits.
Selective Set/Clear: Operates on selected bits.
Instruction Codes
Binary codes that represent operations to be performed by the CPU.
Each instruction has an operation code (opcode) and operands.
Basic Registers
AC (Accumulator), DR (Data Register), AR (Address Register), PC (Program Counter), IR
(Instruction Register).
Addressing Modes
Direct Addressing: Address of operand is given directly.
Indirect Addressing: Address field points to a location holding the actual address.
Effective Address: Final memory address computed.
Instruction Types
Memory Reference Instructions: Involve memory operations.
Register Reference Instructions: Operate on data in registers.
I/O Instructions: Used for input/output operations.
Instruction Cycle
Fetch: Get instruction from memory.
Decode: Identify operation.
Execute: Perform the instruction.
Store: Save result.
Control Memory
Stores the microprograms that define the control signals for instruction execution.
Each location in control memory contains a microinstruction.
Stack Organization
Memory organized as a stack; LIFO (Last In First Out) structure.
Operations include PUSH (insert) and POP (remove).
Instruction Formats
Define how instruction is encoded.
Include opcode field, operand fields, and mode fields.
Instruction Types
Three-address, Two-address, One-address, and Zero-address instructions vary in
number of operands.
Instruction Classification
Data Transfer: MOV, LOAD, STORE.
Data Manipulation: ADD, SUB, AND.
Program Control: JUMP, CALL, RETURN.
Interrupts
External: Triggered by external devices.
Internal: Caused by CPU operations (e.g., overflow).
Software: Triggered by software instruction.
RISC vs CISC
RISC: Reduced Instruction Set Computer, simple instructions, faster execution.
CISC: Complex Instruction Set Computer, more powerful instructions, fewer lines of
code.
Flynn’s Classification
SISD: Single Instruction, Single Data.
SIMD: Single Instruction, Multiple Data.
MISD: Multiple Instruction, Single Data.
MIMD: Multiple Instruction, Multiple Data.
Pipelining
Technique where multiple instructions are overlapped in execution.
Stages: Fetch, Decode, Execute, Memory Access, Write Back.
Space-Time Diagram
Graphical representation showing execution stages across time.
Speedup
Speedup = Time without pipeline / Time with pipeline.
Ideal speedup equals the number of pipeline stages.
Arithmetic Pipeline
Breaks down complex arithmetic operations into stages for faster execution.
Used in floating point operations.
Peripheral Devices
Devices like keyboard, mouse, monitor, printer, etc.
I/O Techniques
Isolated I/O: Separate address space for I/O.
Memory Mapped I/O: I/O devices share memory address space.
Memory Hierarchy
Registers → Cache → Main Memory → Secondary Storage.
Trade-off between speed, cost, and size.
Main Memory
RAM: Volatile memory, fast access. Types: SRAM (faster), DRAM (cheaper).
ROM: Non-volatile memory used to store firmware.
Cache Memory
Stores frequently accessed data for faster CPU access.
Mapping Techniques: Direct Mapping, Associative Mapping, Set-Associative Mapping.
Virtual Memory
Extends RAM using disk storage.
Uses paging and segmentation. Handles page faults using TLB.
Auxiliary Memory
Non-volatile memory like hard disks, optical drives, magnetic tapes.
Timing Terminologies
Seek Time: Time to move to correct track.
Rotational Delay: Wait for correct sector to rotate.
Access Time = Seek Time + Rotational Delay.
Transfer Time: Time to move data.
Latency: Overall delay.