Chapter 1 Computer Organization
Chapter 1 Computer Organization
to Computer
System
SURAJIT DAS
ASSISTANT PROFESSOR, IT
1 Introduction to Computer System
Introduction
A computer is an electronic device, which works under a pre-defined set of instructions given
by human-beings, processes the inputs given to it as per the instructions and displays the result.
This means human beings have to provide the relevant instructions and data to get useful work
done by a computer.
Digital computers use binary number system, which consists of only two digits 0 and
1. These are known as binary digits (also known as bit in short). A group of 8 bits is called a
byte. The information in a digital computer is represented in the group of bits. These groups of
bits not only represent the binary numbers but also represent other discrete symbols including
letters of the alphabets or decimal digits with the help of various coding techniques.
A set of instructions given to a computer for a particular job to be done, is called a
program. The generic name given to a collection of programs, is known as software. The
machine and its different components that can be physically touched are classified as hardware.
The software uses the hardware to perform and to get results. The hardware of a computer is
assembled once only, but its software is developed and changed again and again whenever a
different problem is solved by a computer.
Registers
All these units are interconnected allowing communication among them and thus, helping the
computer to function as a system.
The description of these functional units are as follows:
▪ Memory Unit: The memory unit is responsible for managing programs and acting as
a storage unit for holding the data. There are two types of memory, namely, primary
memory and secondary memory. Primary memory, also known as main memory,
is a high-speed memory that temporarily holds the instructions and data currently being
processed by the CPU, the intermediate results produced during the course of
calculations, and the recently processed data. While the instructions and data remain in
main memory, the CPU can access them directly and quickly. It is classified into two
categories: random access memory (RAM) and Read only Memory (ROM). Secondary
memory, also known as auxiliary memory, is used for storing the data and instructions
permanently. It supplies the stored information to the other units of computer as and
when required. Some commonly used secondary storage devices are optical disks, hard
disks, pen drive etc.
▪ Central Processing Unit (CPU): CPU, also known as processor, is the brain of the
computer system that processes data (input) and converts it into meaningful information
(output). It is referred to as the administrative section of the computer system that
interprets the data and instructions, coordinates the operations and supervises the
instructions. It consists of three components, namely, arithmetic logic unit (ALU),
control unit (CU) and registers.
• Arithmetic Logic Unit (ALU): This unit performs all the arithmetic and logical
operations on data such as addition, subtraction, multiplication, XOR, AND
etc. Whenever an arithmetic or logical operation is to be performed, the
required data is transferred from the memory unit to ALU, the operation is
performed and result is returned to the memory unit.
• Control Unit (CU): The task of CU is to direct the data flow among various
units, control computer operations and retrieve the programs instructions
stored in memory one-by-one. After fetching the instruction, it interprets the
instruction and sends the signal to ALU and storage areas so that instruction
can be executed. It also controls the input/output devices and directs the overall
functioning of the other units of the computer.
• Registers: These are special-purpose, high-speed temporary memory units that
can hold varied information such as data, instructions, addresses, and
intermediate results of calculations. Essentially, they hold the information that
the CPU is currently working on. Registers can be considered as the CPU’s
working memory, an additional storage location that provides the advantage of
speed.
▪ Input and Output unit: The user must enter instructions and data into the computer
system before any operation can be performed on the given data. Similarly, after
processing the data, the information must go out from the computer system to the user.
For this, every computer system incorporates input and output unit that serve as a
communication media between the computer system and the user.
✓ An input unit accepts instructions and data from the user with the help of input
devices such as keyboard, mouse, and light pen. Since the data and instructions
entered through different input devices will be in different form, the input unit
converts them into the form that the computer can understand. After this, the
input unit supplies the converted instructions and data to the computer for
further processing.
✓ The output unit performs just opposite to that of input unit. It accepts the output
(which are in machine-coded form) produced by the computer, converts them
into the user understandable form, and supplies the converted results to the user
with the help of an output devices such as printer, monitor etc.
Computer Performance
▪ Computer performance is the amount of work accomplished by a computer system.
Computer performance means CPU Performance i.e. speed of the CPU execution.
▪ CPU Speed - When measuring how fast something is, there are two kinds of measures-
✓ We can measure how long it takes to do something or
✓ We can measure how much gets done per unit time.
▪ There are two different ways of measuring speed - Elapsed time and Throughput.
➢ Elapsed Time
– Elapsed time is the better measure for processor speed because
it is less dependent on other system components. When
processor performance is quantified, it is taken to be inversely
proportional to execution time.
➢ Throughput
– A throughput measure is an amount of something per unit time.
o For processors throughput, the number of instructions
executed per unit time is an important component of
performance.
When processor performance is quantified, it is taken to be inversely proportional to execution
time.
▪ How can one measure the performance of this machine (CPU) running this
program?
Performance ratios are inverted from time ratios. That is a performance ratio is computed as
follows –
To Compare the performance of two machines (or CPUs) “A”, “B” running a given specific
program:
Performance A = 1 / Execution Time A
Performance B = 1 / Execution Time B
Machine A is n times faster than machine B means (or slower? if n < 1):
Examples:
1. A Program is running on a specific machine (CPU) with the following parameters:
▪ Total executed instruction count: 10,000,000 instructions
▪ Average CPI for the program: 2.5 cycles/instruction.
-9
▪ CPU clock rate: 200 MHz (clock cycle = C = 5x10 seconds)
2. Two computers use same instruction set architecture. Computer X has a clock
cycle time of 300 ps. and a CPI of 2.5 for some program and computer Y has a
clock cycle time of 400 ps. and a CPI of 1.5 for the same program. Which computer
is faster for this program and by how much?
Solution:
Since each computer executes same no. of instructions for the program, let the number of
instructions be N. Now, the processor clock cycles for each computer can be calculated as
follows:
CPU clock cycleX = N * CPIX = N * 2.5
CPU clock cycleY = N * CPIY = N * 1.5
After calculating the CPU clock cycles, we can determine the CPU execution time as
follows:
CPU Execution TimeX = CPU clock cycleX * clock cycle timeX
= N * 2.5 * 300ps = 750N ps.
CPU Execution TimeY = CPU clock cycleY * clock cycle timeY
= N * 1.5 * 400ps = 600N ps.
Therefore, it can be seen that computer Y is faster for the program as it has less execution
time that X. The amount by which Y is faster than X can be calculated by computing the
ratio of their execution time.
𝐶𝑃𝑈 𝑃𝑒𝑟𝑓𝑜𝑟𝑚𝑎𝑛𝑐𝑒𝑋 𝐸𝑥𝑒𝑐𝑢𝑡𝑖𝑜𝑛 𝑡𝑖𝑚𝑒𝑌 600𝑁 𝑝𝑠
= = = 0.8
𝐶𝑃𝑈 𝑃𝑒𝑟𝑓𝑜𝑟𝑚𝑎𝑛𝑐𝑒𝑌 𝐸𝑥𝑒𝑐𝑢𝑡𝑖𝑜𝑛 𝑡𝑖𝑚𝑒𝑋 750𝑁 𝑝𝑠
3. A 40 MHz processor was used to execute a program with the following mix and
clock cycle count:
Solution:
Instruction
CPI Instruction Count Cycles taken
Instruction Type mix
Memory reference
8 10% 200,000 * 0.1 = 20,000 160,000
with cache miss
40 ∗ 106 40
Therefore, MIPS = = = 17.857.
2.24∗ 106 2.24