3.1 Hardware (Components)
3.1 Hardware (Components)
3.1 - Hardware
3.1.1 understand the von Neumann stored program concept and the role of
main memory (RAM), CPU (control unit, arithmetic logic unit, registers),
clock, address bus, data bus, control bus in the fetch-decode-execute cycle
Decomposition
• Which components can you
identify in this computer?
Common components
• Motherboard
• CPU
• RAM
• Hard disk drive
• Graphics card (often built into the motherboard)
• Sound card (often built into the motherboard)
• Network card (often built into the motherboard)
• There are other processing units (commonly the Graphics Processing Unit)
which carry out other specialised jobs within the computer, more on this
later in the course.
Von Neumann architecture
• Architecture in a computing context is the design / layout of the circuitry. Von
Neumann is a computer architecture based on a description by mathematician and
physicist John von Neumann.
• It makes use of
• A processing unit that contains an arithmetic logic unit and processor registers
• A control unit that contains an instruction register and program counter
• Memory that stores data and instructions
• External mass storage
• Input and output mechanism
• In Von Neumann architecture data and instructions are both stored in memory (RAM).
• The CPU contains a number of registers (small amounts of specialist high speed
memory) which are used to perform the Fetch, Decode and Execute cycle.
Von Neumann architecture
RAM
Output
Address Bus Data Bus
MAR MDR
ACC Input
PC CIR
CU ALU
MAR, MDR, PC, ACC
• Memory Address Register - during the FDE this holds the address of the memory
location being accessed; this could be to read an instruction or data from memory,
or to write data to memory.
• Memory Data Register - also known as the Memory Buffer Register because it acts
as a buffer between the CPU and memory, it is used to hold data being read from
memory, or about to be written to memory.
• Program Counter - holds the memory address of the next instruction to be loaded,
as soon as the address is passed to the MAR to load an instruction the PC is
incremented by 1 to make it point to the next instruction to load. Some instructions,
such as jump, will cause the PC to be changed to point to a different instruction.
• Accumulator - holds the results of any calculations, as well any data going into or
out of the CPU.
ALU, CU, Cache
• The Arithmetic and Logic unit is where the CPU carries out all the
mathematic operations, including adding, subtracting, multiplication
and division as well as logic operations comparing numbers, e.g. is
this number higher than another number. The Accumulator register is
contained within the ALU.
• The Control Unit manages the various components of the CPU and
motherboard, for example telling memory whether it is sending data
to the CPU, or storing data from the CPU.
• How a CPU works
Cache
• The CPU cache stores data so future requests for that data can be
served faster; the data stored in a cache might be the result of an
earlier computation, or a copy of data stored elsewhere.
• This helps because accessing cache is
faster than re-computing a result or
reading from a slower data store, the
more requests can be served from the
cache, the faster the system performs,
therefore the more cache a CPU has
the better the performance.
Fetch Decode Execute Cycle
• The following slides illustrate an example of how the registers are used
during a typical fetch stage of the Fetch, Decode, Execute cycle.
Extra registers:
• The Current Instruction register holds an instruction while it is being
executed. Instructions consists of 2 parts, the opcode is the actual
instruction and the operand which is the data or memory address
relating to the instruction.
E.g. LDA 10 => Load to the Accumulator From memory location 10
Opcode Operand
Fetch CPU Memory
PC incremented by 1
Copy of address of next
PC instruction
MAR Copy of instruction in
memory address held in
MAR
CIR
Instruction
MDR
Control Unit
ACC
ALU
Decode CPU Memory
PC MAR
ACC
ALU
Execute CPU Memory
PC MAR
ACC
ALU
Characteristics of CPUs affecting
performance
• Clock speed - measured in GHz represents the number of
cycles which can be executed per second, the higher the clock
speed the better the performance.
• Cache size - a small amount of high speed memory built into
the CPU or motherboard which allows quick access to
instructions or data currently in use, the more cache the
better the performance.
• Number of cores - the number of separate processors built
into the CPU chip. Each processor can process instructions
independently or each other, so the more cores the better the
performance. This has a bigger impact for multitasking, where
each task can be processed sequentially in a different core.
Embedded systems
• Embedded systems is the term used to describe the use of small computers or
microchips in different systems.
• We need embedded systems because general-purpose computers, like PCs,
would be far too costly for the majority of products that incorporate some form
of embedded system technology.
• Another reason why we need embedded systems is because general-purpose
solution might also fail to meet a number of functional or performance
requirements such as constraints in power-consumption, size-limitations,
reliability or real-time performance etc.