COMPUTER SYSTEM HARDWARE
When we talk of computer hardware, three related terms that
require introduction are computer architecture, computer organization, and
computer design.
Computer Architecture
- Computer architecture refers to the structure and behavior of the computer.
- It includes the specifications of the components, for example, instruction format, instruction set, and techniques for addressing memory, and how they connect to the other components.
- Given the components, computer organization focuses on the organizational structure.
- It deals with how the hardware components operate and the way they are connected to form the computer.
- Given the system specifications, computer design focuses on the hardware to be used and the interconnection of parts.
- Different kinds of computers, such as a PC or a mainframe computer, may have different organizations; however, the basic organization of the computer remains the same.
- A computer consists of three main components:
- Input/Output (I/O) Unit
- Central Processing Unit (CPU)
- Memory Unit
- The computer user interacts with the computer via the I/O unit.
- The purpose of the I/O unit is to provide data and instructions as input to the computer and to present relevant information as output from the computer.
- CPU controls the operations of the computer and processes the received input to generate the relevant output.
- The memory unit stores the instructions and the data during the input activity, to make instructions readily available to CPU during processing.
- It also stores the processed output. This chapter discusses the hardware components of the computer and the interaction between them.
1. CENTRAL PROCESSING UNIT
- Central Processing Unit (CPU) or the processor is also often called the brain of the computer.
- CPU consists of: Arithmetic Logic Unit (ALU) Control Unit (CU)
- In addition, CPU also has a set of registers which are temporary storage areas for holding data and instructions.
- ALU performs the arithmetic and logic operations on the data that is made available to it.
- CU is responsible for organizing the processing of data and instructions.
- CU controls and coordinates the activity of the other units of the computer.
- CPU uses the registers to store the data, instructions during processing.
- CPU executes the stored program instructions, i.e. instructions and data are stored in memory before execution.
- For processing, CPU gets data and instructions from the memory.
- It interprets the program instructions and performs the arithmetic and logic operations required for the processing of data.
- Then, it sends the processed data or result to the memory.
- CPU also acts as an administrator and is responsible for supervising operations of other parts of the computer.
- The CPU is fabricated as a single Integrated Circuit (IC) chip and is also known as the microprocessor.
- The microprocessor is plugged into the motherboard of the computer (Motherboard is a circuit board that has an electronic circuit etched on it and connects the microprocessor with the other hardware components).
2. Arithmetic Logic Unit (ALU)
- ALU consists of two units: the arithmetic unit and the logic unit.
- The arithmetic unit performs arithmetic operations on the data that is made available to it. Some of the arithmetic operations supported by the arithmetic unit are:
- Addition
- Subtraction
- Multiplication
- Division
- The logic unit of ALU is responsible for performing logic operations. The logic unit performs comparisons of numbers, letters, and special characters. Logic operations include testing for:
- Greater than (>)
- Less than (<)
- Equal to (=)
- Greater than or equal to (≥)
- Less than or equal to (≤)
- ALU performs arithmetic and logic operations and uses registers to hold the data that is being processed.
3. Registers
- Registers are high-speed storage areas within the CPU but have the least storage capacity.
- Registers are not referenced by their addresses but are directly accessed and manipulated by the CPU during instruction execution.
- Registers store data, instructions, and addresses during processing. Registers are often referred to as the CPU’s working memory.
- The data and instructions that require processing must be brought into the registers of the CPU before they can be processed. For example, if two numbers are to be added, both numbers are brought into the registers, added, and the result is also placed in a register.
- Registers are used for different purposes, with each register serving a specific purpose. Some important registers in CPU are:
- Accumulator (ACC): Stores the result of arithmetic and logic operations.
- Instruction Register (IR): Contains the current instruction most recently fetched.
- Program Counter (PC): Contains the address of the next instruction to be processed.
- Memory Address Register (MAR): Contains the address of the next location in the memory to be accessed.
- Memory Buffer Register (MBR): Temporarily stores data from memory or the data to be sent to memory.
- Data Register (DR): Stores the operands and any other data.
- The number of registers and the size of each register (number of bits) help determine the power and speed of a CPU.
- The overall number of registers can vary from about ten to hundreds, depending on the type and complexity of the processor.
- The size of a register, also called word size, indicates the amount of data a computer can work with at any given time.
- The bigger the register size, the more quickly it can process data.
- The size of a register may be 8, 16, 32, or 64 bits.
- For example, a 32-bit CPU has registers that are 32 bits wide, meaning it can manipulate 32 bits of data at a time.
- Nowadays, PCs have 32-bit or 64-bit registers.
- A 64-bit processor can process data twice as fast as a 32-bit processor.
4. Control Unit (CU)
- The control unit of a computer does not perform actual data processing.
- It is known as the "Nerve Centre" of the computer.
- It organizes the processing of data and instructions.
- The CU supervises, controls, and coordinates the activity of other units within the computer.
- It directs the flow of data within the CPU, memory, and I/O devices.
- It fetches instructions, decodes them, and sends signals to the ALU and registers to execute instructions.
- It ensures proper execution of arithmetic and logic operations.
- When an instruction is executed, the Program Counter (PC) updates to fetch the next instruction.
- Processes in the Control Unit
- Fetching: Obtaining instructions from memory.
- Decoding: Understanding the instruction.
- Data Fetching: If needed, obtaining data from memory.
- Executing: The Control Unit sends the instruction and data to the ALU for execution.
- The CU also holds the Instruction Set, which lists all operations it can perform.
- The CU functions like an orchestra conductor, managing different parts of the computer for smooth operation.
5. Memory Unit
- The memory unit consists of:
- Cache memory
- Primary memory
- Primary memory (main memory) stores data and instructions during execution.
- Random Access Memory (RAM) and Read Only Memory (ROM) are the primary memory.
- In addition to the main memory, there is another kind of storage device known as the secondary memory.
- Secondary memory is non-volatile and is used for permanent storage of data and programs.
- A program or data that has to be executed is brought into the RAM from the secondary memory.
6. Cache Memory
- The data and instructions that are required for processing of data are brought from the secondary storage device and stored in the RAM.
- For processing, it is required that the data and instructions are accessed from the RAM and stored in the registers.
- The time taken to move the data between RAM and CPU registers is large.
- This affects the speed of processing of the computer and results in decreasing the performance of CPU.
- Cache memory is a very high-speed memory placed in between RAM and CPU. Cache memory increases the speed of processing.
- Cache memory is a storage buffer that stores the data that is used more often, temporarily, and makes them available to CPU at a fast rate.
- During processing, CPU first checks cache for the required data, if data is not found in cache, then it looks in the RAM for data.
- To access the cache memory, CPU does not have to use the motherboard’s system bus for data transfer. (The data transfer speed slows to the motherboard’s capability, when data is passed through system bus. CPU can process data at much faster rate by avoiding the system bus.)
- Cache memory is built into the processor and may also be located next to it on a separate chip between the CPU and RAM.
- Cache built into the CPU is faster than separate cache, running at the speed of the processor itself. However, separate cache is roughly twice as fast as RAM.
- The CPU has a built-in Level 1 (L1) cache and Level 2 (L2) cache, as shown in figure 1.20.
- In addition to the built-in L1 and L2 cache, some CPUs have a separate cache chip on the motherboard.
- This cache on the motherboard is called Level 3 (L3) cache.
- Nowadays, high-end processors come with built-in L3 cache, like in Intel Core i7.
- L1, L2, and L3 cache store the most recently run instructions, the next ones, and the possible ones, respectively.
- Typically, CPUs have cache size varying from 256KB (L1), 6MB (L2), to 12MB (L3) cache.
7.Virtual Memory
- It is the part of the hard disk which acts/reversed as RAM.
- When RAM modules become full, the CPU accesses the hard disk to store and retrieve data.
- Virtual memory is slower than RAM.
- Virtual memory is typically located in a hard drive.
- The virtual memory is an illusion of extremely large memory.