Wednesday, October 22, 2008

CPU Functions

CPU functions

  • Running programs - programs that are stored in the main way to take instruction - instruction, testing and instruction exsecution one by one according to the groove.
  • The view most simple program execution process is to take the processing instruction that consists of `two steps, namely:
* Operation reading the instructions (Fetch)
* Operation of instruction (execute)

Instruction cycle
  • Consists of Fetch cycle and the cycle execution

Fetch cycle - execution
  • At each cycle instruction, the CPU will initially read instructions from memory.
  • There are registers in the CPU, which functions control and calculate the next instruction, called the Program Counter (PC)
  • PC will add one calculation each time the CPU to read the instructions.
  • Instructions - read the instructions that will be made in the Instruction Register (IR).
  • Instructions - in the form of this instruction code - the code binner the interpretation can be done by the CPU and the action required.

The CPU Action
  1. CPU - Memory, the movement of data from the CPU to memory and vice versa.
  2. CPU and I / O, the movement of data from the CPU to the module I / O and vice versa.
  3. Data processing, the CPU establish a number of arithmetic and logic operations of the data.
  4. Control, is the instruction to control functions or work. For instance affairs conversion instruction execution.

Details cycle execution
  • Instruction Address Calculation (IAC), namely Calculation or determine the address of the next instruction that will be executed.
  • Involving the number of permanent additions to address previous instructions.
>> For example, if the length of each 16 bit instructions have
a long memory when 8 bits, then add 2 to address previously.

Cycle execution
  • Cycle for an instruction execution can involve more than a reference to the memory.
  • In addition, an instruction can determine an operation I / O.
  • Instruction Fetch (IF), read the instructions from the authorities or the location of memory to the CPU.
  • Instruction Operation Decoding (IOD), which analyzes the instructions to determine the type of operations that will be formed and operand that will be used.
  • Operand Address Calculation (OAC), which determine the address operand, this is done when the reference operand involved in memory.
  • Operand Fetch (OF), is taking operand from memory or from the module I / O.
  • Data Operation (DO), which is formed in which the operating instructions.
  • Operand store (OS), the results of execution to save the memory.

Figure cycle instructions



Function Interruptions
  • Mechanism termination or transfer of the processing instructions in the CPU to the routine interruptions.
  • Almost all modules (memory and I / O) have a mechanism that can work to interrupt CPU.

Goals Interrupts
  • In general, for management execution routine instructions to effective and efficient inter-module and the CPU - the module I / O and memory.
  • Each component of the computer can run tasks simultaneously, but the control is located on the CPU in addition to the speed of execution - each module is different.
  • Can work as the synchronization between the modules

Kind of class signal interruptions
  • Program, the interruptions are raised with several conditions that occur on the results of program execution.
* Example: aromatic overflow, the division of zero, operation illegal.
  • Timer, is the interruption of the timing raised in the processor.
* Signals allows operating systems to run certain functions regularly.

Kind of class signal interruptions
  • I / O, signal interruptions that are raised by the module I / O notification in respect of conditions of error and a resolution of the operation.
  • Hardware failure, is raised by the interruption of power failure or memory parity errors.

The process Interrupt
  • With the mechanism interruptions, the processor can be used for executing other instructions.
  • When a module is finished and ready to run the duty to receive the next assignment, the module will send a request interruptions to the processor.

The process Interrupt
  • Then, the processor will stop the execution of run to manhandle routine interruptions.
  • Once the program is completed, the interruption processor will continue the program execution again.
  • When interruptions received signal processor there are two possible actions, namely interruptions accepted or rejected suspended and interruptions.

Interruptions Suspended
What do processors?
  • Processors suspend the execution of programs that run and save the context. This is the address of store instructions that will be exercised and other relevant data.
  • Processors set the program counter (PC) to address early routine Interrupt handlers.

Cycle execution by the processor with the function of interruptions


Operating system complex
  • Interruption double (multiple Interrupt).
* For example, a computer will receive the request interruptions
during the printing process is completed with
the printer, in addition to the possible channels
of communication will submit a request
each time the interruption of data arrived.
  • Can be taken two approaches to handle this double interruption.

Interrupts dual approach
There are 2 approaches:
  • This approach is called sequential processing interruptions / sequential.
* Reject or other interruptions do not allow the interruption of a processor handled.
* Once completed processor handles the interruption of a new handled other
interruptions.

Interrupts dual approach
  • Processing interruption nest that is defining priorities for the interruption.
* Interrupt Handler: allow interruptions priorities higher handled first.

Multiple Interrupts - Sequential


Multiple Interrupts - Nested


Case
  • A system has three devices I / O: printers, disk, and communication channels, each - their priorities 2, 4 and 5. How will the process interruptions?
  • At the beginning of the printing system with a printer, when there is data on the delivery channel of communication so that communication module to request interruptions.
  • The transfer of the execution of interruption of communication modules, the printer interruptions while suspended.
  • When execution communication module, the interruption disk, but a lower priority because of the interruption suspended disk.
  • After the interruption of communication modules will be completed by interruptions that have higher priority, namely the disk.
  • When the disk is finished interruption, the execution interruptions printer. `Then the execution of the main program.

0 comments: