ScholarQuill logoScholarQuillUniversity Notes
My Semester
Explore Notes
Past Papers12 New
Video CoursesNew
Search
Settings
Study Tools
GPA/CGPA Calculator
Schedule & To-Do
Student Portal
Contact
Contact
ScholarQuill logo
My Semester
Explore Notes
Past Papers12 New
Video CoursesNew
Search
Settings
GPA/CGPA Calculator
Schedule & To-Do
Student Portal
Contact
ScholarQuill logoScholarQuillUniversity Notes
Study PortalCOMP3137Cpu Organization
Ctrl + K
Login
Explore
Search
Semester
Papers
CGPA
    COMP3137

    Computer Organization and Assembly Language

    Progress0 / 73 done
    Topics73
    1Introduction to Computer Organization2Assembly Language3Comparison of Low-Level and High-Level Languages
    4General Purpose and Special Purpose Registers5Introduction and Usage of RAM6Processor7Registers8System Bus9Instruction Execution Cycle10Assembly and Machine Language11Assembler12Linker and Link Libraries13Programmer's View of a Computer System14RISC and CISC Architecture15Physical Address Calculation16Basic Memory Organization17CPU Organization18Top Level View of Computer Function and Interconnection19Assembler Instruction Cycle20Execute Cycle21Interrupts22Interrupt Cycle23Memory Connection24Input/Output Connection25CPU Connection26MASM27MIPS28Defining Data in MASM Assembler29Elements of Assembly Language30Integer Constants31Integer Expressions32Real Number Constants33Character Constants34String Constants35Reserved Words36Identifiers37Directives38Instructions39The NOP (No Operation) Instruction40Adding and Subtracting Integer41INC and DEC Instructions42NEG Instruction43How to Move Integer Number in Register44Adding and Subtracting Numbers in Registers45Declaration and Initialization of Variables46Moving Data from Variable to Register47Data Definition Statement48BYTE and SBYTE Data49WORD and SWORD Data50Defining DWORD and SDWORD Data51Knowledge about Different Data Types52Operations, Array & Loops53Division and Multiplication in Assembly54Jumps Based on Specific Flags55Jumps Based on Equality56Simple Jump Statements57Jumps Based on Specific Condition58Code Examples59Practice on MASM60Procedures61File Operations Procedures62Labels in Procedures63Stack64Runtime Stack65Conditional Control Flow Directives66Compound Expressions67Data Representation & Conversion68Architecture69Data Path70Control Unit71Critical Path72General Principles of Pipelining73Pipelined Y86 Implementations
    8 min read
    Topic 17 of 73
    Topic Study Note Illustration
    17

    CPU Organization

    The Central Processing Unit (CPU) is the heart of any computer system, responsible for executing instructions and performing calculations. It essentially carries out the tasks that allow...

    CPU Organization

    The Central Processing Unit (CPU) is the heart of any computer system, responsible for executing instructions and performing calculations. It essentially carries out the tasks that allow a computer to process data, run applications, and interact with hardware. CPU organization refers to how the CPU is structured and how its various components interact to carry out processing tasks efficiently.

    Let’s break down CPU organization into its key components and explain how they work together to execute instructions.


    Key Components of CPU Organization

    A typical CPU is composed of several key functional units, each designed to perform specific tasks. These components include:

    1. Control Unit (CU)
    2. Arithmetic and Logic Unit (ALU)
    3. Registers
    4. Bus System
    5. Cache Memory

    Let’s explore each of these components in detail.


    1. Control Unit (CU)

    The Control Unit is responsible for directing the operation of the CPU. It tells the other parts of the CPU what to do based on the instruction it receives from memory. Its main job is to coordinate the flow of data within the CPU and between the CPU and other parts of the computer system.

    Key Functions of the Control Unit:

    • Instruction Fetch: Retrieves instructions from memory.
    • Instruction Decode: Interprets the fetched instruction to determine the operation to be performed.
    • Control Signal Generation: Sends control signals to other components (e.g., ALU, registers, memory) to execute the instruction.
    • Sequencing: Ensures instructions are executed in the correct order, especially when dealing with branching or conditional statements.

    The Control Unit essentially orchestrates the entire instruction cycle, ensuring the CPU performs the right task at the right time.


    2. Arithmetic and Logic Unit (ALU)

    The Arithmetic and Logic Unit (ALU) is the part of the CPU that performs arithmetic operations (addition, subtraction, multiplication, etc.) and logical operations (AND, OR, NOT, etc.). The ALU is responsible for executing the core operations needed by programs, from mathematical calculations to conditional tests.

    Key Functions of the ALU:

    • Arithmetic Operations: Addition, subtraction, multiplication, division, etc.
    • Logical Operations: Comparison (e.g., greater than, less than, equal to) and logical operations (AND, OR, XOR).
    • Bitwise Operations: Manipulating individual bits within data (e.g., shifting bits, masking bits).

    The ALU operates on data that is passed to it via the CPU's registers and outputs the result, which is then passed back to the registers or memory.


    3. Registers

    Registers are small, high-speed storage locations inside the CPU that hold data, addresses, or control information that is needed immediately by the CPU during processing. Registers are faster than main memory (RAM) and are used to hold intermediate results during the execution of instructions.

    Types of Registers:

    • General-Purpose Registers (GPRs): These are used by the CPU for general data storage during computations. For example, a register might store the operands for an addition operation.
    • Special-Purpose Registers: These registers have specific roles in CPU operation, such as:
      • Program Counter (PC): Holds the address of the next instruction to be executed.
      • Instruction Register (IR): Holds the current instruction being executed.
      • Status Register (SR) or Flags Register: Contains flags (such as Zero, Carry, Overflow) that indicate the result of arithmetic or logical operations.
      • Stack Pointer (SP): Points to the top of the stack in memory for function calls and returns.

    Key Functions of Registers:

    • Temporary Storage: Stores operands and results of operations during program execution.
    • Quick Access: Provides immediate access to frequently used data to avoid slower memory access.

    4. Bus System

    A bus is a set of physical connections (wires or traces) that carry data between components of the computer system. In the context of the CPU, the bus system connects the CPU to memory, I/O devices, and other parts of the system. There are typically several types of buses:

    Types of Buses in CPU Organization:

    • Data Bus: Carries data between the CPU, memory, and I/O devices.
    • Address Bus: Carries the addresses used to access data in memory.
    • Control Bus: Carries control signals that manage the operations of the CPU, memory, and I/O devices.

    Buses are essential for communication between different components of the system, allowing the CPU to send and receive data.


    5. Cache Memory

    Cache memory is a small, fast type of memory that stores frequently used instructions and data for quick access by the CPU. Cache memory is typically divided into multiple levels (L1, L2, and sometimes L3) based on proximity to the CPU.

    Types of Cache Memory:

    • L1 Cache: Located closest to the CPU core, it is the fastest but has the smallest size (usually around 16KB to 128KB).
    • L2 Cache: Larger than L1 cache, typically ranging from 128KB to several megabytes, but slower than L1 cache.
    • L3 Cache: Larger and slower than L2 cache, often shared between multiple CPU cores.

    Cache memory improves CPU performance by reducing the time it takes to access frequently used data from main memory (RAM), which is slower.


    CPU Instruction Cycle (Fetch-Decode-Execute Cycle)

    The CPU operates in cycles, performing a series of steps for each instruction it executes. This cycle is often referred to as the Fetch-Decode-Execute Cycle or Instruction Cycle.

    1. Fetch: The CPU fetches the instruction from memory. The Program Counter (PC) holds the memory address of the next instruction, and the instruction is loaded into the Instruction Register (IR).

    2. Decode: The Control Unit (CU) decodes the instruction in the IR. It determines the operation to perform and identifies the necessary operands (data) and the destination register.

    3. Execute: The ALU or other units execute the operation. For arithmetic or logical instructions, the ALU performs the calculation. For memory access instructions, data is read from or written to memory.

    4. Write-back: The result of the instruction execution is written back to the appropriate register or memory location.

    After the completion of each instruction, the Program Counter (PC) is updated to point to the next instruction in memory, and the cycle repeats.


    CPU Architecture: RISC vs. CISC

    The CPU organization can differ based on the instruction set architecture (ISA) used. Two of the most common types are RISC (Reduced Instruction Set Computing) and CISC (Complex Instruction Set Computing).

    • RISC (Reduced Instruction Set Computing):

      • Emphasizes simplicity and speed by using a small set of simple instructions.
      • Each instruction is designed to be executed in a single clock cycle.
      • Registers play a crucial role, as most operations work directly with them.
      • Common in modern processors (e.g., ARM, MIPS).
    • CISC (Complex Instruction Set Computing):

      • Uses a larger, more complex set of instructions, which can perform multiple operations in a single instruction.
      • Instructions may take multiple clock cycles to execute.
      • Aimed at reducing the number of instructions needed to perform a task.
      • Common in older systems and x86 processors.

    CPU Performance Factors

    Several factors contribute to the performance of a CPU:

    1. Clock Speed: The frequency at which the CPU executes instructions. Higher clock speeds allow the CPU to execute more instructions per second.
    2. Instruction Set Architecture (ISA): The type of instructions the CPU can execute. A well-designed ISA can improve efficiency.
    3. Pipelining: A technique that allows the CPU to process multiple instructions simultaneously, improving throughput.
    4. Cache Memory: Faster access to frequently used data improves CPU performance.
    5. Number of Cores: Modern CPUs have multiple cores, allowing for parallel processing of tasks.

    Conclusion

    CPU organization refers to the internal structure and how various components of the CPU interact to perform processing tasks. Key components include the Control Unit (CU), ALU, Registers, Bus System, and Cache Memory. Together, these components execute instructions through a Fetch-Decode-Execute cycle, which is the fundamental process driving all CPU operations. Understanding how these components work together is essential for understanding how modern processors execute instructions and perform calculations efficiently.

    ← Previous topic 16
    Basic Memory Organization
    Next topic 18 →
    Top Level View of Computer Function and Interconnection

    Past Papers

    Open this section to view and download past papers

    Click on Show Past Papers to load available exam papers.

    Reading Progress
    0%
    8mremaining
    1.3kwords
    Intermediatelevel
    On This Page

    No headings found

    Study Toolkit

    Subject Portal

    Computer Organization and Assembly Language