Essentially, all a CPU does is carry out
instructions, one after another, billions of
times a seconds. The Fetch-Decode-Execute
cycle describe how it does it.
1)Copy memory address from the program counter to the MAR
2)Copy the instructions stored in the MAR address to the MDR.
3)Increment (increase) the program counter to the point to the address of the address of the next
instructions, ready for the next cycle
Decode instructions
The instruction in the MDR is decoded by the CU. The CU may then
prepare for the next step, e.g by loading values into the MAR or MDR
Execute instruction
The instructions is performed. This could be: Load data from memory, write data to
memory, do a calculation or logic operation (using the ALU), change the address in the
PC, or halt the program
Registers
Accumulator - The part of the ALU that stores the intermediates results when doing a calculation
Memory address register (MAR) -Holds memory
address about to be used by the CPU. Remember -
MAR stores Address, MDR stores Data.
MDR (Memory Data Register) Holds data or instructions
that have been fetched from memory. Remember - MAR
stores Address, MDR stores Data.
Program Counter Holds the memory address of the instruction for each cycle. It
has the easiest job because it points to the first instruction for each cycle.
The CPU has three main parts
The control unit (CU)
The control unit is in overall control of the CPU. Its main job is to execute program
instructions by following the fetch-decoded-execute cycle. It controls the flow of data
inside the CPU ( to registers, ALU, cache ) and outside the CPU ( To main memory and
input/Output devices)
The Arithmetic logic unit (ALU)
It does all the calculation. It completes simple addition and subtraction, compares the size of numbers and can d multiplications and
division using repeated addition and subtraction. It performs logic operation such as AND, OR and NOT and binary shift. It contains
the accumulator register.
The cache
The cache is very fast memory in the CPU
Hardware is the physical components that make up a
computer system some examples of this is RAM, Fan and
Mouse
software is the program or applications that a computer can run some
examples of this are Word processor, Browser and File manager
What is clock speed ? Clock speed is the higher the clock speed, the more instructions can be executed
each second
What is number of cores? Number of cores are how many physical CPUs
cores are on the chip. The more cores, the more instruction can be carried
out simultaneously
what is cache size? the cache is an area of memory on the CPU used
for frequently used instructions. The larger this is, the more frequently
used instruction can be stored and accessed quickly as it will not have
to go to RAM so often.
An embedded system is a computer system built into another device
some examples of this are microwaves, dishwasher and washing machine.
How is Von Neumann architecture different from harvard architecture ? A Von
Neumann architecture is where programs and data can be stored in the same
memory unit. In Harvard architecture these were stored in seperate memory
units and entering or altering programs was harder