Computer Memory and Computer Software
Computer memory and computer software are both important components of a computer, and they work together to allow the computer to function properly
Lecture 3
CPU Register
In computer architecture, the CPU register holds the key role, which is small data holding place or memory, and is an integral part of the processor. It is a very fast memory of computer mainly used to execute the programs and other main operations quite efficiently. Register basically used to quickly store, accept, transfer, and operate on data based on the instructions that will be immediately used by the CPU. In memory hierarchy of a computer registers the top place and is fastest in manipulating the data. Numerous fast multiple ported memory cells are the atomic part of any register.
Operations of a CPU Register
For CPU processing, these register play a critical role. When we give the input, these are stored and in register processes and the output is from the register only.
So basically, a register will perform the following operations.
- Fetch: To fetch the instructions of the user and also the instructions that are present in the main memory in a sorted way
- Decode: The second operation is to decode the instructions that need to be performed. Thus CPU will be knowing what are the instructions
- Execute: Once the instructions are decoded, then execute operation is performed by the CPU. Once done, the result is presented on the user screen
Different types of Memory Register (CPU Register)
Registers are an essential component of a CPU, and they come in various types, each serving specific functions in the execution of instructions and data manipulation. Here are some of the common types of registers found in a CPU:
Program Counter (PC):
Purpose: The PC register, also known as the instruction pointer, holds the memory address of the next instruction to be fetched and executed. It keeps track of the sequence of instructions to be processed.
Function: It is used to determine the address in memory from which the next instruction is to be fetched.
Memory Address Register (MAR):
Purpose: The MAR register holds the memory address of the data to be read from or written to in the computer’s main memory (RAM).
Function: It specifies the address of the data location when a memory operation (read or write) is needed.
Memory Buffer Register (MBR):
Purpose: The MBR register is used to temporarily store data that is being transferred to or from the memory.
Function: When reading from memory, the data is placed in the MBR before it’s moved to other registers within the CPU, and when writing to memory, data is first stored in the MBR before being written to the specified memory location.
Instruction Register (IR):
Purpose: The IR register holds the current instruction being executed by the CPU.
Function: It stores the opcode (operation code) of the instruction and, in some architectures, the operand or data that accompanies the instruction.
General-Purpose Registers:
Purpose: These registers are used for various data processing tasks and are not dedicated to specific functions.
Function: They hold data that is currently being operated on by the CPU. Examples include the accumulator, index registers, and data registers.
Stack Pointer (SP):
Purpose: The SP register is used to keep track of the top of the stack in memory. Function: It is crucial for managing function calls, local variables, and supporting the push and pop operations on the stack.
Status Register (Flags Register):
Purpose: The status register, often referred to as the flags register, contains condition codes that store information about the result of operations.
Function: It records the outcome of operations, including information about carry, zero, sign, and overflow flags, which are used for making decisions in conditional branch instructions.
Floating-Point Registers:
Purpose: In CPUs that support floating-point operations, these registers are used to store and manipulate floating-point numbers.
Function: They facilitate mathematical operations on floating-point data, providing high precision for scientific and engineering computations.
Vector Registers:
Purpose: In vector processing units, vector registers store elements of arrays or vectors, enabling parallel processing of multiple data elements.
Function: They help accelerate tasks like multimedia processing and scientific simulations by performing operations on vector data in a single instruction.
Memory and Storage
Memory
The term ‘memory’ refers to the component within your computer that allows for short-term data access. You may recognise this component as RAM, or Random-Access Memory. “Memory” in computers is like its short-term memory. Think of it as a notepad that your computer uses to do tasks quickly. These tasks can be anything from working on documents, opening programs, to surfing the internet.
How fast and well your computer does these things depends on how big this memory is. Bigger memory mean your computer can work faster and do more things at once. So, having more memory makes your computer work better and faster.
Storage
Hard Disk Drive
Whereas memory refers to the location of short-term data, storage is the component within your computer that allows you to store and access data on a long-term basis. You may recognise this component as Hard Disk Drive. Usually, storage comes in the form of a solid-state drive or a hard drive. Storage houses your applications, operating system and files for an indefinite period. Computers need to write information and read it from the storage system, so the speed of the storage determines how fast your system can boot up, load and access what you’ve saved.