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 PortalCOMP3137Processor
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 6 of 73
    Topic Study Note Illustration
    06

    Processor

    The Processor —also called the Central Processing Unit (CPU) —is the "brain" of a computer or computing device. It is responsible for executing instructions and performing calculations...

    Processor (CPU) - Introduction and Overview

    The Processor—also called the Central Processing Unit (CPU)—is the "brain" of a computer or computing device. It is responsible for executing instructions and performing calculations that make everything work. From running applications to managing input/output operations, the CPU handles the processing of data and instructions.

    Key Functions of a Processor

    The CPU performs several critical tasks that allow a computer or device to function:

    1. Fetch: The CPU retrieves (or fetches) the instruction from the memory (usually from RAM) that needs to be executed.
    2. Decode: It decodes the instruction, figuring out what operation it needs to perform (such as addition, subtraction, comparison, etc.).
    3. Execute: The CPU then executes the instruction, which may involve performing arithmetic or logical operations, manipulating data, or interacting with other hardware components.
    4. Store: The CPU might store the result of an operation back into memory (RAM or cache) for future use.

    This cycle of fetch-decode-execute is repeated continuously while the computer is running programs.


    Basic Components of a Processor

    A typical processor consists of several key components, each designed to handle specific tasks efficiently:

    1. ALU (Arithmetic Logic Unit):

      • The ALU performs all arithmetic (addition, subtraction, multiplication, etc.) and logical (comparison, AND/OR operations) operations in the CPU.
      • Example: If you’re adding two numbers in a program, the ALU handles that operation.
    2. Control Unit (CU):

      • The Control Unit manages the flow of data within the CPU. It directs the operation of the ALU, memory, and I/O devices by interpreting the instructions from memory.
      • The CU decodes the instructions and sends out control signals to the relevant parts of the processor or system.
      • Example: If an instruction asks the processor to load a value from memory into a register, the CU sends the appropriate signal to fetch that data.
    3. Registers:

      • Registers are small, high-speed storage locations within the CPU. They hold intermediate data, memory addresses, or instructions during processing.
      • There are several types of registers, such as:
        • General-purpose registers (for holding data temporarily),
        • Special-purpose registers like the Program Counter (PC) (which keeps track of the next instruction to execute) and Stack Pointer (SP) (which points to the current position in the stack).
    4. Cache:

      • A small, fast memory located inside or near the CPU that stores frequently accessed data and instructions. Caching improves the CPU's performance by reducing the time it takes to access data from the slower main memory (RAM).
      • There are different levels of cache (L1, L2, L3):
        • L1 Cache: Located directly on the CPU chip, fastest but small.
        • L2 Cache: Larger than L1 but slower; may be located on the CPU chip or near it.
        • L3 Cache: Larger still, slower, and typically shared between cores in multi-core processors.
    5. Clock:

      • The processor’s clock generates a continuous pulse (or "tick") that synchronizes the processor’s operations. The clock speed (measured in Hertz, Hz) dictates how many cycles the processor can complete in one second.
      • A higher clock speed generally means the CPU can execute more instructions per second, leading to better performance.

    How Processors Work: Fetch-Decode-Execute Cycle

    The Fetch-Decode-Execute Cycle is the basic process that all processors use to perform operations. Here's a breakdown of what happens at each stage:

    1. Fetch:

      • The Program Counter (PC), which stores the address of the next instruction to be executed, sends a signal to fetch the instruction from memory.
      • The instruction is loaded into the Instruction Register (IR).
    2. Decode:

      • The Control Unit (CU) decodes the instruction in the IR to determine what operation is required. It then sends control signals to the ALU (for arithmetic or logic operations), the registers (for storing values), or other components to execute the instruction.
    3. Execute:

      • The processor carries out the decoded operation. For example, if the instruction is an addition, the ALU performs the calculation. If it's a memory read or write, the instruction interacts with RAM.
      • After executing the instruction, the result might be written back to a register, memory, or output device.
    4. Repeat:

      • The Program Counter (PC) is updated to point to the next instruction, and the process repeats. This is an ongoing cycle as long as the CPU is powered on and running a program.

    Types of Processors

    1. Single-Core Processors:

      • Single-core processors have only one processing unit (or core). They can only perform one task at a time, but modern single-core CPUs can still multitask efficiently by quickly switching between tasks (time-sharing).
      • Limitations: A single-core processor can only execute one instruction per clock cycle, meaning it has limitations when handling complex tasks or multitasking with several programs.
    2. Multi-Core Processors:

      • Multi-core processors have two or more cores on a single chip. Each core can independently execute instructions, allowing the CPU to handle multiple tasks simultaneously.
      • For example, a quad-core processor has four cores, so it can process four tasks simultaneously, dramatically improving multitasking and performance in multi-threaded applications.
      • Multi-core processors are essential for modern computing, as they allow parallel processing, which is necessary for gaming, video editing, and other high-performance tasks.
    3. RISC (Reduced Instruction Set Computing):

      • RISC processors use a smaller set of instructions, each designed to be executed in a single clock cycle. This results in simpler, faster execution, as each instruction is highly optimized.
      • Examples: ARM processors (commonly used in smartphones, tablets, and some laptops) are typically RISC-based.
    4. CISC (Complex Instruction Set Computing):

      • CISC processors use a larger and more complex set of instructions, where each instruction can perform multiple tasks at once. While this can simplify programming (fewer instructions are needed to accomplish a task), it can also make the CPU slower in certain cases due to the complexity of the instructions.
      • Examples: Intel's x86 processors are typically CISC-based.

    Key Characteristics of a Processor

    1. Clock Speed (Frequency):

      • The clock speed indicates how many cycles the CPU can perform per second, measured in Hertz (Hz). Modern processors can operate at speeds of GHz (Gigahertz), or billions of cycles per second. A higher clock speed means the processor can handle more instructions per second, contributing to better performance.
    2. Bus Width:

      • The bus width refers to the number of bits that can be transmitted at once between the CPU and memory or between CPU components. For example, a 32-bit bus can transfer 32 bits of data in one clock cycle.
      • A wider bus (e.g., 64 bits) allows more data to be transferred at once, improving performance, especially in tasks that involve large amounts of data.
    3. Cache Size:

      • Cache memory (L1, L2, L3) is used to store frequently accessed data for quick access. The larger the cache, the more data can be stored, which can improve performance by reducing access times for frequently used data.
    4. Instruction Set Architecture (ISA):

      • The ISA defines the set of instructions that the CPU can understand and execute. For example, x86, ARM, and MIPS are different ISAs that specify how a CPU operates and communicates with memory and I/O devices.
    5. Power Consumption:

      • Power efficiency is crucial, especially for mobile devices. Modern CPUs are designed to balance performance and power consumption, often dynamically adjusting power usage based on the workload.

    Common CPU Brands and Architectures

    • Intel:

      • Known for producing processors based on the x86 architecture. Intel CPUs are common in desktops, laptops, and servers.
      • Intel also has Core i3, i5, i7, and i9 processors, offering different levels of performance for various needs.
    • AMD:

      • AMD produces CPUs based on the x86-64 architecture (similar to Intel) and is known for offering strong performance at competitive prices. AMD's Ryzen processors are widely used in both consumer and high-performance computing.
    • ARM:

      • ARM processors are based on the RISC architecture and are commonly used in mobile devices like smartphones, tablets, and increasingly in laptops and servers due to their energy efficiency.

    Summary

    The CPU is the heart of any computer system, executing instructions, performing calculations, and coordinating the computer’s operations. It processes data in cycles, following the fetch-decode-execute process. With components like the ALU, Control Unit, and Cache, modern CPUs can perform billions of operations per second, and multi-core processors allow for parallel processing, improving performance for multitasking and complex computations.

    Key factors that influence a CPU's performance include clock speed, number of cores, cache size, and architecture (e.g., x86 or ARM). Depending on the application, processors with different architectures and capabilities are used in everything from mobile devices to high-performance servers.

    ← Previous topic 5
    Introduction and Usage of RAM
    Next topic 7 →
    Registers

    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.4kwords
    Intermediatelevel
    On This Page

    No headings found

    Study Toolkit

    Subject Portal

    Computer Organization and Assembly Language