0% found this document useful (0 votes)
6 views9 pages

Chapter 1 Computer Organization

This document provides an overview of computer systems, detailing the components such as the CPU, memory units, and input/output units, and their functions. It explains how computers process data using binary numbers and the importance of software in executing programs. Additionally, it discusses computer performance metrics, including CPU speed and execution time, with examples illustrating how to calculate these metrics.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views9 pages

Chapter 1 Computer Organization

This document provides an overview of computer systems, detailing the components such as the CPU, memory units, and input/output units, and their functions. It explains how computers process data using binary numbers and the importance of software in executing programs. Additionally, it discusses computer performance metrics, including CPU speed and execution time, with examples illustrating how to calculate these metrics.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Introduction

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.

Different Functional Units of a Computer:


Computer system consists of four distinct functional units, input unit, Central Processing unit,
memory unit and output unit.
Memory Unit
Data Flow
Instruction Flow

Registers

Input Unit Output Unit

Control Unit Arithmetic/


Logic Unit

Central Processing Unit

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:

Compiled by Surajit Das


2 Introduction to Computer System

▪ 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

Compiled by Surajit Das


3 Introduction to Computer System

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.

Layered view of Computer System:


A computer system is made up of different
hardware and software layers. The innermost
layer is the hardware part that consists of central
processing unit(CPU), main memory, I/O
devices, secondary storage etc. The data path
interconnects various components of CPU, I/O
devices and memory. The controller hardware
controls the flow of data between various CPU
modules, I/O devices and memory in accortdance
with the processing required for an instruction.
A programmer writes an application program in
a high-level language using decimal numbers and
English-like statements. A compiler is a system
program, which converts the high-level language
program into equivalent machine-language
program consisting of instructions of binary
numbers.
An operating system is a set of programs and utilities, which acts as the interface between user
programs and computer hardware. The following are the main functions of operating system:
1. Managing the user program.
2. Managing the memories of computer.
3. Managing the I/O operations.
4. Controlling the security of computer.
The Basic Input-Output System (BIOS) is program consisting of I/O drivers, which are
different programs to perform various I/O operations on behave of various peripheral devices
attached to the computer system. When a program needs an I/O operations, it calls this program.
The main task of the BIOS is to identify and initiate component hardware like hard drives,
keyboard and mouse. This prepare the computer to work by loading the operating system into
main memory from hard disk. This process is known as booting. In summary, BIOS can be
said to be a coded program embedded on a chip (firmware) that recognizes and controls various
peripheral devices that build up a computer.

Compiled by Surajit Das


4 Introduction to Computer System

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?

◆ CPU is said to be faster or has better performance running this


program if the total execution time is shorter.
◆ The total measured program execution time is a possible
performance measure or metric:

Performance ∞ 1 / Execution time of CPU

Performance ratios are inverted from time ratios. That is a performance ratio is computed as
follows –

Performance improvement ratio = Performance after change / Performance before change


= Execution time before change / Execution time after change.

Compiled by Surajit Das


5 Introduction to Computer System

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):

𝐏𝐞𝐫𝐟𝐨𝐫𝐦𝐚𝐧𝐜𝐞𝐀 𝐄𝐱𝐞𝐜𝐮𝐭𝐢𝐨𝐧 𝐭𝐢𝐦𝐞𝐁


Speedup = n = =
𝐏𝐞𝐫𝐟𝐨𝐫𝐦𝐚𝐧𝐜𝐞𝐁 𝐄𝐱𝐞𝐜𝐮𝐭𝐢𝐨𝐧 𝐭𝐢𝐦𝐞𝐀

CPU Execution Time:

CPI =Total program execution cycles / Instructions count

CPU clock cycles = Instruction count x CPI

CPU execution time = CPU clock cycles x Clock cycle


= Instruction count x CPI x Clock cycle
= IC x CPI x C

Most computers run synchronously utilizing a CPU clock running at a constant


clock rate Or Clock frequency(f).

Clock rate = 1 / clock cycle or f = 1 /C

Compiled by Surajit Das


6 Introduction to Computer System

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)

What is the execution time for this program?


Solution:
CPU time = Instruction count x CPI x Clock cycle
= 10,000,000 x 2.5 x 1 / clock rate
= 10,000,000 x 2.5 x 5x10-9
= 0.125 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𝑁 𝑝𝑠

This implies that computer Y is 0.8 times faster than computer X.

Compiled by Surajit Das


7 Introduction to Computer System

3. A 40 MHz processor was used to execute a program with the following mix and
clock cycle count:

Instruction type Instruction Count Clock cycle count

Integer Arithmetic 45000 1


Data Transfer 32000 2
Floating point 15000 2
Control Transfer 8000 2

a) Calculate the average CPI when the program is executed.


b) Calculate the execution time.
Solution:
The processor takes (45000 * 1 + 32000 * 2 + 15000 * 2 + 8000 * 2) cycles to complete
the program.
So, the total cycles taken = 45000 + 64000 + 30000 + 16000 = 155000 cycles.
The processor takes 155000 cycles to execute 45000 + 32000 + 15000 + 8000 = 100000
instructions.
So average clock cycles per instruction (CPI) = 155000 / 100000 = 1.55
As the processor is 40MHz so, time for one clock cycle = 1 / 40 * 106 seconds.
So, the time taken by the processor to complete the job = 155000 * 1 / (40 * 106) =
3.875 ns.

4. Consider the execution of an object code with 200,000 instructions on a 40MHz


processor. The program consists of four major types of instructions. The
instruction mixes and the number of cycles (CPI) needed for each instruction type
are given below based on the result of a program trace experiment:

Instruction type CPI Instruction mix

Arithmetic and logic 1 60%


Load/store with cache hit 2 18%
Branch 4 12%
Memory reference with
8 10%
cache miss

a) Calculate the average CPI when the program is executed on a uniprocessor.


b) Calculate the corresponding MIPS rate based on the CPI.

Compiled by Surajit Das


8 Introduction to Computer System

Solution:

Instruction
CPI Instruction Count Cycles taken
Instruction Type mix

Arithmetic and Logic 200,000 * 0.6 =


1 60% 120,000
120,000

Load/store with cache


hit 200,000 * 0.18 =
2 18% 72,000
36,000

Branch 200,000 * 0.12 =


4 12% 96,000
24,000

Memory reference
8 10% 200,000 * 0.1 = 20,000 160,000
with cache miss

Total 200,000 448,000

The uniprocessor takes 448,000 cycles to execute 2000,000 instructions.


So, CPI = 448000 / 2000000 = 2.24
𝒄𝒍𝒄𝒐𝒌 𝒓𝒂𝒕𝒆
From the formula MIPS =
𝑪𝑷𝑰∗𝟏𝟎𝟔

40 ∗ 106 40
Therefore, MIPS = = = 17.857.
2.24∗ 106 2.24

Compiled by Surajit Das

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy