Memory and CPU
Memory and CPU
This
includes several types of memory, such as the processor cache and system ROM.
However, in most cases, primary memory refers to system RAM.RAM, or random
access memory, consists of one or more memory modules that temporarily store
data while a computer is running. RAM is volatile memory, meaning it is erased
when the power is turned off. Therefore, each time you start up your computer,
the operating system must be loaded from secondary memory (such as a hard
drive) into the primary memory, or RAM
whenever you launch an application on your computer, it is loaded into RAM. The
operating system and applications are loaded into primary memory, since RAM
can be accessed much faster than storage devices. In fact, the data can be
transferred between CPU and RAM more than a hundred times faster than
between the CPU and the hard drive.
Cache memory is a small amount of fast, expensive memory that is used between
two devices that communicate at different speeds, most often the CPU and RAM.
The CPU accesses the cache memory at its own, faster speed. This means the CPU
isn’t slowed by having to wait for data from the RAM.
Fetch-Decode-Execute
- Register
Inside the CPU are a number of memory locations is called register.
five examples of registers
• MAR memory address register
• MDR memory data register
• ALU arithmetic and logic unit
• PC program counter
• CIR current instruction register.
. Program counter (PC): Program counter is sometimes called sequence control register. It stores the
address of the next instruction to be fetched.
Memory address register (MAR): When the next instruction is needed, its address is copied from the PC
and placed in the memory address register.
Memory data registers (MDR): It is sometime called the memory buffer register (MBR) because it acts
like a buffer, temporarily storing a data value before passing it on to e.g. CIR..
Current instruction register (CIR): Holds the instruction that is about to be executed.
1. The PC copies the address of the next instruction to be fetched into the Memory Address Register.
2. The Memory Address Register places the address on the Address Bus (one directional channel from
processor to main memory for
3. The MAR triggers are read signal that causes main memory to place instruction being asked on the
Data Bus (two way channel b/w CPU
Decode Phase:-
o The CPU will now examine the instruction in the CIR and “decodes” it. This means that a special part of
CPU known as the Decode Unit
will make the rest of the CPU ready to carry out the instruction by sending out microinstructions. Every
CPU has its own set of legitimate
instructions known as the Instruction Set. All software eventually ends up being instructions from this
instruction set.
Execute Phase:-
o After decoding the instruction a special part of the CPU known as the Execute Unit will carry out
execution. After execution the PC will