A control unit is the subcomponent of the central processing unit (CPU) that manages all of the actions performed in this area in a computer. It is responsible for taking the various inputs from the computer, instructions and data and telling the processor what to do with them. Since the CPU is considered the brain of the computer, it is sometimes referred to as the brain within the brain. Depending on the CPUs architecture, the control unit may have varied tasks to perform.
The control unit is actually made up of several sub-components. During the hardwired days, all this wiring and circuitry formed what's known as a finite-state machine, a system having a singular purpose in directing the operations of the computer. Separate circuits were responsible for decoding and encoding instructions, while others handled logic or counting the instructions the CPU worked on. Everything happened in order, where the logic circuitry would be flipped one way or another to direct the instructions to storage.
An instruction is fetched and decoded, and then it needs to be executed in order, one after another until completion. In older CPUs, the instruction would have to go through the entire process and finish calculation before the next would begin. To speed up processing, modern CPUs use what are called pipelines, where each step is part of the pipeline. While one instruction is in the execution part of the pipeline, another is already in the decode phase, and another is being fetched. To handle all this, the control unit also needed to perform the role of a multiplexer, in that it takes multiple inputs or outputs and directs them into and out of the pipeline.
As computer CPUs continued to advance, much of this changed dramatically. The use of microcode, tiny programs that sit in special, high-speed read-only memory on the CPU, took the place of the old hardwired circuitry. These low-level programs took over the time-consuming job of physically rewiring a control unit and simplified changes to the CPU's architecture. The custom-written microprograms of the control unit, created during the CPU's design phase, are what enable the architecture of a particular type of CPU.
In general, much of the control unit's responsibilities depend on the CPU architecture. Some may simply fetch, decode, coordinate the execution, and direct the output of instructions. Others may have additional responsibilities that involve translation, which may slow down the CPU. In these cases, the control unit may be further split up into succinct components, such as a separate scheduling unit, or a retirement unit that takes care of organizing and storing the results from the rithmetic logic unit (ALU).