Professional Documents
Culture Documents
Meeting2-Block 1-Part 3
Meeting2-Block 1-Part 3
Information Technology 2
Meeting #2
Block 1 (Part 3)
Hardware and Software Concept
OU Materials, PPT prepared by Dr. Khaled Suwais
1
Edited by Dr. Ahmad Mikati
Contents
• Introduction
• 3.1 The processor
• 3.2 Storing and moving data and instructions
• 3.3 Peripherals and pulling it all together
• 3.4 Instructing the processor
• 3.5 Programmers, programming and program
s
• Summary
2
Introduction
You will learn the answers to questions such as the following.
• You will learn the answers to questions such as the following.
• How does a data bottleneck occur in a computer and how it can be avoided?
• How can I melt my computer?
• What are those strange strings of symbols when I get the ‘blue screen of
death’ on my Windows machine?
• How can a sip and a puff help a person with disabilities interact with a
computer?
• How do computers and programmers pull themselves up by their
bootstraps?
• Do you do RISC?
• When is hardware not required for a computer?
3
3.1 The processor
4
3.1 The processor
• The arithmetic and logic unit (ALU) and the floating-
point unit (FPU) are at the heart of the processor, as these
are the places where the data is actually manipulated.
ALU FPU
• Contains electronic circuits that • It is a common part of most
perform binary arithmetic, such modern processors.
as addition, subtraction, • Its function is very similar to that
multiplication and division on of the ALU, but it operates on
integers. floating-point numbers using
• Contains circuits to perform specialised circuitry optimised to
logical operations, such as be as efficient as possible when
comparing integers with zero, working with floating-point
testing two integers for equality, representations.
testing if one integer is greater
than another, etc.
5
3.1.2 Registers and cache memory
• Main memory is a storage area that contains program
instructions and data.
• When a program is first loaded, the corresponding instructions
and data are put into main memory, which is outside the
processor.
6
3.1.2 Registers and cache memory
7
3.1.2 Registers and cache memory
In modern processors, there may be several levels of cache
memory.
• Level 1 cache is the fastest (and smallest), and the aim is to use this
for the data and instructions that will imminently be transferred to the
registers.
• Level 2 cache is a larger but slower cache memory.
• There may be two more levels of cache below Level 2, each with more
capacity but slower speed.
9
3.1.2 Registers and cache memory
• There are several different types of registers in different
parts of the processor, and each is designed to hold a
particular type of information for a specific function.
• The accumulator is a register within the ALU where an
actual calculation takes place.
• The status register, sometimes called the flags register,
holds further information about the last operation
executed. Each bit in the register represents some
description of the result – is the result zero? Is the result
negative? Is the result too big to be stored in the
accumulator? And so on.
10
3.1.3 The control unit and other registers
• You may think that four cores all working simultaneously would
make a program run four times as fast. However, this is far from
being the case, for several reasons.
• Firstly, each core requires its share of the data and instructions to be moved
from the shared main memory into cache memory, and from there into its
registers.
• Each core may have its own Level 1 cache memory, but often the other levels
of cache memory are shared between them. This can lead to delays while the
12
cores wait for data and instructions to be transferred.
3.1.4 Multi-core processors
• In order to take advantage of multiple cores, the program
has to be written in such a way that a task can be split up into
independent sub-tasks, each of which can be completed by a
core, and then, if necessary, reassembled into a final
solution. This process is called threading – with each of the
independent tasks being coordinated by a separate thread
13
A multi-core processor where each core is processing a separate thread. (L1, Level 1; L2, Level 2.)
3.2 Storing and moving data and instructions
(Main Memory)
• Main memory is where the instructions, and the data they act on, are
loaded from when a program is executed.
• It is volatile memory, which means that its content is lost when the power
is switched off.
• Each byte in main memory is numbered in sequence, so that it has a
unique memory address.
• In main memory, every memory address can be directly accessed, which is
why this type of memory is referred to as random-access memory (RAM).
• Most forms of memory today are random access, but for historical reasons
we still tend to reserve the acronym RAM for main memory.
• An advantage of any form of random access memory, is that accessing any
location in memory takes the same amount of time, regardless of whether
it is stored at a location with a low or a high memory address.
14
3.2.3 Buses and clocks
• The wiring that connects the various internal and external
components of a computer is known as a bus. Internal
buses inside the processor connect the various registers
and cache memory together.
• The control bus: this bus carries the control signals
between the processor and main memory (and other
parts of the computer system).
• The address bus: this bus carries the addresses of
memory locations to be accessed.
• The data bus: this bus transfers data from place to
place.
15
3.2.3 Buses and clocks
16
3.2.4 The operating system
• Managing the various resources of a computer and coordinating
the hardware components is the job of a collection of programs
known as the operating system.
• In early computers, all the direct interaction between devices,
users and executing programs was coded into each program. This
made programs difficult to write, requiring specialist knowledge
of how to interact with devices connected to the computer (so
called peripheral devices) such as keyboards, screens, printers
and disk drives.
• Without an operating system, the programmers also had to have
specific knowledge of the components of the processor on which
their programs would execute.
17
3.2.4 The operating system
18
3.2.4 The operating system
Some of the functions that the operating system provides are as follows:
• Provision of a user interface:
• It provides us with a means of inputting data and instructions, and displaying output in a form
that users can understand.
• Management of memory:
• It is the job of the operating system to allocate appropriately sized areas of memory to each
executing program, and to ensure that program instructions and data do not interfere with
each other or with data and instructions of other programs.
• It is also the case that the registers are built directly into the processor,
so there are usually a fixed number of them – typically fewer than 50.
22
3.5 Programmers, programming and programs
23
3.5 Programmers, programming and programs
• The task of converting the source code into machine language is carried
out by special programs called translators.
• When the source code is in assembly language, the program that does
this translation into machine code is called an assembler.
• An assembler takes an assembly language program and generates an
equivalent program in machine language, which can then be loaded
into memory and executed. Since each processor family has a different
machine language, and therefore a different assembly language, they
each require a different assembler.
24
3.5 Programmers, programming and programs
• Whereas a compiler translates all the source code in one go, an interpreter
translates each instruction in the source code only when it is required for
that instruction to be executed.
• There is never a complete translation of the whole of the source code into
machine language, and so no object code program is generated.
• The advantage of an interpreted language is that the potentially lengthy
process of compilation does not need to be gone through for each small
change in the source code.
• The main disadvantage is that the translation process must take place
every time a program is executed, resulting in a slower execution of the
program. Like compilers, it is also the case that each processor family
needs a different interpreter.
• Languages such as JavaScript, Perl and Basic are designed to be
interpreted.
27
3.5 Programmers, programming and programs
28
Summary
• In this part, you have learned how the main components
of a computer work together to execute a program.
29