CPU FUNCTION
The main function of the CPU is running programs that are stored in the main memory. This is done by taking instructions from main memory and executed one by one in accordance with the flow of orders. This work was done in two stages of reading instruction (fetch) and execute those instructions (execute). The process of reading and implementing this is done repeatedly until all instructions contained in main memory is executed or the computer is turned off. This process is also known as fetch-execute cycle.
Fetch-execute cycle can be explained as follows:
1. Instruction Fetch (Taking Instructions)
CPU must read the instruction from memory
2. Interpret Instruction (Translating Instructions)
Instructions should be instructed to determine what action needs to be taken
3. Fetch Data (Taking Data)
Execution of an instruction requires reading from memory or I / O module
4. Process Data (Data Processing)
Execution of an instruction requires arithmetic or logic to the data
5. Write Data
Execution results require writing data to memory or I / O module
How it Works CPU

> Read, encode and execute program instructions
> Sending data to and from memory, as well as from and to the input / output.
> Responding to interruptions from the outside.
> Providing clock and control signals to the system.In doing the above, it is clear the CPU needs to store data temporarily. CPU need to remember the location of the last instruction that CPU will be able to take the next instruction. CPU needs to store instructions and data for the time when the instruction was dieksekusi.Dengan other words, the CPU requires a small internal memory called the Registry.Arithmetic and Logic Unit (ALU) functions form the operations of arithmetic and logic to the data registers store temporary data and results of ALU operations.Control unit generates signals ,, which will control the operation of the ALU, and data transfers from or to the ALU.
CPU components

> Arithmetic and Logic Unit (ALU)
> Control Unit (CU)
> Registers
> CPU Interconnections

ALU
Arithmetic And Logic Unit (ALU) is one of the inside of a microprocessor which functions to perform arithmetic and logic operations count. Examples of arithmetic operations are operations of addition and subtraction, while an example of the logic operation is a logical AND and OR.The main task of the ALU (Arithmetic And Logic Unit) is doing all arithmetic or mathematics which occur in accordance with the instructions of the program. ALU perform other arithmetic operations. Such as subtraction, subtraction, and division is done on the basis of the sum. So that the electronic circuits in the ALU used to perform arithmetic operations is called adder.ALU perform arithmetic operations on the basis of the increase, while the other arithmetic operations, such as subtraction, multiplication, and division is done on the basis of the sum. so that the electronic circuits in the ALU used to perform arithmetic operations is called adder. Traffic assignment of the ALU is to make the decision of logic operations in accordance with instructions of the program. Logic operations (logical operation) includes a comparison of two logic elements using logical operators, namely:
- equals (=)
- is not equal to (<>)
- less than (<)
- less than or equal to (<=)
- greater than (>)
- greater or equal to (> =)
Control Unit ( CU )

The task of the CU is as follows:
- Organize and control the means of input and output.
- Taking instructions from main memory.
- Retrieve data from main memory if required by the process.
- Send instructions to the ALU if any arithmetic or logical comparisons, and oversees the work.
- Stores results into the main memory.
Type Control Unit (CU)
Single-Cycle CUCU process only occurs in one clock cycle, meaning that every instruction is in one cycle, and therefore does not require a state. Thus the Boolean function of each control line is only a function of the opcode alone. Clock cycle must have the same length for each type of instruction. There are two parts to this control unit, which is a process to decode the opcode to categorize them into four kinds of instruction (ie gate), and providing control signals based on the type of instruction (ie the OR gate). The fourth type of instruction is "R-format" (associated with the register), "lw" (read only memory), "sw" (write to memory), and "beq" (branching). A control signal is generated depends on the type of instruction. For example if it involves memory "R-format" or "lw" will signal "Regwrite" will be active. Another thing if it involves memory "lw" or "sw" will be given control signal to the ALU, namely "ALUSrc". Single-cycle design is more able to work properly but this cycle is not efficient.
Multi-Cycle CUIn contrast to the control unit that single-cycle, multi-unit cycle control over many functions. By paying attention to the state and the opcode, Boolean function of each output control line can be determined. Each of which will be a function of the 10 pieces of logic inputs. So there will be lots of boolean functions, and each of them is not simple. At this cycle, the control signal is no longer determined by looking at the bits instructions. Opcode bits tell what the next operation will be run CPU; not the next instruction cycle.
Register

Computer systems use memory hierarchy. Where getting to the top level of the memory into a form which is faster, smaller, and certainly more expensive. The CPU has a set of registers which is above the level of the memory hierarchy main memory and cache.
Registers are small storage devices that have access to a fairly high speed, which is used to store data and instructions that are being processed, while other data and instructions are waiting to be processed is stored in the main memory. Each register can store the numbers up to a certain maximum amount depending on its size. Registers can be read and written at high speed because it is on the CPU.Register a CPU internal storage media used during data processing. Registers are temporary storage medium, meaning that the data will only be in registers when the data is needed for the computer was still alive, when the data is not needed anymore then he is not entitled longer inregisters, and when the computer is turned off then all the data contained within them will be lost.
The following function registers:
CPU registers that can be used by programmers, using set intsruksi allows one or more registers for dispesifikasian as an operand or operand address.CPU registers that can be used by programmers, using set intsruksi allows one or more registers for dispesifikasian as an operand or operand address.

- Used for addressing modes and data.
- Accumulator (arithmetic, Shift, Rotate)
- Base Register (Rotate, Shift, arithmetic)
- Counter Register (Looping)
- Data Register (save the address I / O device).
b. Register Address
- Used for addressing mode
- Segment Register (Code Segment, Segment Data, Segment Stack, Extra Segment)
- Register Index (Index Stack, Data Index)
- Stack Pointer
c. Register Data
- Used to store data
- Code that describes the results of previous operations
These registers are used by the control unit for controlling the operation of the CPU and the operating system programs to control program execution

a. Program Counter (PC)
Contains the address of the instruction to be taken
b. Instruction Register (IR)
Contains the address of the last instruction
c. Memory Address Register (MAR)
Contains the address in memory storage
d. Memory Buffer Register (MBR)
Contains data read from memory or to the memory diyliskan
CPU Interconnections
Interconnections are CPU and bus connection system that connects the internal components of the CPU, ie ALU, control unit and registers and also with external buses connecting the CPU with other systems, such as the main memory, device I/O.
Tidak ada komentar:
Posting Komentar