CPU Structure & Function | Computer Architecture & Organisation (CAO) - Computer Science Engineering (CSE) PDF Download

CPU Structure and Function
 CPU Structure and Function Processor Organization

  • Things a CPU must do:
    Fetch Instructions
    Interpret Instructions
    Fetch Data
    Process Data
    Write Data

CPU Structure & Function | Computer Architecture & Organisation (CAO) - Computer Science Engineering (CSE)

  • A small amount of internal memory, called the registers, is needed by the CPU to fulfill these requirements

CPU Structure & Function | Computer Architecture & Organisation (CAO) - Computer Science Engineering (CSE)

Fig: Internal Structure of the CPU

  • Components of the CPU
    • Arithmetic and Logic Unit (ALU): does the actual computation or processing of data
    • Control Unit (CU): controls the movement of data and instructions into and out of the CPU and controls the operation of the ALU.

Register Organization

  • Registers are at top of the memory hierarchy. They serve two functions:
    1. User-Visible Registers enable the machineor assembly-language programmer  to minimize main-memory references by optimizing use of registers
    2. Control and Status Registers used by the control unit to control the operation of the CPU and by privileged, OS programs to control the execution of programs

User-Visible Registers
Categories of Use

  • General Purpose registers for variety of functions
  • Data registers hold data
  • Address registers hold address information
  • Segment pointers hold base address of the segment in use
  • Index registers used for indexed addressing and may be auto indexed
  • Stack Pointer a dedicated register that points to top of a stack. Push, pop, and other stack instructions need not contain an explicit stack operand.
  • Condition Codes (flags)

Design Issues

  • Completely general-purpose registers or specialized use? 
    • Specialized registers save bits in instructions because their use can be implicit
    • General-purpose registers are more flexible
    • Trend is toward use of specialized registers
  • Number of registers provided?
    • More registers require more operand specifier bits in instructions
    • 8 to 32 registers appears optimum (RISC systems use hundreds, but are a completely different approach)
  • Register Length?
    • Address registers must be long enough to hold the largest address
    • Data registers should be able to hold values of most data types
    • Some machines allow two contiguous registers for double-length values
  • Automatic or manual save of condition codes?
    • Condition restore is usually automatic upon call return
    • Saving condition code registers may be automatic upon call instruction, or may be manual

Control and Status Registers

  • Essential to instruction execution 
    • Program Counter (PC)
    • Instruction Register (IR)
    • Memory Address Register (MAR) usually connected directly to address lines of bus
    • Memory Buffer Register (MBR) usually connected directly to data lines of bus
  • Program Status Word (PSW) also essential, common fields or flags  contained include: 
    • Sign sign bit of last arithmetic operation
    • Zero set when result of last arithmetic operation is 0
    • Carry set if last op resulted in a carry into or borrow out of a high-order bit
    • Equal set if a logical compare result is equality
    • Overflow set when last arithmetic operation caused overflow
    • Interrupt Enable/Disable used to enable or disable interrupts
    • Supervisor indicates if privileged ops can be used   
  • Other optional registers
    • Pointer to a block of memory containing additional status info (like process control blocks)
    • An interrupt vector
    • A system stack pointer
    • A page table pointer
    • I/O registers
  • Design issues 
    • Operating system support in CPU
    • How to divide allocation of control information between CPU registers and first part of main memory (usual tradeoffs apply)

CPU Structure & Function | Computer Architecture & Organisation (CAO) - Computer Science Engineering (CSE)CPU Structure & Function | Computer Architecture & Organisation (CAO) - Computer Science Engineering (CSE)

The Instruction Cycle 
Basic instruction cycle contains the following sub-cycles.

  • Fetch - read next instruction from memory into CPU
  • Execute - Interpret the opcode and perform the indicated operation
  • Interrupt - if interrupts are enabled and one has occurred, save the current process state and service the interrupt

CPU Structure & Function | Computer Architecture & Organisation (CAO) - Computer Science Engineering (CSE)

CPU Structure & Function | Computer Architecture & Organisation (CAO) - Computer Science Engineering (CSE)

The Indirect Cycle

  • Think of as another instruction sub-cycle
  • May require just another fetch (based upon last fetch)
  • Might also require arithmetic, like indexing

CPU Structure & Function | Computer Architecture & Organisation (CAO) - Computer Science Engineering (CSE)

Data Flow

  • Exact sequence depends on CPU design
  • We can indicate sequence in general terms, assuming CPU employs:
    • a memory address register (MAR)
    • a memory buffer register (MBR)
    • a program counter (PC)
    • an instruction register (IR)

Fetch cycle data flow

  • PC contains address of next instruction to be fetched
  • This address is moved to MAR and placed on address bus
  • Control unit requests a memory read
  • Result is
    • placed on data bus
    • result copied to MBR
    • then moved to IR
  • Meanwhile, PC is incremented

CPU Structure & Function | Computer Architecture & Organisation (CAO) - Computer Science Engineering (CSE)

CPU Structure & Function | Computer Architecture & Organisation (CAO) - Computer Science Engineering (CSE)

Indirect cycle data flow 

  • Decodes the instruction
  • After fetch, control unit examines IR to see if indirect addressing is being used. If so:
  • Rightmost n bits of MBR (the memory reference) are transferred to MAR
  • Control unit requests a memory read, to get the desired operand address into the MBR

 

CPU Structure & Function | Computer Architecture & Organisation (CAO) - Computer Science Engineering (CSE)

Execute cycle data flow
- Not simple and predictable, like other cycles
- Takes many forms, since form depends on which of the various machine instructions is in the IR
- May involve

  • transferring data among registers
  • read or write from memory or I/O
  • invocation of the ALU

CPU Structure & Function | Computer Architecture & Organisation (CAO) - Computer Science Engineering (CSE)

Interrupt cycle data flow

  • Current contents of PC must be saved (for resume after interrupt), so PC is transferred to MBR to be written to memory
  • Save location’s address (such as a stack ptr) is loaded into MAR from the control unit
  • PC is loaded with address of interrupt routine (so next instruction cycle will begin by fetching appropriate instruction)

 

CPU Structure & Function | Computer Architecture & Organisation (CAO) - Computer Science Engineering (CSE)

 

CPU Structure & Function | Computer Architecture & Organisation (CAO) - Computer Science Engineering (CSE) 

The document CPU Structure & Function | Computer Architecture & Organisation (CAO) - Computer Science Engineering (CSE) is a part of the Computer Science Engineering (CSE) Course Computer Architecture & Organisation (CAO).
All you need of Computer Science Engineering (CSE) at this link: Computer Science Engineering (CSE)
20 videos|86 docs|48 tests

Top Courses for Computer Science Engineering (CSE)

FAQs on CPU Structure & Function - Computer Architecture & Organisation (CAO) - Computer Science Engineering (CSE)

1. What is the structure of a CPU?
Ans. The structure of a CPU, or Central Processing Unit, typically consists of three main components: the control unit, the arithmetic and logic unit (ALU), and registers. The control unit coordinates and manages the execution of instructions, while the ALU performs mathematical and logical operations. Registers are small, high-speed memory units used to store data and instructions temporarily during processing.
2. How does the control unit function in a CPU?
Ans. The control unit is responsible for directing the flow of data and instructions within the CPU. It fetches instructions from memory, decodes them, and then coordinates the execution of these instructions by sending signals to different parts of the CPU. The control unit also manages the timing and synchronization of operations, ensuring that instructions are executed in the correct sequence.
3. What is the role of the ALU in a CPU?
Ans. The Arithmetic and Logic Unit (ALU) is the component of a CPU that performs mathematical calculations and logical operations. It can add, subtract, multiply, and divide numbers, as well as perform logical operations like AND, OR, and NOT. The ALU operates on data stored in registers and produces results that are then stored back in registers or sent to memory.
4. How do registers contribute to the functioning of a CPU?
Ans. Registers are small, fast memory units located within the CPU. They play a crucial role in the CPU's functioning by temporarily storing data and instructions during processing. Registers provide quick access to data, allowing the CPU to perform operations on them without having to access main memory. They also hold the intermediate results of calculations before they are stored back in memory.
5. What is the significance of the CPU structure in computer performance?
Ans. The structure of a CPU directly impacts computer performance. A well-designed CPU structure with efficient components, such as a fast ALU and an optimized control unit, can enhance the speed and efficiency of processing. Additionally, the use of registers for temporary storage reduces the need to access slower main memory, improving overall performance. Therefore, a well-structured CPU is crucial for achieving optimal computing performance.
20 videos|86 docs|48 tests
Download as PDF
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev
Related Searches

Summary

,

study material

,

Free

,

CPU Structure & Function | Computer Architecture & Organisation (CAO) - Computer Science Engineering (CSE)

,

CPU Structure & Function | Computer Architecture & Organisation (CAO) - Computer Science Engineering (CSE)

,

practice quizzes

,

Objective type Questions

,

pdf

,

MCQs

,

ppt

,

Exam

,

video lectures

,

Previous Year Questions with Solutions

,

Viva Questions

,

Semester Notes

,

shortcuts and tricks

,

past year papers

,

Extra Questions

,

Important questions

,

CPU Structure & Function | Computer Architecture & Organisation (CAO) - Computer Science Engineering (CSE)

,

Sample Paper

,

mock tests for examination

;