3.1 Computer Architecture - Notebook Work
3.1 Computer Architecture - Notebook Work
• The Central Processing Unit (CPU) is the main component of a computer that performs most of the processing.
• It retrieves instructions from memory, decodes and executes them, and manages the flow of data in and out of the
computer.
• The CPU is responsible for carrying out basic arithmetic, logical, and input/output operations and acts as the "brain" of
the computer, making decisions based on the instructions it receives.
MICRO PROCESSOR
• A microprocessor is a compact integrated circuit that contains the central processing unit (CPU) of a computer or other
device.
• It is responsible for executing instructions and performing operations on data, making it the "brain" of the device.
• A microprocessor combines the functions of the CPU, memory, and I/O interfaces onto a single chip, making it more cost-
effective and efficient than a traditional CPU.
• Microprocessors can be found in a wide range of devices, including computers, smartphones, appliances, and vehicles.
3.1.2 | THE FETCH DECODE EXECUTE CYCLE
OBJECTIVES
(a) Understand the purpose of the components in a CPU, in a computer that has a Von Neumann architecture
Including:
– units: arithmetic logic unit (ALU) and control unit (CU)
– registers: program counter (PC), memory address register (MAR), memory data register (MDR), current instruction register
(CIR) and accumulator (ACC)
– buses: address bus, data bus and control bus
3.1.2(b) Describe the process of the fetch–decode–execute cycle including the role of each component in the process.
• How instructions and data are fetched from random access memory (RAM) into the CPU, how they are processed using
each component and how they are then executed
• Storing data and addresses into specific registers
• Using buses to transmit data, addresses and signals
• Using units to fetch, decode and execute data and instructions
The system bus refers to the method in which data and signals are transferred throughout a computer system. There are
three different Bus systems each with their own purpose.
• The address bus simply carries an address (location) that needs to be accessed from the memory.
• If we think of the memory as being like a very large spreadsheet containing thousands of cells and each cell has its own
unique address.
• The address bus carries the address location of a specific cell within the memory to be accessed.
• The Address Bus is unidirectional, meaning it is a one-way system only carrying address locations from the processor to
memory; data comes back through the data bus.
• The Data Bus is bi-directional (meaning that data can flow two ways) and is responsible for transporting data between
the memory, the processor and I/O (input/output) devices.
THE CONTROL BUS
• The Control Bus is bi-directional (meaning that data can flow two ways) and is responsible for transmitting signals
between different parts of the computer.
• It is primarily tasked with carrying timing signals from the system clock, to coordinate tasks.
• The computer's speed depends a lot on how fast its clock ticks; each tick means an action happens, the more times per
second the clock ticks the more actions are performed.
The main components of the CPU are the Arithmetic and Logic Unit, ALU and the registers.
• The Arithmetic and Logic Unit is responsible for calculations such as addition, multiplication and logic such as AND and OR.
• Registers are temporary storage areas used to store small instructions or small pieces of data as it is being processed.
• Registers are very small and very fast memory situated very close to the ALU.
The basic Von Neumann architecture comprises of the following registers.
• PC Program Counter
• MAR Memory Address Register
• MDR Memory Data Register
• CIR Current Instruction Register
• SR Status Register
• PC - Program Counter: Stores the memory address that holds the next instruction to be read. The incrementor
increments/changes the program counter after every instruction and the incrementor is controlled by the clock
through the control unit.
• MAR - Memory Address Register: The MAR holds the memory location address that is about to be written or read
from
• MDR - Memory Data Register: The MDR holds the data that has just been read, or the data that is about to be
stored in a memory location.
• CIR - Current Instruction Register: The CIR is used to store the current instruction during the time it is being
processed (decoded and executed).
• SR- Status Register: The status register holds flags indicating outcomes of CPU operations, such as zero results, carry
or overflow in arithmetic, interrupt enable status, and more.
THE CORE
• Core is the central processing unit (CPU) of a computer, which is the primary component responsible for executing
instructions and performing calculations.
• Modern CPUs often have multiple cores, allowing for parallel processing and improved performance.
• Each core operates independently, allowing multiple tasks to be processed simultaneously.
• The number of cores in a CPU can have a significant impact on the overall performance and efficiency of a computer
system.
CACHE
• A small, high-speed memory that stores frequently used data for quick access.
• The purpose of a cache is to speed up the processing of data by storing it temporarily so that it can be quickly retrieved
and used again, instead of having to be fetched from a slower storage device such as a hard drive or main memory.
• In general, the use of cache memory can significantly improve the performance of a computer system by reducing the
amount of time it takes to access and process data.
THE CLOCK
• In computing, the clock refers to a timing circuit that generates regular pulses used to synchronize the operations within
a computer.
• The clock controls the speed at which the CPU operates, and is typically measured in GHz (gigahertz).
• The higher the clock speed, the more instructions the CPU can execute per second.
• The clock speed is a crucial factor in determining the overall performance of a computer, as a faster clock speed can lead
to improved processing speed and increased responsiveness.
• The performance of a CPU depends on three main things: how many cores it has, how big its cache is, and how fast its
clock is.
• Cores are like separate little brains inside the CPU, and having more of them means the CPU can do more things at
once, which makes it work faster.
• Cache is like the CPU's short-term memory, and having a bigger cache means it can remember more important stuff
close by, making it quicker to access.
• Clock speed is like how fast the CPU can think, and a higher clock speed means it can do more things in less time,
making it work faster and respond quicker.
• Basically, a CPU with lots of cores, a big cache, and a fast clock will work better and give you a smoother experience.
3.1.4 | THE INSTRUCTION SET
OBJECTIVES
3.1.4 Understand the purpose and use of an instruction set for a CPU
An instruction set is a list of all the commands that can be processed by a CPU and the commands are machine code
An instruction set is a collection of basic commands and operations that a computer's CPU can understand and execute. The
instruction set serves as an interface between software and hardware which allows the CPU to perform tasks such as
calculations and data manipulation
• Arithmetic operations: Execute fundamental arithmetic tasks like addition, subtraction, multiplication, and division.
• Logical operations: Carry out bitwise logical functions like AND, OR, NOT, and XOR.
• Data transfer instructions: Transfer data between a CPU's registers and memory.
• Flow control instructions: Modify the execution path of a program, including jump, branch, and function call operations.
• Comparison operations: Evaluate two values and establish a condition flag based on the outcome.
• Bit manipulation instructions: Shift or rotate bits within a value, often employed for effective multiplication or division.
Difference between High Level, Low Level and Intermediate Level Programming Languages:
Whenever you write a program in a high-level language such as Python, the code will first be converted to a low-level
language before it can run.
Opcode (Operation Code): The opcode is the part of an instruction that represents the specific operation or action the CPU
should perform. It tells the CPU what to do, such as add, subtract, load data, or jump to another instruction.
Operand: The operand is the part of an instruction that specifies the data or registers the CPU should use when performing
the operation. Operands can be values, memory addresses, or registers.
PROCESSING THE INSTRUCTION
A CPU processes instruction in a series of steps that involve fetching the instruction from memory, decoding it, executing it,
and storing the result. Let's consider the example of a Load (LDD) instruction, which loads data from memory into a register.
• Fetch: The CPU fetches the LDD instruction from the memory location pointed to by the program counter (PC). The PC
is then incremented to point to the next instruction in the sequence.
• Decode: The CPU decodes the fetched instruction to determine the operation (in this case, LDD) and its operands. The
operands typically include the register where the data will be loaded and the memory address of the data.
• Execute: The CPU performs the LDD operation by reading the data from the specified memory address.
When the CPU processes a Load (LDD) instruction, it fetches the instruction from memory, decodes it to determine the
operation and operands, reads the data from memory, and loads it into the specified register.
• Embedded systems are computer systems that are designed to perform specific functions or tasks within a larger system
or product.
• They are small, low-power devices integrated into larger systems and operate independently or with minimal human
intervention.
• They may also have limited resources, such as memory, processing power, and energy, and must be designed to operate
reliably and efficiently under these constraints.
• Embedded systems can be programmed using a variety of programming languages and development tools, depending on
the specific requirements of the system. (C, C++, and assembly language)
• Washing machine: Modern washing machines use computer systems to control how they work. They check things like
how much water is needed, how hot it should be, and how long the wash should last. They do this by sensing water levels,
temperature, and clothes weight.
• Automatic lighting systems: These systems use special computers to turn lights on and off by themselves. They have
sensors that can tell if someone's in a room. If no one's there, they switch the lights off to save energy. If someone enters,
they turn the lights on.
• Air conditioning: Air conditioners have computers to help control them. They check the temperature and humidity in a
room and adjust themselves to make it comfortable. Sensors help them know when to turn on or off.
• Cooker: Modern cookers have small computers inside. They control things like how hot it gets and how long it cooks for.
They use sensors to check the food's temperature and decide when it's ready.
• Vending machine: Vending machines use computers to give out snacks and drinks. When someone pays, the computer
decides which item to give. Sensors help it know when someone's paid and when to dispense the product.
• Traffic lights: Traffic lights have computer systems to manage when they change color. They use sensors to detect cars
and people waiting to cross. The computers decide when to switch the lights to keep traffic moving safely.
• Cars: Cars have computers to help with things like how fast they go, how they brake, and even when airbags should
deploy. These computers use sensors to keep track of important things like speed and engine temperature.
Embedded systems work like this: they get information from sensors or other things around them (that's the input), then
they use that information to do some thinking or calculations (that's the process), and finally, they do something based on
those calculations, like moving parts, showing messages, or talking to other devices (that's the output).
BENEFITS
• Efficient performance: They are highly optimized for specific tasks, making them more efficient and faster than
general-purpose computers in performing these tasks.
• Low power consumption: They are designed to use minimal power, making them ideal for applications that require
long battery life or operate on low power sources.
• Real-time operation: They are often used in applications that require real-time operation, such as automotive control,
medical devices, and industrial automation.
• High reliability: They are designed to operate reliably and continuously for long periods without failure, making them
ideal for critical applications.
• Cost-effective: They are often designed to use low-cost components, making them cost-effective for high-volume
production.
DRAWBACKS
• Limited resources: They often have limited resources such as memory, processing power, and energy, which can
constrain their functionality and performance.
• Lack of flexibility: They are designed to perform specific tasks, which can make them less flexible than general-
purpose computers in adapting to changing requirements or applications.
• Difficult to program: They often require low-level programming languages and specialized development tools, making
them more challenging to program and maintain than general-purpose computers.
• Security vulnerabilities: They can be vulnerable to security threats, especially if they are connected to the internet or
other networks.
• Maintenance challenges: They can be difficult to repair or maintain, especially if they are integrated into a larger
system or product.
=====================================================================================================