0% found this document useful (0 votes)
40 views16 pages

CPU & Architecture Essentials

The document discusses the key components and functions of a CPU. It describes the processor, clock speed, cache size, number of cores and how they affect performance. It also explains other components like the ALU, control unit, registers and buses, and how they work together in the fetch-decode-execute cycle to process instructions.

Uploaded by

xx
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views16 pages

CPU & Architecture Essentials

The document discusses the key components and functions of a CPU. It describes the processor, clock speed, cache size, number of cores and how they affect performance. It also explains other components like the ALU, control unit, registers and buses, and how they work together in the fetch-decode-execute cycle to process instructions.

Uploaded by

xx
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Processor

• Also called as a CPU (Central Processing Unit)


• It is a small chip that manage all instructions such as arithmetic, logic, input/output (I/O) and other
basic instructions created by hardware or operating systems.
• Latest processors can handle trillions of calculations per second.
• Performance of a CPU is depending on clock speed (instruction processing cycles), cache size and
number of cores the processor has.
• Single Core, Dual Core, Multi Core, Quad Core, Octa Core etc.
Clock speed
• Clock speed is the number of pulses the central processing unit's (CPU) clock generates per second.
It is measured in hertz.
• The more pulses per second, the more instructions can be performed and processed in a given time.
• CPU clocks can sometimes be speed up slightly by the user. This process is known as overclocking.
• However, overclocking can cause long term damage to the CPU as it is working harder and
producing more heat.
Cache Size
• Cache is a small amount of high-speed Random Access Memory (RAM) built directly within the
processor.
• It is used to temporarily hold data and instructions that the processor is likely to reuse.
• The bigger its cache, the less time a processor has to wait for instructions to be fetched.
Number of Cores
• A processing unit within a CPU is known as a core. Each core is capable of handling its own
instructions in a process cycle.
• The more cores a CPU has, the greater the number of instructions it can process in a given space of
time.
• Many modern CPUs are dual (two) or quad (four) core processors.
• This provides high processing power compared to CPUs with a single core.
Main components of CPU are:
• Arithmetic and Logic Unit (ALU)

• Control Unit

• Registers and Buses

• System Clock

The Arithmetic & Logic Unit (ALU)


• Allows the required arithmetic (e.g. +, - and shifting) or logic (e.g. AND, OR) operations to be carried out
while a program is being run.

Control unit
• Reads an instruction from memory.

• The address of the location where the instruction can be found is stored in the Program Counter (PC).

• The control unit ensures synchronisation of data flow and program instructions throughout the computer

Buses
• Used in computers as parallel transmission components; each wire in the bus transmits one bit of data.

System Clock:
– The clock defines the clock cycle that synchronises all computer operations.
– Increasing clock speed, the processing speed of the computer is also increased
Overclocking:
– The clock speed can be changed by accessing the BIOS (Basic Input/Output System)
Problems with Overclocking:
– can lead to serious unsynchronised operations
– can lead to serious overheating of the CPU
Register
• Needed to manipulate data within the computer
Like a high speed storage for processing.

Operations of MAR and MDR Registers:

 Consider READ operation


– Read the contents of
memory location 1111 0001

– 1111 0001 is written into the


MAR (memory address
register)

– A read signal is sent to the computer memory using the control bus

– The contents 0101 1011 are then put into the MDR (memory data register)

MAR:

MDR:

• Consider WRITE operation


– Show the contents of
memory location 1111 1101

– The data to be stored is


written into the MDR
(memory data register)

– The data need to be written to the memory location of 1111 1101 in the MAR (memory address
register)

– A write signal is sent to the computer memory using control bus


Program Status Word (PSW)
• Types of Status Flags (1- bit Cells)
– Carry (CY / C) Flag
• This Flag is set (assigned a value of 1) if there is a carry from the MSB (Most Significant Bit
position). Otherwise it is reset (assigned a value of 0), an extra bit -9bits

– Parity (P) Flag


• For Even Parity, this Flag is set (assigned a value of 1) if the number of 1s in the result
inclusive of parity is even. Otherwise it is reset (assigned a value of 0).

– Aux-Carry (AC ) / Half-Carry (HC) Flag


• This Flag is set (assigned a value of 1) if there is a carry from the HSB (Half Significant Bit
position). Otherwise it is reset (assigned a value of 0).

– Zero Flag (Z)


• This Flag is set (assigned a value of 1) if the result of the arithmetic operation is zero.
Otherwise it is reset (assigned a value of 0).

– Sign Flag (S)


• This Flag is set (assigned a value of 1) if the result of the arithmetic operation is negative.
Otherwise it is reset (assigned a value of 0).

– Overflow (V) Flag


• This Flag is set (assigned a value of 1) if there is a carry from the MSB (Most Significant Bit position
or the MSB -1) Bit positions but not both. Otherwise it is reset (assigned a value of 0).

Example:
Given that the current ALU operation on two 8-bit operands, 12 and 16 is Addition, encode the value of the following 16-bit
Program Status Word (PSW), using hexadecimal notation.

Solution:

a) Represent the operands using 8-bit signed 2’s complement representation.

b) Perform the operation (Addition) and compute the result.

c) Find out the values of the binary Flags: S, Z, HC, C, P, V

d) Fill in the entries in the PSW Register.

e) Encode the Register contents using hexadecimal notation.

0 4 C 9

CPU Instruction: Fetch-Decode-Execute Cycle


• To carry out a set of instructions, the CPU first fetches some data and instructions from memory and
stores them in suitable registers.
• Both the address bus and data bus are used in this process.

Once this is done, each instruction needs to be decoded before finally being executed. This is all known
as the Fetch–Decode–Execute cycle.
1. Fetch
• Both data and instruction can be stored in MDR.
• The the next instruction is fetched from the memory address currently
stored in the MAR and the instruction is stored in the MDR.
• contents of the MDR are then copied to the Current Instruction
Register (CIR).
• The PC is then incremented (increased by 1) so that the next
instruction can be then be processed.

2. Decode:
• The instruction is then decoded so that it can be interpreted in the next
part of the cycle.

3. Execute
• Decode the instruction then execute
• Passes the decoded instruction as a set of control signals to the
appropriate components
Fetch-Decode-Execute Cycle

Fetch/Execute Cycle: Load/Read


Little Man Computer - LMC
• is a simulator that mimics the modern computer architecture, known as von Neumann architecture.
• It was a brainchild of Dr Stuart Madnick, invented in 1965; Since it can model the modern computer,
it is still widely used as a teaching tool.

LMC Adding two numbers


What is Computer Architecture

• Computer architecture is a specification detailing how a set of software and hardware technology
standards interact to form a computer system or platform.
• It acts as an interface between hardware and software.
• It is also called as instruction set architecture
Von Neumann Architecture
• Very early computers were fed data while running
 it wasn’t possible to store programs or data

• In 1945, John von Neumann developed the von Neumann Architecture concept to hold programs and data
in memory

• Von Neumann Architecture Features:

– the concept of a central processing unit (CPU or processor)

– the CPU was able to access the memory directly

– computer memories could store programs as well as data

– stored programs were made up of instructions which could be executed in sequential order.

Examples of Computer Architectures


• The x86, made by Intel and AMD.

• The SPARC, made by Sun Microsystems and others.

• The PowerPC, made by Apple, IBM, and Motorola.

• x86 architecture defines how a processor handles and executes different instructions passed from
the operating system (OS) and software programs.
• From 16-bit and 32-bit to 64-bit
– x86 refers to a 32 CPU and operating system
– x64 refers to a 64-bit CPU and operating system
• X86-64 (extension to the x86 )
Graphical Processing Unit (GPU)
• The term "graphics processing unit" (GPU) refers to a specialised electronic circuit made to rapidly
access and modify memory in order to speed up the production of images and videos.
• Typically placed on a video card, which contains its own memory and display interfaces(HDMI,
DVI, VGA, etc)
• Early GPUs were developed in the 1980s, although the first “complete” GPUs began in the mid
1990s

• GPUs are used in a wide range of applications, from gaming and entertainment to scientific research
and machine learning.
• Perform parallel processing on large datasets.
• Essential tool for data-intensive tasks:
• image and video processing,
• natural language processing,
• and deep learning
CPU vs GPU

• GPU is specifically designed to handle the complex


mathematical calculations required for rendering
• CPU, which is a general-purpose 3D graphics and video.
processor that can perform a wide
range of tasks.

• The GPU has hundreds or even thousands of smaller,


specialized cores optimized for parallel processing.
• CPU, which is a general-purpose • GPUs generally consume more power than CPUs, as they
processor that can perform a wide range have many more cores and require more energy to
of tasks. perform their specialized calculations.
Introduction to Operating System
• A computer system consists of :

- users, application programs, operating systems and hardware

• An operating system is the layer of software that manages all parts of the
hardware and presents an interface that is easier to understand

• An operating system shields programmers from hardware complexity

• An operating system can be defined as :

a program that acts as an intermediary between a computer user and the computer
hardware

a resource allocator

a resource manager

a control program

• An operating system runs in kernel or supervisor mode to protect


users from tampering with hardware
• An operating system is regarded as the one program running at all
times; also called the kernel
• System calls or extended instructions are used for
communication between the operating system and the
application programs

What happens when you boot up your computer:


1. An initial program runs; also called the bootstrap program
2. The bootstrap program initializes all aspects of the system
eg. CPU, memory content, device controllers
3. The bootstrap program then locates the operating system
4. The bootstrap program then loads the operating system in
memory – the operating system kernel
Layers of a Computer System

Basic Functions of an Operating System


• Accepts commands from the user

• Provides desired services to the user and user programs

• Act as a system manager / resource manager

- controls hardware and software

- act as an interface between user and system

- Manages resources of the computer effectively

Services of an Operating System


Services provided to users and programs:

1. Program Execution – loads a program in memory, runs and terminates the execution either normally or
abnormally

2. Input-Output Operations – control input-output devices

3. File System Manipulation – allow reading, writing, deletion, creating of files

4. Communication – manage shared memory or message passing for the exchange of information between
processes

5. Error Detection – take measures to correct errors to ensure a consistent state

Services to ensure efficient operation of the OS:

1. Resource allocation

CPU scheduling routines for memory, input output devices, file storage to decide the best method to utilize the
CPU

2. Accounting

which users are using what kind and how much resources. Usage statistics for performance improvement

3. Protection

user, process and data protection

Classifications of Operating Systems

1. Multitasking Operating System

- Allows simultaneous execution of multiple program using a single processor


- Gives each process a certain amount of processor time to proceed

- Keeps and manages programs kept in memory simultaneously

- Maintains and determines the order of execution

- Assigns priority to processes

- Examples: macOS X, Microsoft Windows 2000, IBM's OS/390, and Linux

2. Time Sharing Operating System

- Enables multiple simultaneous users

- Facilitates, monitors and controls memory, CPU and other resources being shared by
users

- Programs are executed bit by bit

- Examples: Multics, Unix

3. Real Time Operating System

- Designed to respond within a certain period of time

- Examples: Scientific experiments, medical imaging systems, industrial control systems, weapon
systems, robots, air traffic control systems, etc.

4. Multiprocessing Operating System

- Has more than one independent processing unit

- Examples: Windows NT, 2000, XP, and Unix.o

5. Batch Operating System

- Only does one thing at a time (no interrupt)

- Users submit jobs to a central place and jobs are collected in batches

- Batches are place on input queues where it will be run

- Good for processing large numbers of repetitive jobs

- Examples: Payroll System, Bank Statements, etc

6. Single User Operating System

- allows one user at a time to use the computer

7. Multi-User Operating System

- allows for more then one user to use the computer simultaneously
SUMMARY

• An operating system is a system software which functions as a manager.

• An operating system acts as an interface between the user programs and the computer system.

• There are many types of classifications of operating systems;

multi-user, single-user, real-time, batch, multitasking, multiprogramming, multiprocessing.

You might also like