Wednesday, July 18, 2012

CPU functions


CPU functions like a calculator, only much more powerful CPU processing power. The main function of the CPU is to perform arithmetic and logic operations on data retrieved from memory or from the information entered via some hardware, such as keyboard, scanner, lever controls, and mouse. CPU controlled using a set of instructions the computer software. Such software can be executed by the CPU to read from the storage media, such as hard disks, floppy disks, compact discs, or tape recorder. These instructions are then stored in advance in physical memory (MAA), in which each instruction is assigned a unique address called a memory address. Next, the CPU can access data on the MAA by specifying the address data is desired.

When a program is executed, the data flow from the RAM into a unit called a bus, which connects the CPU with the MAA. The data was then decoded by using a unit process referred to as pendekoder instructions that can translate the instructions. The data then goes to the arithmetic and logic unit (ALU) which performs calculations and comparisons. Data can be stored temporarily by the ALU in a memory location called a register that can be taken back to be processed quickly. ALU can perform certain operations such as addition, multiplication, and conditional tests on data in registers, sending the results back into physical memory processing, storage media, or register if will process the results of processing anymore. During this process, a unit of the CPU called the program counter will monitor the success of instructions executed so that instruction can be executed in the correct and appropriate.


Processing instructions in the CPU is divided into two phases, Phase-I called the Instruction Fetch, while Phase-II is called Instruction Execute. Phase-I consists of the Control Unit in which the CPU processing the data and / or instructions from main-memory to the register, while Phase-II consists of the CPU processing where the Control Unit to deliver the data and / or instruction from the register to the main-memory to be accommodated in the MAA, after Instruction Fetch done. Time on stage coupled with time-I-II phase is called the machine cycle time (machine cycles time).

In the CPU program counter is generally moving in sequence. However, some instructions in the CPU, which is called by a jump instruction, allowing the CPU to access the instruction is not in order. This is called branching instructions (branching instruction). Branches can be such instructions are conditional branches (having a certain condition) or non-conditional. A branch of a non-conditional always move to a new instruction that is outside the flow of instruction, while a conditional branch will first examine the results of previous operations to see if the branch instruction to be executed or not. Data were tested for the branching instruction is stored at a location called the flag.

Most CPUs can handle two types of numbers, namely fixed-point and floating-point. Fixed-point numbers have a specific digit value at one decimal point. This does limit the range of possible values ​​for these figures, but this would be calculated by the CPU faster. Meanwhile, floating-point numbers are numbers expressed in scientific notation, where a number is represented as a decimal number is multiplied by powers of 10 (such as 3.14 x 1057). Scientific notation like this is a short way of expressing very large numbers or very small numbers, and also allow the range of values ​​that are very far before and after the decimal point. These numbers are generally used to represent graphs and scientific work, but the arithmetic of floating-point numbers are much more complicated and can be completed in a longer time by the CPU as they may be able to use some CPU cycle rate. Some computers use its own processor to calculate a floating-point numbers called with FPU (also called a math co-processor) that can work in parallel with the CPU to speed up floating-point computation. FPU is now a standard in most computers because most application as it currently operates using floating-point numbers.

No comments:

Post a Comment