ScholarQuill logoScholarQuillUniversity Notes
  • Notes
  • Past Papers
  • Blogs
  • Todo
Login
ScholarQuill logoScholarQuillUniversity Notes
Login
NotesPast PapersBlogsTodo
More
SubjectsDiscussionCGPA CalculatorGPA CalculatorStudent PortalCourse Outline
About
About usPrivacy PolicyReportContact
Notes
Past Papers
Blogs
Todo
Analytics
    Current Subject
    🧩
    Computer Organization and Assembly Language
    COMP3137
    Progress0 / 73 topics
    Topics
    1. Introduction to Computer Organization2. Assembly Language3. Comparison of Low-Level and High-Level Languages4. Register Types (16-bit): General Purpose and Special Purpose Registers5. Introduction and Usage of RAM6. Processor7. Registers8. System Bus9. Instruction Execution Cycle10. Assembly and Machine Language11. Assembler12. Linker and Link Libraries13. Programmer's View of a Computer System14. RISC and CISC Architecture15. Physical Address Calculation16. Basic Memory Organization17. CPU Organization18. Top Level View of Computer Function and Interconnection19. Assembler Instruction Cycle20. Execute Cycle21. Interrupts22. Interrupt Cycle23. Memory Connection24. Input/Output Connection25. CPU Connection26. MASM27. MIPS28. Defining Data in MASM Assembler29. Elements of Assembly Language30. Integer Constants31. Integer Expressions32. Real Number Constants33. Character Constants34. String Constants35. Reserved Words36. Identifiers37. Directives38. Instructions39. The NOP (No Operation) Instruction40. Adding and Subtracting Integer41. INC and DEC Instructions42. NEG Instruction43. How to Move Integer Number in Register44. Adding and Subtracting Numbers in Registers45. Declaration and Initialization of Variables46. Moving Data from Variable to Register47. Data Definition Statement48. BYTE and SBYTE Data49. WORD and SWORD Data50. Defining DWORD and SDWORD Data51. Knowledge about Different Data Types52. Operations, Array & Loops53. Division and Multiplication in Assembly54. Jumps Based on Specific Flags55. Jumps Based on Equality56. Simple Jump Statements57. Jumps Based on Specific Condition58. Code Examples59. Practice on MASM60. Procedures61. File Operations Procedures62. Labels in Procedures63. Stack64. Runtime Stack65. Conditional Control Flow Directives66. Compound Expressions67. Data Representation & Conversion68. Architecture69. Data Path70. Control Unit71. Critical Path72. General Principles of Pipelining73. Pipelined Y86 Implementations
    COMP3137›Data Path
    Computer Organization and Assembly LanguageTopic 69 of 73

    Data Path

    7 minread
    1,244words
    Intermediatelevel

    Data Path in Computer Architecture

    In computer architecture, the data path refers to the collection of functional units, registers, and buses that manage the flow of data during the execution of instructions. It is essentially the part of the CPU that performs operations on the data, such as arithmetic operations, data movement, and logical operations. The data path works in conjunction with the control unit to process instructions and perform tasks.

    Key Components of a Data Path

    A data path typically consists of the following major components:

    1. Registers:

      • Registers are small, fast storage locations used to hold data temporarily.
      • Examples of registers include:
        • General-purpose registers (GPRs): Used to store intermediate results and operands.
        • Special-purpose registers: Used for specific purposes, such as the Program Counter (PC), which holds the address of the next instruction to execute, and the Status Register (SR), which holds flags like zero, carry, or overflow.
    2. Arithmetic and Logic Unit (ALU):

      • The ALU is responsible for performing arithmetic (addition, subtraction, etc.) and logical (AND, OR, NOT, etc.) operations on the data.
      • The ALU can take inputs from registers and memory, perform operations, and store the result in a register.
    3. Multiplexers (MUX):

      • A multiplexer is used to select one of several inputs and send it to the output.
      • In the data path, multiplexers are commonly used to decide between different sources for inputs to the ALU, such as whether to use data from memory or from a register.
    4. Buses:

      • Buses are the communication channels that carry data between registers, the ALU, memory, and other components of the CPU.
      • There are typically three types of buses in a system:
        • Data bus: Carries data.
        • Address bus: Carries memory addresses for reading/writing.
        • Control bus: Carries control signals to direct the operations of the system.
    5. Memory:

      • Memory is where data is stored. The data path includes connections to primary memory (RAM) for reading and writing data during instruction execution.
      • Cache memory may also be part of the data path, serving as high-speed storage for frequently accessed data.
    6. Control Signals:

      • The control unit sends control signals that direct the flow of data through the data path.
      • These signals include enabling registers, selecting multiplexers, determining which ALU operation to perform, and controlling memory read/write operations.

    The Instruction Cycle and Data Path

    The data path is involved in the execution of instructions during the instruction cycle (also known as the fetch-decode-execute cycle). Here's a simplified flow of how the data path operates during the execution of an instruction:

    1. Fetch:

      • The Program Counter (PC) holds the address of the next instruction to be executed.
      • The control unit sends a read signal to memory to fetch the instruction.
      • The instruction is loaded into the Instruction Register (IR).
      • The PC is incremented to point to the next instruction.
    2. Decode:

      • The Instruction Register holds the instruction to be decoded.
      • The control unit decodes the instruction to understand what operation is needed.
      • The control signals are set up to select the correct registers and functional units for the operation.
    3. Execute:

      • The data path is responsible for carrying out the operation.
        • The appropriate data is fetched from registers or memory.
        • If an arithmetic or logical operation is required, the data is passed to the ALU, which performs the operation.
        • The result of the operation is written back to a register or memory.
      • If needed, the data path involves shifting or rotating data, adding, subtracting, or performing logical operations.
    4. Memory Operations:

      • In some cases, the CPU will read data from memory or write data back to memory as part of the execution.
      • The memory address register (MAR) holds the address for memory operations.
      • The memory buffer register (MBR) holds the data being read from or written to memory.

    Data Path in RISC vs CISC Architectures

    The data path design can vary depending on the CPU architecture being used. The two main types of processor architectures that influence the data path are RISC (Reduced Instruction Set Computing) and CISC (Complex Instruction Set Computing).

    RISC (Reduced Instruction Set Computing)

    • RISC architectures have a simpler and more uniform instruction set, with each instruction typically taking one clock cycle.
    • The data path in RISC is often highly streamlined. Since RISC instructions are designed to be simple and consistent, the data path involves fewer stages, making it efficient for pipelining.
    • Common RISC processors include MIPS and ARM.

    Key Features of RISC Data Path:

    • Large number of general-purpose registers (used for intermediate values).
    • The ALU performs most operations, minimizing memory access.
    • Load/store architecture: memory is accessed only with specific load/store instructions, meaning other operations can be executed independently of memory.

    CISC (Complex Instruction Set Computing)

    • CISC architectures use a more complex instruction set, where each instruction can perform multiple operations (e.g., load, arithmetic, and store in one instruction).
    • The data path in CISC tends to be more complex, as the CPU must handle more complex instructions that may involve multiple memory accesses and more intricate addressing modes.
    • Common CISC processors include x86 processors.

    Key Features of CISC Data Path:

    • Smaller number of registers compared to RISC.
    • Instructions often involve a variety of operations, potentially with multiple memory accesses.
    • Data path is more complex to handle the varied and complex instructions.

    Example: Data Path for a Simple Addition Operation

    To illustrate how the data path works, let's walk through an example of adding two numbers.

    1. Instruction Fetch:

    • The Program Counter (PC) points to the memory location of the next instruction.
    • The Control Unit fetches the instruction (e.g., ADD R1, R2, R3), which tells the CPU to add the contents of registers R2 and R3 and store the result in R1.

    2. Instruction Decode:

    • The instruction is decoded by the Control Unit, which determines that the operation is addition and specifies the source registers (R2, R3) and the destination register (R1).
    • Control signals are sent to select the appropriate registers.

    3. Operand Fetch:

    • The values of R2 and R3 are read from the registers and sent to the ALU.

    4. Execution (ALU Operation):

    • The ALU performs the addition operation on the values of R2 and R3.
    • The result is computed and stored in the output register.

    5. Write-back:

    • The result is written back to R1.
    • The Program Counter (PC) is incremented to the address of the next instruction.

    Data Path and Pipelining

    In modern CPUs, data paths are optimized for pipelining, where multiple instructions can be processed in parallel at different stages of execution.

    • A typical pipelined data path will have multiple stages:
      • IF (Instruction Fetch)
      • ID (Instruction Decode)
      • EX (Execute)
      • MEM (Memory Access)
      • WB (Write-back)

    Each instruction moves through these stages, allowing multiple instructions to be in different stages simultaneously. This increases throughput and performance.


    Conclusion

    The data path is a fundamental concept in computer architecture that refers to the flow of data within the processor during instruction execution. It encompasses components such as registers, the ALU, buses, memory, and control signals, all working together to process data. Understanding the data path is crucial for optimizing the performance of both hardware and software, particularly in the context of instruction execution, pipelining, and data manipulation.

    In different architectures (RISC or CISC), the data path design and complexity can vary, but the core principles remain the same — efficiently moving data and executing operations to carry out program instructions.

    Previous topic 68
    Architecture
    Next topic 70
    Control Unit

    Past Papers

    Open this section to load past papers

    Click on Show Past Papers to see past papers.
    On This Page
      Reading Stats
      Est. reading time7 min
      Word count1,244
      Code examples0
      DifficultyIntermediate