Computer Hardware system

https://www.computersprofessor.com/2017/10/computer-hardware-system.html
Computer Hardware system
The physical parts that make up a computer, which are interconnected electronic devices are called hardware. These devices are capable of computing and manipulating information. Examples of hardware are C.P.U, input devices like keyboard, mouse, output devices like printer, monitor. Therefor Hardware constitutes :
- Processor Unit/CPU
- Input Devices
- Output Devices
- Central Processing Unit
CPU or processor is also often called the brain of the computer. All major calculations and comparisons performed by a computer are carried out inside its CPU. CPU is also responsible for activating and controlling the operations of other units of a computer system. Hence, no other single component of a computer determines its overall performance as much as its CPU. The CPU is fabricated as a single Integrated chip (IC), and is known as microprocessor. The microprocesoor is plugged in to the motherboard of the computer. CPU consists of :
i. Arithmetic Logic Unit (ALU),
ii. Control Unit (CU) and
iii. set of registers which are temporary storage areas for holding data and instructions.
i. Arithmetic Logic Unit
ALU of a CPU is the place where actual execution of instructions takes place during data processing operation. When the control unit encounters an instruction that involves an arithmetic operation (such as add, subtract, multiply, divide) or a logic operation (such as less than, equal to, greater than) it passes control to the ALD. The ALU has some special purpose registers (whose functions are described in a later subsection) and necessary circuitry to carry out all arithmetic and logic operations included in the set, of instructions supported by the CPU. For example, control unit might load two numbers into ALU registers and then tell the ALU to add them (an arithmetic operation) or to check if they are equal (a logical operation).
ii. Control Unit
The control unit of the CPU selects and interprets program instructions and then coordinates their execution. It has some special purpose registers (whose functions are described in a later subsection) and a decoder to perform these activities. The special purpose registers named instruction register and program control register, respectively, hold the current instruction and the next instruction to be executed and in this way help the control unit in instruction selection. On the other hand, the decoder has necessary circuitry to decode and interpret the meaning of every instruction supported by the CPU. Each instruction is accompanied by microcode – very basic directions that tell the CPU how to execute the instruction.
Although, the control unit does not perform any actual processing of data, it acts as the central nervous system for all other components of computer. It manages and coordinates the entire computer system including its input and output units. It obtains instructions from a program stored in main memory, interprets the instructions, and issues signals that cause other units of the system to execute them.
iii. Registers
As instructions. are interpreted and executed by a computer’s CPU, there is movement of information between various units of the computer. In order to handle this process satisfactorily and to speed up the rate of information transfer, a number of special memory units called registers are used. These registers are used to hold information on a temporary basis and are part of the CPU (not main memory). The length of a register equals the number of bits it can store. Hence, a register that can store 8 bits is referred to as an 8-bit register. Most CPU s sold today have 32~bit or 64-bit registers. The length of registers of a computer is sometimes called its word size. The bigger the word size, the faster a computer can process a set of data. With all other parameters, being same, a CPU with 32-bit registers can process data twice as large as one with 16-bit registers. Although, the number of registers varies from computer to computer, there are some registers common to all computers. Functions of these registers are described below
a) Main Address Register (MAR)
It holds the address of the active memory location. It is loaded. from program control register when an instruction is read from memory.
b) Memory Buffer Register(MBR)
It holds the contents of the accessed (read/written) memory An instruction word placed in this register is transferred to instruction register. A data word placed in this register is accessible for operation with accumulator register . A word to be stored in a memory location must be transferred first to MBR from where it is written in memory.
c) Program Control Register (PC)
It holds the address of the next instruction to be executed. Normally, the instructions of a program are stored in consecutive memory locations and are executed in sequence unless a branch instruction is encountered. A branch instruction is an operation that caused a transfer to a non-consecutive instruction. The address part of a branch instruction is transferred to PC register to become the address of the next instruction.
d) Accumulator Register
It holds the data to be operated upon, the intermediate results and the results of processing, It is used during execution of most instructions. Results of arithmetic operations are returned to accumulator register for transfer to main memory through the memory buffer register; In many computers, there are more than one accumulator registers.
e) Instruction Register
It holds the current instruction being As soon as the instruction is stored in this register, the operating part and .the address part of the instruction are separated. The address part often instruction is sent to MAR while its operation part is sent to control unit were It is decoded and interpreted. Finally, the control unit generates command signals for’ execution of the task specified by the instruction.
f) Input/Output Register
It is used to communicate with input/output devices. All input information such as instructions and data are transferred to this register by an input device. Similarly all output information to be transferred to an output device is found in this register.
Execution of an instruction by CPU during program execution normally involves following steps:
- The control unit takes the address of the next program instruction to be executed from program control register and reads the instruction from corresponding memory address into the instruction register of control unit.
- The control unit then sends the operation part and address part of the instruction to the decoder and memory address register, respectively.
- The decoder interpret the instruction and accordingly the control unit seeds to the appropriate unit that needs to be involved in carrying out the task specified in the instruction. For example, it is an arithmetic or logic operations, signal is sent to ALU. In this case the control unit also ensures that the data corresponding to the address part of the instruction is loaded in a suitable register in ALU before the signal is sent to ALU. The ALU performs the necessary operation on the data and signals the control unit as soon as it has finished.
- As each instruction is executed, the address of the next instruction to be executed is loaded into the program control register automatically, and steps 1 to 4 are repeated.