Partial preview of the text
Download Computer Organization Notes | CPU, Memory, Cache, I/O & Architecture and more Study notes Computer Architecture and Organization in PDF only on Docsity!
Computer Org anization 1. Tntroduction a Computer Organization xefers to the way a Computer System is structuved and how its components interact to perform tasks. It deals with the operational units of a computer and their interconnections. Main components : CPU, Memory, £/0 Units , and System Buses. Functional Units of a Computer ne Input Unit: Accepts data ESS ieee and instructions. ¢ Output Unit: Shows the Input Output vesult to the user. ae | > pe | Unit ey Unit . Memory : Stores data, instructions i) (6) (c) and intermediate results, CPU: Performs all Processing Secondary and controls all operations. S torag @ Secondary Storage : Stores data, permanently. Central Processing Unit (cPu) CPU is the brain of the computer. It performs arithmetic and legical operations and contyols oll other units. CPU consists of: © ALU (Arithmetic Logic Unit) * CU (Control Unit) . Registers ALU (Arithmetic Logie Unit) Pevforms arithmetic operations (4, -,*,3) and logical operations (AND, OR, NOT, XOR, etc.). It operates on data from registers. CU (Control Unit) Controls the flew of data and instructions in the system, It fetches instructions from memory , decodes them and coordinates all operations. Reaisters Very small and fast Stovage locations inside the CPU used to stove data, instructions and addvesses temporarily. 4. Memory Unit 6. Instruction Cycle CPU executes instructions in a repeated cycle called Instruction Cycle. Memory stoves data, instructions and results permanently. It is also called primary storage iF tty pies oF een Fetch instruction ‘Types : from memory. * RAM (Random Access Memory) + Volotile. x Reels te Stoves data and instructions temporarily Dil Aeccake ecw t during processing 3 * ROM (Read Only Memory) : Non-volatile. eats Execute the Stores permanent instructions (firmware) instruction. like BIOS. St Store the result e Cache Memory: Small, very fast memor wae one - Z d d d in memory /vegister. between CPU and main memory . Stores Frequently used. date | instructions to Cade ods 8 wath Gadhia: speed up processing : 7. Input / Output (Z/0) Unit 5. Registers I/O unit manages Communication between Registers are small Storage locations inside the computer and external devices. the CPU used +o store dota, instructions ‘ Input dere Keyboard, mouse, Scanner and addresses temporarily. accept data and send it to CPU. Some important vegisters : © Output devices : Monitor, printer, speakers * PC (Program Counter) : Holds address of display or output the results, next instruction, * IR (Instruction Register) : Holds the current instruction. « MAR (Memory Address Register) : Holds the memory address. e MDR (Memory Data. Register) t Holds data to be written to or vead from memory. © ACC (Accumulator) : Stores intermediate results. I/o eperations can be of two types : e Programmed. I/O: CPU controls the transfer of data. © DMA (Direct Memory Access) : Data is transferred divectly between I/O device and memory without CPU involvement. @. System Buses Buses are communication pathways thot connect CPU, memory and I/O devices. * Addvess Bus: Carries address from CPU to memory /I/0. (Unidirectional) ¢ Data Bus : Carries dota between CPU, memory and 1/0. (Bidirectionall) ¢ Control Bus: Carries control signals like Read, Write, Clock, Interrupt, ete. (Both directions) ale Registers Registers axe small, ultra-fast storage locations inside the CPU used to hold dato, addvesses and instructions temporarily z Important Reg isters : al: System Performance Factors Performance depends on: © Clock Speed : Number of cycles per second (Hz). e CPL (Cycles Per Instruction) : Average number of cycles per instruction. © Instruction Count : Total number of © Accumulator (AC) : Holds operand. instructions executed. and intermediate results. ° Program Counter (PC) : Holds address of next instruction. Instruction Count x CPI Clock. Speed CPU Time = © Instruction Register (IR) : Holds current instruction. © Memory Address Register (MAR) : Holds addvess of memory location 44. Addressing Modes Addressing mode specifies how the operand of an instruction is located. e Immediate : © Direct : Address field contains the addvess of operand. Indirect : Address field points toa memory location that contains the address of operand. Operand ig in a register. to be accessed. ° Memory Dota. Register (MDR) : Holds doco. / instruction read from ° ov. written to memory. . Register E ¢ Indexed : Effective addvess = address + Index. Base 15% Interrupts Interrupt uspece signal that causes CPU to stop current work and execute a Service voutine. Types ° Hardware Interrupt : Generated by external devices (1/0). © Software Interrupt : Generated by programs (e.g., divide by zero). e Maskable Interrupt : Can be ignored temporarily. © Non-maskable Interrupt : Cannot be ignored. Vv v Normal Interrupt Interrupt Return +o Execution Request Service Normal Routine (ISR) Execution Used for Ifo, timer, error handling, etc. Operand. is part of instruction. 16. Instruction Formats An instruction is a binary code thot tells the CPU what fo} peration to perform ‘ Common fields in on instruction: * Opcode : to be performed. ° Addvess field : Specifies the memory location ov register. ° Mode field : Specifies the addressing mode. © Other fields : May include. register numbers, immediate data, ete. SS) pecifies the operati on E xample (46-bit instruction) Address (7 bits) Opcode Mode (4 bits) | (2 bits) Rea ister (3 bits) 415 7, 20. 42 14 43 Computer Arithmetic Computers perform arithmetic using binary numbers. Basic operations : e Addition © Subtraction (using 2's complement) . Multiplication © Division Overflow . too large to fit in the given number of bits. System Buses (Recap) Occurs when the result is Buses connect different Components of Computer. * Address Bus : Unidirectional (CPU > Memory /T/0). Bidirectional (CPU < Memory/T/0). Carries control and timing signals. * Date Bus : * Control Bus : 18. 158 Signed Number Representation Signed numbers can be represented in binary using : . Sign- Magnitude TIMSB ais sign (0 =+ve, 1 =-ve). e t's Complement : Negative number is obtained by inverting all bits. ° 2's Complement : Negative number = (1's complement ) + 1. as complement is most widely used ‘or arithmetic operations. fe Storage Devices Storage devices stove data permanently. . Primary Storage : RAM, ROM, Cache. HDD, SSD, Optical Discs, Pen Drives. . Secondary Storage g e Tertiary Storage : Magnetic Tape, used for backup. Characteristics : . Capacity s) Speed © Cost ° Volatility (temporary or permanent) Address Bus Dota Bus CPU Memory Control Bus > 28. I/o Interfacing 24. Direct Memory Access (DMA) I/O devices have different Speeds and DMA allows I/O devices to transfer data formats. T/o interface allows smooth directly to/ from memory without CPU communication between CPU and 1/0 involvement. EE, * CPU initializes DMA controller. I/O Interface Components : * DMA handles date transfer. ° Data Register : Holds data to be © CPU is interrupted after completion. transferred. Advantage : Tnereases speed, reduces © Status Register : Shows current status CPU overhead. (ready, busy, error, etc.). © Control Register : Contains control Gist fos signals and commands. cPU Memory . t/o Logie : Controls the transfer of atta, DMA e Data Bus : Transfers dota. between Controller CPU ond I/O device. Types of I/O Communication : ° Programmed. 1/0 ° Interrupt - Driven T/o © Direct Memory Access (DMA) I/O Device Sil. Flynn's Taxonomy Classification of computer architectures 30. Basic Computer Operations based on instruction and data streams. All operations performed by a computer Instruction Date con be classified into: Tl Ss Dein | Gran || Pea © Dota Transfer : Moving data. from one location to another. SISD Single Single Conventional io 5 : Crapeites e Arithmetic Operation : Addition, subtraction , rmultiplication, division. SIMD | Single Multiple ae z. Logical Operation : AND, OR, NOT, XOR , comparison. MISD Multiple Single Rarely used nh Operation : Shifting bits left or eae Multiple Multiple Multicore ag) . Processors Control Operation 8 Changing the sequence of execution. Be Important Terms (Quick Recap) © Throughput : Number of tasks completed per unit time. * Latency : Time delay between request and response. * Hit Ratio : Ratio of cache hits to total accesses * Cache Miss : When required data is not found in cache. e CPI (Cycles Per Instruction) : Average number of cycles to execute one instruction. © Word. Length : Number of bits processed at a time by CPU. © Endianness : Order in which bytes are stored in memory (Big- endian / Little-endian).