Fetch, Execution and I/O - Computer Organisation Study Notes

Processor Architecture and Computer Operations

  • The Central Processing Unit (CPU), also known as the Processor, is considered the "heart" of the computer.

  • The fundamental operations of a computer system are relatively simple, but it derives immense power by repeating these basic operations billions of times per second.

  • The basic operation of a computer involves several steps:     * Programs and data are input into the system and stored in the memory.     * Data is then fetched from memory to be processed by the Arithmetic and Logic Unit (ALU).     * All operations within the computer are coordinated and controlled by the Control Unit.     * Information that has been processed is finally sent to the output unit.

Binary Representation and Data Fundamentals

  • Data in a computer is stored exclusively as binary digits, known as bits.

  • A bit is the smallest unit of data and can have one of two values: 11 or 00.

  • The physical representation of bits depends on the medium:     * Electronic Systems: A 11 bit is represented by the presence of voltage (e.g., 5volts5\,\text{volts}), while a 00 bit is represented by the absence of voltage.     * Fiber-optic Systems: A 11 bit is represented by the presence of light, while a 00 bit is represented by the absence of light.

  • A group of 8bits8\,\text{bits} forms a single byte.

  • Each bit within a byte has a positional value based on powers of two: 1,2,4,8,16,32,64,1281, 2, 4, 8, 16, 32, 64, 128.

  • The specific combination of bits in a byte is what determines its corresponding decimal value.

ASCII Character Encoding and Data Translation

  • The ASCII table (American Standard Code for Information Interchange) is used to convert binary data into characters.

  • The process involves converting bits and bytes into a decimal value, which then maps to a character in the ASCII table.

  • Example of bit-to-character conversion:     * Binary: 010000010100 0001     * Decimal: 6565     * ASCII Character: A\text{A}

  • The computer performs a translation process for key characters (e.g., typing the word "LISA"):     * 1. The user types "LISA" on the keyboard.     * 2. The keyboard converts every character into its specific binary code.     * 3. This binary data is sent to the memory and the CPU for processing.     * 4. The binary data is transmitted to the output device (e.g., a printer).     * 5. The printer converts the binary code back into characters to print the output.

Functional Units of a Computer

  • Primary Memory (Main Memory):     * It is organized into 32-bit32\text{-bit} words.     * Each word contains four 8-bit8\text{-bit} bytes.     * It typically provides a capacity of several gigabytes.     * Programs and data must be loaded into primary memory before they can be executed.

  • Cache Memory:     * This is an adjunct to the main memory and is fabricated directly on the processor chip.     * It is much smaller and significantly faster than the main memory.     * Its purpose is to hold sections of the program and data that are currently or frequently being executed.

  • Processor Components:     * Logic Circuits: These circuits perform arithmetic and logic operations on word-size data operands.     * Timing and Control Circuits: These are responsible for fetching program instructions and data from memory in a sequential manner.     * Registers: The processor typically contains 1616 or 3232 registers, each of which holds one word of operand data.

Detailed Processor Components

  • Arithmetic and Logic Unit (ALU):     * The ALU is where most computer operations are executed.     * It specifically performs arithmetic operations (like addition) or logic operations.

  • Control Unit:     * The Control Unit is responsible for coordinating the operation of all other units: Memory, ALU, and I/O units.     * It ensures that information is stored, processed, and moved between units correctly.

  • Programming and Instruction Storage:     * An instruction specifies a specific operation and the locations of the data operands required.     * A single encoded instruction is typically held in a 32-bit32\text{-bit} word.     * A program consists of a sequence of these instructions executed one after another.     * Both the program and its required data are stored in the main memory.

The Instruction Cycle (Machine Cycle)

  • A single cycle of operation is known as the instruction cycle or the machine cycle.

  • It consists of four primary phases: Fetch, Decode, Execute, and Store.

  • The specific steps in the instruction cycle are:     * 1. Fetch: The CPU retrieves the next instruction from memory.     * 2. Decode: The CPU interprets the instruction to determine the required action.     * 3. Execute: The instruction is carried out (e.g., performing a calculation or moving data).     * 4. Store: Results are stored or written back to memory after execution.     * 5. Interrupt Check: The CPU checks for interrupts and services them if present; if not, it fetches the next instruction.

Instruction Types and Programming Examples

  • Computer instructions generally fall into three categories:     * Load: Read a data operand from memory or an input device into a processor register.     * Store: Write a data operand from a processor register to memory or an output device.     * Operate: Perform an arithmetic or logic operation on data operands already located in processor registers.

  • Example Program for the calculation C=A+BC = A + B:     * In this context, A, B, and C are labels for memory word addresses, and Ri represents processor registers.     * 1. Load R2, A\text{Load R2, A}     * 2. Load R3, B\text{Load R3, B}     * 3. Add R4, R2, R3\text{Add R4, R2, R3}     * 4. Store R4, C\text{Store R4, C}

The Program Counter (PC) and Fetching Mechanisms

  • The Program Counter (PC) is a specialized register in the processor that contains the address (location) of the instruction being executed at any given time.

  • Mechanisms of the PC:     * As each instruction is fetched, the PC increases its stored value by 11.     * After a fetch, the PC points to the next instruction in the sequence.     * Upon computer restart or reset, the PC normally reverts to 00.

  • Step-by-step process for the instruction Load R2, LOC\text{Load R2, LOC}:     * 1. The control circuits send the address stored in the PC to memory and issue a "Read" command.     * 2. The instruction is loaded from memory into the Instruction Register (IR).     * 3. The PC is incremented to point to the next instruction.     * 4. The address LOC\text{LOC} is sent to memory, and another "Read" command is issued.     * 5. The word from memory is loaded into register R2\text{R2}.

Factors Affecting Performance

  • Program execution performance is influenced by four main factors:     * 1. The speed of the electronic circuits within the processor.     * 2. The access times to the cache and the main memory.     * 3. The specific design of the instruction set.     * 4. Parallelism: The number of operations that can be performed simultaneously.

  • Parallelism and Multicore Processors:     * Multiple processing units can be fabricated on a single chip.     * The term "core" refers to each of these individual processors.     * The term "processor" is then used to describe the entire chip.     * Common configurations include dual-core, quad-core, and octo-core processors.