Hardware
3.1 Computer architecture
3.1.1 The Central Processing Unit (CPU)
CPU is also known as the Microprocessor / Processor.
It is installed as an Integrated Circuit on a single microchip.
The CPU is responsible for executing or processing all the instructions and data in a computer
application.
CPU consists of:
o Control Unit (CU)
o Arithmetic and Logic Unit (ALU)
o Registers and buses
3.1.2 Von Neumann architecture
In the mid- 1940s, John Von Neumann developed the concept of the “stored program computer”.
Von Neumann architecture has the following features:
o Concept of a CPU
o CPU being able to access the memory directly
o Computer memory could store data as well as programs
o Stored programs are made up of instructions which could be executed in sequence order.
Components of the CPU
Arithmetic and Logic Unit – allows arithmetic and logic operations to be carried out while a
program is running.
o Arithmetic functions:
▪ Addition
▪ Subtraction
▪ Division
▪ Multiplication
o Logical functions:
▪ AND
▪ OR
▪ NOT
Control Unit – reads instructions from memory and executes them. Signals are sent to other parts of
the computer through control bus.
Control unit also ensures synchronization of data flow and program instructions throughout the
computer with the help of the system clock.
Registers – can be either general or special purpose.
Register Abbreviation Function/purpose
Current Instruction Register CIR Stores the current instruction being decoded and
executed
Accumulator ACC Used when carrying out ALU calculations;
Stores data temporarily during the calculations
Memory Address Register MAR Stores the address of the memory location
currently being read from or written to
Memory Data Register or MDR / MBR Stores data which has just been read from
Memory Buffer Register memory or data which is about to be written to
memory
Program Counter PC Stores the address where the next instruction to
be read can be found
System busses and memory
Memory
A computer memory is composed of a large number of partitions, each having an address and its contents.
The address will uniquely identify every location in the memory.
System busses
System busses are used as parallel transmission components.
Each wire transmits one bit of data.
Address bus Data bus Control bus
Direction Unidirectional Bidirectional Bidirectional
Carries Addresses Address | Instruction | Control signals
Numerical value
Between Throughout the CPU and Memory From CU to all other
computer system. parts
CPU and Memory
Increase in width will Increase the no: of Larger the word length Will not be necessary to
memory locations that that can be transported increase the width since
can be directly accessed (16-bit, 32-bit, 64-bit) it carries only control
simultaneously signals (usually 8-bits)
Fetch-Decode-Execute cycle
• The Program Counter(PC) contains the address of the memory location of the next instruction
Step 1
• The address in the PC is then copied to the MAR (using address bus)
Step 2
• The contents at the memory location of MAR are then copied temporarily into the MDR
Step 3
• The contents of the MDR are copied and placed into the CIR
Step 4
• The value in the PC is incremented by one so that it now points to the next instruction to be
Step 5 fetched
• The instruction is decoded and then executed (using Control bus)
Step 6
3.1.3 Cores, cache and internal clock
Factors that determine the performance of a CPU
Increasing the clock speed
Width of the address bus and data bus
Overclocking
The use of cache memory
The use of different number of cores.
3.1.4 Instruction set
An instruction is made up of 2 parts:
1. Opcode
2. Operand
There are only a limited number of Opcodes. They are collectively known as instruction set.
Instruction sets are the low-level language instructions that instruct the CPU how to carry out an operation.
Example :
• ADD
• JMP
• LDA
3.1.5 Embedded systems
An embedded system is a combination of hardware and software which is designed to carry out a specific set
of functions.
Embedded systems can be based on:
Microcontrollers
o Has a CPU, RAM and ROM embedded to one single chip.
Microprocessors
o Has only CPU.
o RAM, ROM and peripherals need to be added
System on chips (SoC)
o Has a :-
▪ Microcontroller
▪ CPU
▪ Input/Output (I/O) ports
▪ Secondary storage
Depending on the device, embedded systems are either Programmable or non-programmable.
Programmable systems can be updated by either:
• Connecting to a computer and download updates
• Automatic update via WiFi, satellite or mobile data.
Benefits and drawbacks of using embedded systems
Benefits Drawbacks
They are small in size Can be difficult to upgrade
Relatively low cost to make Troubleshooting may need specialist knowledge
Dedicated to one task, simple interface Sometimes interface may be confusing
Consume less power If connected to the Internet, may be open to hackers
and viruses
Can be controlled remotely using a mobile phone Very wasteful. Since it is difficult to upgrade, it is
usually thrown away
Very fast reaction to changing inputs Can lead to an increase in the “throw away” society
More reliable since they are out-of-date
Computers are not an example of embedded systems since they are multi-functional.
Examples of the use of embedded systems may include:
• Motor vehicles
• Set-top box
• Security systems
• Lighting systems
• Vending systems
• Washing machines
• Microwave ovens
• Refrigerators