Beruflich Dokumente
Kultur Dokumente
Agus. Ramadona
Note
computer Science, University of The People, 225 S Lake Ave Suite 300, Pasadena, CA 91101,
USA
Contact: agusramadona@gmail.com
HOW A COMPUTER PROCESSOR WORK 2
Abstract
This paper is made to explain how a computer architecture is built and how the data manipulation
process occurs in a computing cycle on a processor. The way the computer works in this paper is
which was later implemented in the Universal Turing Machine (1936) and Von Neumann Machine
Keywords: stored program concept computer architecture, how computer processor work
HOW A COMPUTER PROCESSOR WORK 3
Computer based on von Neumann's concept is a device that receives input, processes data,
stores data, and provides output ("George Mason University", nd). Basically the computer consists
of several main components, namely Input/Output, Central Processing Unit, Memory and
connected using buses as in the following figure ("Southern Cross University", 1999):
The processor on a modern computer known as the Central Processor Unit (CPU), a major
component of a computer device to do computations. In the processor there are components that
have certain functions and are interrelated when running programs in each work cycle known as
the Fetch Decode Execute Cycle. To be able to understand how the processor works, we need to
know what components are included in it, the functions and how it works.
c. Control Unit
d. Instruction Decoder
e. Control Codes
HOW A COMPUTER PROCESSOR WORK 4
On the processor there is a component called Arithmetic Logical Unit which functions to
perform mathematical and logical calculations. ALU has basic functions such as: Addition,
Subtraction, logic AND, logic OR, etc. To describe an ALU we can use abstractions like the
following picture:
Figure 2 – ALU
c. Flags or Status are needed such as: Zero, Sign (positive or negative), Carry, etc.
The Clock component provides pulses with a certain speed where every 1 pulse the
computer performs one process called Fetch Decode Execute Cycle. Clock speed rate is in Hz
units.
The program counter works along with the clock pulse, where each clock pulse Program
Counter will retrieve memory location information for further instructions, after obtaining the
HOW A COMPUTER PROCESSOR WORK 5
memory address then program counter will send the information to the memory address register
(MAR).
The Control Unit component has the responsibility of decoding instructions received and
As mentioned earlier, on a CPU there is a component called Control Unit, in this control
unit there is one function called Instruction Decoder, which is a function that translates
After getting to know the components in a processor and their functions, the linkages
between these components occur sequentially in each cycle called the Fetch Decode Execute
Cycle. To understand how the sequences and work processes of these components we can give
Example:
We want the computer to perform addition of 5 + 2, the program that serves the addition then
The two input (Operands) that we enter are placed in the memory address:
The addition instructions (OpCode) are then placed on the memory address:
LOAD [3] [99] // Instruction "retrieve data from memory address 3" |placed at: memory address 99
ADD [4] [100] // Instruction "do addition with value on memory address 4" |placed at: memory address 100
STORE [5] [101] // Instruction "write the result to memory address 5" |placed at: the memory address 101
Note: In this example the language is used to make it easy to understand, in fact all memory
Let assume now the computer has reached a number of operating cycles according to the clock
pulse, and currently the "Program Counter" gives a value of "99", which means the processor
must execute instructions on the memory address “99”, before the instructions on the memory
address "99" can be retrieved, the Program Counter will place the value "99" to the Memory
Address Register (MAR), after the value "99" is placed on MAR, we found the instruction is to
retrieve data in "memory address 3" or "LOAD [3]", instruction "LOAD [3]" is then placed on
the Memory Data Register (MDR), this is the stage called "Fetch".
After the instruction on memory address 99 which is "LOAD [3]" is on MDR, to give a sign of
the stage of the current process, the Counter Program will also place the instructions "LOAD [3]"
into the Current Instruction Register. When the instruction "LOAD [3]" is already in the Current
HOW A COMPUTER PROCESSOR WORK 7
Instruction Register, the Counter Program automatically add 1 from the previous value (99+1) so
it become 100, which means the next instruction is at the memory address 100.
Continuing the previous process, the instruction "LOAD [3]" is then placed in the Control Unit,
here is where "Decoding" the instruction "LOAD [3]" so it can be understood by the ALU, when
Control Unit reads the instruction "LOAD [3]", Control Unit will place the memory address "3"
on the MAR and retrieve the data on the memory address that is "5" and place it on the MDR.
As we know before, the Counter Program currently contains a value of 100, which means the
next instruction is at memory address 100, the Program Counter then put "100" to MAR and read
the instruction like "do addition with data in memory address 4" or "ADD [ 4] ", the "ADD [4]"
instruction is then placed on MDR, again a " Fetch " process occurs.
After the instructions on memory address 100, namely "ADD [4]" are in MDR, the Counter
Program again places the "ADD [4]" instruction into the Current Instruction Register, after that
the Counter Program add 1 from the previous value (100+1) to become 101, which means the
The "ADD [4]" instruction is then placed in the Control Unit, and "Decoding" the instruction so
it can be understood by the ALU, the Control Unit then sends the "ADD" instruction and puts the
value "5" in the accumulator, then the Control Unit places memory address "4" on MAR and
takes the existing data which is "2" and put it on the MDR, the value "2" is then placed in the
HOW A COMPUTER PROCESSOR WORK 8
"Accumulator", then the ALU do the addition of " 5 " and " 2 " and holding the result " 7 "and
Again we know that the Counter Program currently contains a value of 101, which means the
next instruction is at memory address 101, the Program Counter then put the value "101" on the
MAR and read the instruction "put the result to the memory address 5" or "STORE [5 ] ", this
After the instruction in memory address 101 that is "STORE [5]" is in the MDR, the Counter
Program again put the "STORE [5]" instruction into the Current Instruction Register, and again
add 1 from the previous value (101+1) to 102, which means the next instruction is at memory
address 102.
The "STORE [5]" instruction is then placed in the Control Unit, then "Decoding" the "STORE
[5]" instruction, the Control Unit then put the value in the accumulator which is "7" to the MDR
Until here the addition of 5 + 2 is finally complete, from the explanation above it feels very long
and time consuming but in reality this process cycle occurs so fast in the CPU according to the
References:
Nisan & Schocken, (2005). The Element of Computing Systems: Building a Modern Computer
http://mason.gmu.edu/~montecin/computer-hist-web.htm.
http://spike.scu.edu.au/~barry/dp234/dp234-t1.html