Instruction unit
Encyclopedia
The instruction unit in a central processing unit
(CPU) is responsible for organising for program instructions to be fetched from memory, and executed, in an appropriate order. It is a part of the control unit
, which in turn is part of the CPU.
In the simplest style of computer architecture
, the instruction cycle
is very rigid, and runs exactly as specified by the programmer
.
In the Instruction Fetch part of the cycle,
the contents of the program counter
(PC) register are placed on the address bus
, and sent to the memory unit
;
the memory unit returns the instruction at that address, and it is latched into the Instruction Register
(IR);
and the contents of the PC are incremented or over-written by a new value (in the case of a Jump or Branch instruction) ready for the next instruction cycle.
This becomes a lot more complicated, though, once performance-enhancing features are added, such as instruction pipeling
, out-of-order execution
, and even just the introduction of a simple instruction cache
.
Central processing unit
The central processing unit is the portion of a computer system that carries out the instructions of a computer program, to perform the basic arithmetical, logical, and input/output operations of the system. The CPU plays a role somewhat analogous to the brain in the computer. The term has been in...
(CPU) is responsible for organising for program instructions to be fetched from memory, and executed, in an appropriate order. It is a part of the control unit
Control unit
A control unit in general is a central part of the machinery that controls its operation, provided that a piece of machinery is complex and organized enough to contain any such unit. One domain in which the term is specifically used is the area of computer design...
, which in turn is part of the CPU.
In the simplest style of computer architecture
Computer architecture
In computer science and engineering, computer architecture is the practical art of selecting and interconnecting hardware components to create computers that meet functional, performance and cost goals and the formal modelling of those systems....
, the instruction cycle
Instruction cycle
An instruction cycle is the basic operation cycle of a computer. It is the process by which a computer retrieves a program instruction from its memory, determines what actions the instruction requires, and carries out those actions...
is very rigid, and runs exactly as specified by the programmer
Programmer
A programmer, computer programmer or coder is someone who writes computer software. The term computer programmer can refer to a specialist in one area of computer programming or to a generalist who writes code for many kinds of software. One who practices or professes a formal approach to...
.
In the Instruction Fetch part of the cycle,
the contents of the program counter
Program counter
The program counter , commonly called the instruction pointer in Intel x86 microprocessors, and sometimes called the instruction address register, or just part of the instruction sequencer in some computers, is a processor register that indicates where the computer is in its instruction sequence...
(PC) register are placed on the address bus
Address bus
An address bus is a computer bus that is used to specify a physical address. When a processor or DMA-enabled device needs to read or write to a memory location, it specifies that memory location on the address bus...
, and sent to the memory unit
Computer memory
In computing, memory refers to the physical devices used to store programs or data on a temporary or permanent basis for use in a computer or other digital electronic device. The term primary memory is used for the information in physical systems which are fast In computing, memory refers to the...
;
the memory unit returns the instruction at that address, and it is latched into the Instruction Register
Instruction register
In computing, an instruction register is the part of a CPU's control unit that stores the instruction currently being executed or decoded. In simple processors each instruction to be executed is loaded into the instruction register which holds it while it is decoded, prepared and ultimately...
(IR);
and the contents of the PC are incremented or over-written by a new value (in the case of a Jump or Branch instruction) ready for the next instruction cycle.
This becomes a lot more complicated, though, once performance-enhancing features are added, such as instruction pipeling
Instruction pipeline
An instruction pipeline is a technique used in the design of computers and other digital electronic devices to increase their instruction throughput ....
, out-of-order execution
Out-of-order execution
In computer engineering, out-of-order execution is a paradigm used in most high-performance microprocessors to make use of instruction cycles that would otherwise be wasted by a certain type of costly delay...
, and even just the introduction of a simple instruction cache
CPU cache
A CPU cache is a cache used by the central processing unit of a computer to reduce the average time to access memory. The cache is a smaller, faster memory which stores copies of the data from the most frequently used main memory locations...
.
See also
- Branch prediction and the Branch prediction buffer
- Branch target predictorBranch target predictorIn computer architecture, a branch target predictor is the part of a processor that predicts the target of a taken conditional branch or an unconditional branch instruction before the target of the branch instruction is computed by the execution unit of the processor.Branch target prediction is not...
and the Branch target buffer - Branch delay slotBranch delay slotIn computer architecture, a delay slot is an instruction slot that gets executed without the effects of a preceding instruction. The most common form is a single arbitrary instruction located immediately after a branch instruction on a RISC or DSP architecture; this instruction will execute even if...
- Branch target predictor
- Instruction schedulingInstruction schedulingIn computer science, instruction scheduling is a compiler optimization used to improve instruction-level parallelism, which improves performance on machines with instruction pipelines...
- Instruction selectionInstruction selectionIn computer science, instruction selection is the stage of a compiler backend that transforms its tree-based middle-level intermediate representation into a low-level IR very close to its final target language...
- Data dependencyData dependencyA data dependency in computer science is a situation in which a program statement refers to the data of a preceding statement. In compiler theory, the technique used to discover data dependencies among statements is called dependence analysis.There are three types of dependencies: data, name, and...
or Data hazard - ScoreboardingScoreboardingScoreboarding is a centralized method, used in the CDC 6600 computer, for dynamically scheduling a pipeline so that the instructions can execute out of order when there are no conflicts and the hardware is available. In a scoreboard, the data dependencies of every instruction are logged...
- Instruction selection
- Very long instruction wordVery long instruction wordVery long instruction word or VLIW refers to a CPU architecture designed to take advantage of instruction level parallelism . A processor that executes every instruction one after the other may use processor resources inefficiently, potentially leading to poor performance...
(VLIW) - SuperscalarSuperscalarA superscalar CPU architecture implements a form of parallelism called instruction level parallelism within a single processor. It therefore allows faster CPU throughput than would otherwise be possible at a given clock rate...
processor
- Instruction prefetch bufferPrefetch bufferA prefetch buffer is a data buffer employed on modern DRAM chips that allows quick and easy access to multiple data words located on a common physical row in the memory....
and Instruction issue - OpcodeOpcodeIn computer science engineering, an opcode is the portion of a machine language instruction that specifies the operation to be performed. Their specification and format are laid out in the instruction set architecture of the processor in question...
- Analysis of Instruction parallelism, Instruction frequencies, Instruction mix
- Instruction path lengthInstruction path lengthIn computer performance, the instruction path length is the number of machine code instructions required to execute a section of a computer program. The total path length for the entire program could be deemed a measure of the algorithm's performance on a particular computer hardware...
or Instruction count
- Instruction path length