+ All Categories
Home > Documents > Computer Science & Engineering II B.Tech. - II Semester

Computer Science & Engineering II B.Tech. - II Semester

Date post: 04-Dec-2021
Category:
Upload: others
View: 5 times
Download: 0 times
Share this document with a friend
26
Department of Computer Science & Engineering II B.Tech. - II Semester Name of the student Subject Name COMPUTER ORGANIZATION Academic Year 2019-20 UNIT No. 1 Roll No. Section Kallam Haranadhareddy Institute of Technology NH-5, Chowdavaram, Guntur-522 019 Approved by AICTE, New Delhi; Affiliated to JNTUK, Kakinada Accredited by NBA, NAAC with ‘A’ Grade & An ISO 9001:2015 Certified Institution
Transcript
Page 1: Computer Science & Engineering II B.Tech. - II Semester

Department of

Computer Science & Engineering

II B.Tech. - II Semester

Name of the student

Subject Name COMPUTER ORGANIZATION

Academic Year 2019-20

UNIT No. 1

Roll No.

Section

Kallam Haranadhareddy Institute of Technology NH-5, Chowdavaram, Guntur-522 019

Approved by AICTE, New Delhi; Affiliated to JNTUK, Kakinada Accredited by NBA, NAAC with ‘A’ Grade & An ISO 9001:2015 Certified Institution

Page 2: Computer Science & Engineering II B.Tech. - II Semester
Page 3: Computer Science & Engineering II B.Tech. - II Semester

Computer Organization -R16 UNIT-1

Kallam Haranadhareddy Institute of Technology Page 1

SYLLABUS

Basic Structure Of Computers: Computer Types, Functional units, Basic Operational

concepts, Bus structures, System Software, Performance, The history of computer

development.

________________________________________________________________________

PREVIOUS QUESTIONS

1. Define digital computer? Describe the type of computers. [2M]

2. Discuss various computer types with their applications in real world environment.

[7M]

3. What is microprocessor, how it is different from micro computer?

4. Write about real time computers.

5. Explain the components of the computer system?

6. What are the functional units of a computer system? Explain the way of handling

information by each of them. [7M]

7. Write about logical structure of a simple personal computer.

8. Explain the structure of a computer system.

9. Define program? Explain about the term input unit. [2M]

10. Define the term processor and discuss about output unit. [2M]

11. Write a note on arithmetic and logical unit. [7M]

12. Draw the functional unit of a computer and discuss about the control unit in details.

[7M]

13. Describe the term memory unit. [2M]

14. Define system software

15. What is System Software? What the uses of System Software?

16. Draw the connections between the processor and main memory and explain the basic

operational concepts. [7M]

17. Suppose two numbers located in memory are to be added. What are the functional

units of digital computer system will carry out this? Explain how. [7M]

18. Write about various general purpose registers involved in the typical computer system.

[7M]

19. Write a short note on bus structures used in computer system. [2M]

20. Mention different types of Bus structures

21. Draw and explain single bus structure. [7M]

22. Compare single bus structure and multiple bus structure.

23. “System software is responsible for coordination of all activities in a computing

system”-Justify this statement with the functionalities of it. [7M]

24. Define system software? Discuss briefly about software and its processor time. [7M]

25. Discuss the basic aspects of computer performance. [7M]

26. What is the role of Processor clock, clock rate in the performance of computer system?

Explain. [7M]

27. What is the use of pipelining and superscalar operations? [3M]

28. Write various ways to improve the clock rate. [2M]

29. Explain the importance of instruction set in measuring the performance of a computer

system. [7M]

30. What is optimizing compiler? [2M]

31. Write about the history of development of the computer. [7M]

32. Discuss the generations of computers based on the development technologies used to

fabricate the processors, memories and I/O units. [7M]

Page 4: Computer Science & Engineering II B.Tech. - II Semester

Computer Organization -R16 UNIT-1

Kallam Haranadhareddy Institute of Technology Page 2

UNIT-1

Introduction

Q1. Define Computer Organization.

Computer Organization: It describes the function and design of the various functional units of

digital computers that store and process information.

_____________________________________________________________________________

Q2. Define Computer Architecture.

Computer Architecture: Computer architecture (processor design) encompasses the

specification of an instruction set and the functional behaviour of the hardware units that

implement the instructions.

_____________________________________________________________________________

Computer Types

Q3. Define Digital computer.

Digital computer: It is a fast electronic calculating machine that

– accepts digitized input information

– processes the information according to a list of internally stored instructions and

– produces the resulting output information

_____________________________________________________________________________

Q4. Discuss various computer types with their applications in real world environment.

Computer Types:

There are four basic types of computers based on size, cost, and performance. They are

1. Embedded Computers (Micro computer)

2. Personal Computers (Macro computer)

3. Servers and Enterprise Systems (Mainframe computer)

4. Supercomputers and Grid computers

1. Embedded computers are integrated into a larger device or system in order to

automatically monitor and control a physical process or environment. They are used

for a specific purpose rather than for general processing tasks.

Applications of Embedded computers include industrial and home automation,

appliances, telecommunication products, and vehicles. Users may not even be aware of

the role that computers play in such systems.

2. Personal computers have achieved widespread use in homes, educational institutions,

and business and engineering office settings, primarily for dedicated individual use.

Applications of Personal computers include general computation, document

preparation, computer-aided design, audiovisual entertainment, interpersonal

communication, and internet browsing.

Classifications among personal computers are:

Desktop computers serve general needs and fit within a typical personal workspace.

Workstation computers offer higher computational capacity and more powerful

graphical display capabilities for engineering and scientific work.

Portable and Notebook computers provide the basic features of a personal computer

in a smaller lightweight package. They can operate on batteries to provide mobility.

3. Servers and Enterprise systems are large computers that are meant to be shared by a

potentially large number of users who access them from some form of personal

computer over a public or private network.

Applications of Servers and Enterprise systems include hosting large databases and

providing information processing for a government agency or a commercial

organization.

Page 5: Computer Science & Engineering II B.Tech. - II Semester

Computer Organization -R16 UNIT-1

Kallam Haranadhareddy Institute of Technology Page 3

4. Supercomputers and Grid computers normally offer the highest performance. They are the

most expensive and physically the largest category of computers. Grid computers provide a

more cost-effective alternative. They combine a large number of personal computers and

disk storage units in a physically distributed high-speed network, called a grid, which is

managed as a coordinated computing resource. By evenly distributing the computational

workload across the grid, it is possible to achieve high performance on large applications

ranging from numerical computation to information searching.

Applications of Supercomputers include performing the large scale numerical calculations

required in weather forecasting, space exploration, engineering design and simulation, and

scientific work.

_____________________________________________________________________________

Q5. What is microprocessor, how it is different from micro computer?

A microprocessor is a computer processor on a microchip that contains all or most CPU

functions. Microprocessors do not have RAM, ROM or other peripherals. As such,

microprocessors cannot perform standalone tasks. Rather, systems such as microcomputers,

which contain microprocessors, can be programmed to perform functions on data by writing

specific instructions for their microprocessors into their memory.

A microcomputer can technically be described as the combination of a microprocessor and its

peripheral I/O devices, circuitry and memory -- just not on a single chip.

_____________________________________________________________________________

Q6. Write about real time computers.

Real-time systems are computer systems that monitor, respond to, or control an external

environment. This environment is connected to the computer system through sensors, actuators,

and other input-output interfaces.

The computer system must meet various timing and other constraints that are imposed on it by

the real-time behavior of the external world to which it is interfaced. Hence the name real time.

Applications and examples of real-time systems are ubiquitous and proliferating, appearing as

part of our commercial, government, military, medical, educational, and cultural infrastructures.

Included are

o vehicle systems for automobiles, subways, aircraft, railways, and ships

o traffic control for highways, airspace, railway tracks, and shipping lanes

o process control for power plants, chemical plants, and consumer products such as

soft drinks and beer

o medical systems for radiation therapy, patient monitoring, and defibrillation

o military uses such as firing weapons, tracking, and command and control

o manufacturing systems with robots

o telephone, radio, and satellite communications

o computer games

o multimedia systems that provide text, graphic, audio, and video interfaces

o household systems for monitoring and controlling appliances

o building managers that control such entities as heat, lights, doors, and elevators

_____________________________________________________________________________

Functional Units

Q5. What are the functional units of a computer system? Explain the way of handling

information by each of them.

Functional Units:

All types of computers follow a same basic logical structure and contains the following five

functional units for converting raw input data into information useful to users.

1. Input unit

2. Output unit

Page 6: Computer Science & Engineering II B.Tech. - II Semester

Computer Organization -R16 UNIT-1

Kallam Haranadhareddy Institute of Technology Page 4

Interconnection

network

Processor

Memory

Control

Arithmetic

and

logic

3. Memory unit

4. Arithmetic and Logic unit and

5. Control unit.

The operation of a computer can be summarized as follows:

The computer accepts information in the form of programs and data through an input

unit and stores it in the memory.

Processor then fetches the instructions stored in the memory and sends into an arithmetic

and logic unit, where it is processed.

Processed information leaves the computer through an output unit.

All activities in the computer are controlled by the control unit.

An interconnection network provides the means for the functional units to exchange

information and coordinate their actions.

The way of handling information by a computer:

Input unit:

Input unit (or Input devices) is used to enter data and instructions to the computer.

The data and instructions entered are stored in memory before they are sent to the CPU.

Examples of input devices are keyboard, mouse, trackball, concept keyboard, scanners,

touch screens, barcode reader, QR code reader etc.

The most common input device is the keyboard. Whenever a key is pressed, the

corresponding letter or digit is automatically translated into its corresponding binary

code and transmitted to the processor.

Touchpad, mouse, joystick, and trackball are often used as graphic input devices in

conjunction with displays.

Microphones can be used to capture audio input and similarly, cameras can be used to

capture video input.

Digital communication facilities, such as the Internet, can also provide input to a

computer from other computers and database servers.

An input device can send data to another device, but it cannot receive data from another

device.

Output Unit:

Output unit (or Output devices) is used to display the results produced by the computer.

The output devices can be divided into the following types.

(a) Soft Copy output devices:

I/O

Output

Input

Page 7: Computer Science & Engineering II B.Tech. - II Semester

Computer Organization -R16 UNIT-1

Kallam Haranadhareddy Institute of Technology Page 5

Soft copy output devices are just used to display only the results i.e., the output

produced on soft copy output devices cannot be carried from one place to another

place.

Examples of soft copy output devices are monitors, visual display units(VDUs),

projectors etc.

(b) Hard copy output devices:

Hard copy output devices will produce the output on a hard copy such as paper

which can be carried one place to another place.

Examples of hard copy output devices are printers and plotters etc.

(c) Some other output devices are 2D, 3D cutters used in manufacturing, speakers and

headphones, actuators (a type of motor which is used for automatic movement) used in

robotics.

The most common output device is a printer. Printers are mechanical devices, which are

quite slow compared to the electronic speed of a processor. Most printers employ either

photocopying techniques, as in laser printers, or ink jet streams. Such printers may

generate output at speeds of 20 or more pages per minute.

Central Processing Unit (CPU):

CPU is also called as microprocessor (or) processor.

It is also called as the brain of the computer.

It is used to process the data and instructions stored in memory.

The components of CPU are Control Unit (CU) and Arithmetic Logic Unit (ALU). In

addition, CPU also has a set of registers.

Examples of Micro Processors are Intel Pentium, dual core, core i3, core i5, core 2duo

(a) Registers:

Registers are the temporary and high speed storage areas in the CPU. But it has

less storage capacity.

All data must be stored in a register before it can be processed.

Registers are the costliest and fastest memory available in the market.

32-bit microprocessor refers to the size of the register. (processor contains each

register of 32 bits.)

Increase in size indicates it processes the data more quickly.

(b) Control Unit:

It does not do any processing of data, but it acts as a supervisor.

It co-ordinates and controls the activities of various hardware components of a

computer that store and process information.

It issues the commands to the other hardware parts in the computer and

organizes the processing of data and instructions.

Control circuits are responsible for generating the timing signals that govern the

transfers

Timing signals are used to determine when a given action is to take place.

A large set of control lines (wires) carries the signals used for timing and

synchronization of events in all units.

Data transfers between the processor and the memory are managed by the

control unit through timing signals.

I/O transfers, are controlled by I/O program instructions that identify the devices

involved and the information to be transferred.

(c) Arithmetic Logic Unit:

Page 8: Computer Science & Engineering II B.Tech. - II Semester

Computer Organization -R16 UNIT-1

Kallam Haranadhareddy Institute of Technology Page 6

To perform any arithmetic or logic operation, the input data (operands) stored in

main memory is sent to ALU.

The ALU performs calculations such as Arithmetic operations (addition,

subtraction, division, multiplication etc), logic operations (AND, OR, NOT)

used for comparision of numbers etc.

The results obtained will be sent to main memory or registers.

For example, Suppose two numbers located in memory are to be added, they are

brought into the processor, and the addition is carried out by the ALU. The sum

may then be stored in the memory or retained in the processor for immediate

use.

When operands are brought into the processor, they are stored in high-speed

storage elements called registers. Each register can store one word of data. Thus

memory unit, processor, registers and ALU are the functional units used to carry

out addition operation.

Memory Unit:

Memory is used to store data and instructions.

Memory is constructed by using a semi conducting material which is capable of storing

some voltage levels (high voltage considered as 1 and low voltage considered as 0) .

Therefore, the memory unit stores the data and instructions in the form of 0’s and 1’s

(binary form).

The memory is organized as fixed size “words” so that one word (containing ‘n’ bits)

can be stored or retrieved in one basic operation. The number of bits in each word is

referred to as the “word length” of the computer, typically 16, 32, or 64 bits.

A distinct address is associated with each word location. Addresses are consecutive

numbers, starting from 0, that identify successive locations. A particular word is

accessed by specifying its address and issuing a control command to the memory that

starts the storage or retrieval process.

Memory within a computer can be divided into the following categories:

(a) Cache memory

(b) Main memory (or) Primary memory

(c) Secondary memory

(a) Cache memory:

Cache memory is a smallest amount of memory which can be placed either part

of the microprocessor or outside the microprocessor to achieve high

performance.

The cache memory which is placed within the microprocessor is called internal

cache.

The cache memory which is placed outside the microprocessor is called external

cache. The external cache is generally placed between processor and main

memory.

The main purpose of using cache memory is to store the frequently used data.

At the start of program execution, the cache is empty. All program instructions

and any required data are stored in the main memory. As execution proceeds,

instructions are fetched into the processor chip, and a copy of each is placed in

the cache.

When CPU requests the data, first it checks data in cache memory. If it is found

in the cache, it is read from the cache memory.

Page 9: Computer Science & Engineering II B.Tech. - II Semester

Computer Organization -R16 UNIT-1

Kallam Haranadhareddy Institute of Technology Page 7

If the word requested by CPU is not found in the cache, the word is read from

the main memory and a copy of it is transferred to cache memory.

Suppose a number of instructions are executed repeatedly as happens in a

program loop, if these instructions are available in the cache, they can be

fetched quickly during the period of repeated use.

Similarly, if the same data locations are accessed repeatedly while copies of

their contents are available in the cache, they can be fetched quickly.

Cache memory is cheaper than registers and costlier than the other types of

memory in the computer.

Cache memory is slower than the Registers but faster than the other types of

memory in the computer.

(b) Main memory:

Main memory is used to store data and instructions to be processed. To run any

program or application, it must be brought into the main memory.

There are 2 types of main memory:

i. RAM and ii. ROM

RAM:

Main memory is also called as Random Access Memory(RAM). It is the memory

unit that directly communicates with CPU and can be accessed randomly.

A memory in which, any location can be accessed in a short and fixed amount

of time after specifying its address is called a “random-access memory” (RAM).

The time required to access one word is called the “memory access time”. This

time is fixed and independent of the location of the word being accessed. It

typically ranges from a few nanoseconds (ns) to about 100 ns for current RAM

units.

RAM is volatile. i.e., It stores data only when computer is on. The data and

instructions stored in RAM will be lost, whenever the computer is turned off or

shutdown.

RAM provides temporary storage of data and instructions. It performs both read

and write operations. It provides a limited storage capacity due to its high cost.

ROM:

Read Only Memory(ROM) is also treated as main memory but it is non- volatile.

It is the memory, in which stored data can only be read but cannot write on it.

ROM provides permanent storage of data and instructions. i.e., the data and

instructions stored in ROM will not be erased, even the computer is turned off

or shutdown.

The main purpose of ROM is to store the minimum set of programs required to

boot up the computer.

(c) Secondary memory:

Secondary memory is also known as Auxiliary storage. It is used to store the

data and instructions permanently.

When large amounts of data and many programs have to be stored, particularly

for information that is accessed infrequently, Secondary storage devices or

Auxiliary memory devices are used.

Examples of secondary storage devices are floppy disk, hard disk, CD, DVD,

Blue-Ray, pen drives.

It is large in size compared to other types of memories and it is slowest memory

and cheapest among all types of memories.

Page 10: Computer Science & Engineering II B.Tech. - II Semester

Computer Organization -R16 UNIT-1

Kallam Haranadhareddy Institute of Technology Page 8

_____________________________________________________________________________

Q6. Define Processor.

Processor: Arithmetic and Logic circuits, in conjunction with the main control circuits, is

referred to as the processor.

_____________________________________________________________________________

Q7. Define I/O unit.

I/O unit: Input and output equipment is often collectively referred to as the input-output (I/O)

unit.

Some units, such as graphic displays, provide both an output function, showing text and

graphics, and an input function, through touch screen capability. The dual role of such units is

the reason for using the single name input/output (I/O) unit.

_____________________________________________________________________________

Q8. Define Program.

Program: A program is a list of instructions that performs a specific task.

_____________________________________________________________________________

Q9. Define Instructions.

Instructions: Instructions are explicit commands that

• Govern the transfer of information within a computer as well as between the computer

and its I/O devices

• Specify the arithmetic and logic operations to be performed

_____________________________________________________________________________

Q9. Define Data and Information.

Data: Data are numbers and characters that are used as operands by the instructions.

Information: Processed data is called as information. Information handled by computer is

encoded as string of binary digits called “bits”(0 or 1) using BCD (Binary Coded Decimal) in

which each character is represented as a 4-bit code, ASCII (American Standard Code for

Information Interchange) in which each character is represented as a 7-bit code and EBCDIC

(Extended Binary Coded Decimal Interchange Code) in which each character is represented as a

8-bit code

_____________________________________________________________________________

Basic Operational Concepts

Q10. Draw the connections between the processor and main memory and explain the basic

operational concepts.

Figure 1.2. Connections between the processor and the memory.

Processor

Memory

PC

IR

MDR

Control

ALU

Rn 1-

R1

R0

MAR

n general purposeregisters

Page 11: Computer Science & Engineering II B.Tech. - II Semester

Computer Organization -R16 UNIT-1

Kallam Haranadhareddy Institute of Technology Page 9

In addition to the ALU and the control circuits, the processor contains a number of registers

used for different purposes.

There are 2 types of registers: 1. General purpose registers

2. Special purpose registers

1. General purpose registers:

General-purpose registers are represented as R0 through Rn−1. They are also called as

“processor registers”. They are used to hold operands that have been loaded from the memory

for processing, the intermediary results obtained during computations, and the results obtained.

2. Special purpose registers:

Special purpose registers used to perform a specific task. It includes Instruction Register (IR),

Program Counter (PC), Memory Address Register (MAR), Memory Data Register (MDR).

Instruction Register (IR): It holds the instruction that is currently being executed. Its output is

available to the control circuits, which generate the timing signals that control the various

processing elements involved in executing the instruction.

Program Counter (PC): It contains the memory address of the next instruction to be fetched

and executed. During the execution of an instruction, the contents of the PC are updated to

correspond to the address of the next instruction to be executed.

Memory Address Register (MAR): It holds the address of data to be accessed.

Memory Data Register (MDR): It holds the data to be written into or read out of the addressed

location in memory.

If a word is to be read from the memory, MAR sends the address of that word to the

memory along with a Read control signal.

If a word is to be written into memory, MAR transfers the address and MDR transfers

the word to the memory along with a Write control signal.

Basic Operating Steps to execute an instruction:

1. Programs entered through input unit will be stored in memory.

2. Program execution starts when PC points to address of first instruction.

3. The contents of register PC are transferred to register MAR

4. MAR issues a Read control signal to memory

5. After some delay, memory transfers the requested word into register MDR

6. The contents of register MDR are transferred to register IR.

7. IR decodes the instruction using control circuits to determine the operation to be performed.

If the instruction involves an operation to be performed by the ALU, it is necessary to fetch

the operands.

8. The operands could be either in processor register or memory.

9. If the operands are in processor register, they can be directly accessed.

10. If the operands are in memory, then IR transfer the address of the operand to MAR

11. MAR issues a Read control signal to memory initiating a Read cycle, and wait until MDR is

loaded with the operand.

12. The contents of register MDR are transferred to register IR.

13. After fetching all the operands, ALU performs the desired operation.

14. The results obtained can be stored either in processor register or memory.

15. If the operands are to be stored in memory, then result is sent to MDR, and the address

where the result is to be stored is sent to MAR.

16. MAR issues a Write control signal to memory initiating a Write cycle to store the result in

memory.

17. During execution, the contents of PC are incremented to get the address of next instruction

to be executed. To do so, transfer contents of PC to ALU

18. Add 1 to operand in ALU and transfer incremented address to PC.

Normal execution of programs may be interrupted if some device requires urgent

servicing. To deal with the situation immediately, the normal execution of the current program

must be interrupted

Page 12: Computer Science & Engineering II B.Tech. - II Semester

Computer Organization -R16 UNIT-1

Kallam Haranadhareddy Institute of Technology Page 10

Procedure of interrupt operation

The device raises an interrupt signal

The processor provides the requested service by executing an appropriate interrupt-service

routine

The state of the processor is first saved before servicing the interrupt

Normally, the contents of the PC, the general registers, and some control information are

stored in memory

When the interrupt-service routine is completed, the state of the processor is restored so that

the interrupted program may continue

_____________________________________________________________________________

Q11. List the steps needed to execute the machine instruction

Load R2, LOC

in terms of transfer between the components and some simple control commands. Assume

that the address of the memory location containing this instruction is initially in register

PC.

The task to be performed is to load the data from memory “LOC” to register “R2”.

The required steps are:

1. Transfer the contents of register PC to MAR.

2. Issue a Read command to memory, and then wait until it has transferred the requested word

into register MDR

3. Transfer the instruction from MDR into IR and decode it

4. Transfer the address LOC from IR to MAR

5. Issue a Read command and wait until MDR is loaded

6. Transfer contents of MDR to the register R2.

7. Transfer contents of PC to ALU

8. Add 1 to operand in ALU and transfer incremented address to PC.

_____________________________________________________________________________

Q12. List the steps needed to execute the machine instruction

Store R4, LOC

in terms of transfer between the components and some simple control commands. Assume

that the address of the memory location containing this instruction is initially in register

PC.

The task to be performed is to store the data from register “R4” to memory “LOC”.

The required steps are:

1. Transfer the contents of register “R4” to MDR and address to MAR.

2. Issue a Write command to memory.

3. Transfer contents of PC to ALU

4. Add 1 to operand in ALU and transfer incremented address to PC.

_____________________________________________________________________________

Q13. List the steps needed to execute the machine instruction

Add LOCA, R0

In terms of transfers between the components and some simple control commands.

Assume that the instruction itself is stored in the memory at location INSTR and that this

address is initially in register PC.

The required steps are:

1. Transfer the contents of register PC, “INSTR” to register MAR

2. Issue a Read command to memory, and then wait until it has transferred the requested word

into register MDR

3. Transfer the instruction from MDR into IR and decode it

4. Transfer the address LOCA from IR to MAR

5. Issue a Read command and wait until MDR is loaded

6. Transfer contents of MDR to the ALU

7. Transfer contents of R0 to the ALU

8. Perform addition of the two operands in the ALU and transfer result into R0

Page 13: Computer Science & Engineering II B.Tech. - II Semester

Computer Organization -R16 UNIT-1

Kallam Haranadhareddy Institute of Technology Page 11

9. Transfer contents of PC, “INSTR” to ALU

10. Add 1 to operand in ALU and transfer incremented address, “INSTR+1” to PC.

_____________________________________________________________________________

Q14. Suppose two numbers located in memory are to be added. What are the functional

units of digital computer system will carry out this? Explain how.

To add two numbers located in memory, they are brought into the processor, and the addition is

carried out by the ALU. The sum may then be stored in the memory or retained in the processor

for immediate use.

When operands are brought into the processor, they are stored in high-speed storage

elements called registers. Thus memory unit, processor, registers and ALU are the functional

units used to carry out addition operation.

Here, AC is the accumulator register used to temporarily hold the data.

The machine instruction is Add LOCA, LOCB

The required steps to carry out the instruction are:

1. Transfer the contents of register PC to register MAR

2. Issue a Read command to memory, and then wait until it has transferred the requested word

into register MDR

3. Transfer the instruction from MDR into IR and decode it

4. Transfer the address LOCA from IR to MAR

5. Issue a Read command and wait until MDR is loaded

6. Transfer contents of MDR to the ALU

7. Transfer the address LOCB from IR to MAR

Page 14: Computer Science & Engineering II B.Tech. - II Semester

Computer Organization -R16 UNIT-1

Kallam Haranadhareddy Institute of Technology Page 12

8. Issue a Read command and wait until MDR is loaded

9. Transfer contents of MDR to the ALU

10. Perform addition of the two operands in the ALU.

11. Transfer the result to MDR and address to MAR.

12. Issue a Write command to memory.

13. Transfer contents of PC to ALU

14. Add 1 to operand in ALU and transfer incremented address to PC.

_____________________________________________________________________________

Q15. List the steps needed to execute the machine instruction

Add R1,R2,R3

in terms of transfer between the components and some simple control commands. Assume

that the address of the memory location containing this instruction is initially in register

PC.

The required steps are:

1. Transfer the contents of register PC to register MAR

2. Issue a Read command to memory, and then wait until it has transferred the requested word

into register MDR

3. Transfer the instruction from MDR into IR and decode it

4. Transfer contents of R1 and R2 to the ALU

5. Perform addition of two operands in the ALU and transfer result into R3

6. Transfer contents of PC to ALU

7. Add 1 to operand in ALU and transfer incremented address to PC.

_____________________________________________________________________________

Bus Structures

Q16. Write a short note on bus structures used in computer system.

Bus is a group of wires or lines, connecting all major internal components to the CPU and

memory to transfer the data from one part of a computer to another.

A standard CPU system bus is comprised of control bus, data bus and address bus.

Address Bus

Carries the addresses of data (but not the data) between the processor, memory and

I/O port. CPU sends out address of data to memory and I/O port on these lines.

Therefore these lines are unidirectional.

Data Bus

Carries data between the processor, the memory unit and the input/output devices.

CPU can read data on these lines from memory or from input port, as well as send

data out on these lines to memory or to output port. Therefore these lines are

bidirectional.

Control Bus Carries control signals/commands from the CPU (and status signals from other

devices) in order to control and coordinate all the activities within the computer.

Bus Structures:

There are two ways to organize a bus. They are 1. Single bus structure

2. Multiple bus structure

1. Single Bus Structure:

The simplest way to interconnect functional units is to use a “single bus”. In single bus

structure, all functional units are connected to a common bus called “system bus”.

Since single bus can be used for only one transfer at a time, only two units can use the

bus and communicate with each other at a time. The bus control lines are used to manage

multiple requests for use of the bus.

Page 15: Computer Science & Engineering II B.Tech. - II Semester

Computer Organization -R16 UNIT-1

Kallam Haranadhareddy Institute of Technology Page 13

The advantage of using single bus structure is its low cost and flexibility for attaching

peripheral devices.

The disadvantage of using single bus structure is the performance of computer system suffers,

when large number of devices are connected to the common bus. This is because of two reasons.

1. When more devices are connected to the common bus, we need to share the bus among

these devices. The sharing mechanism co-ordinates the use of bus. This co-ordination

requires finite amount of time called “propagation delay”. When control of bus passes from

one device to another frequently, these propagation delays affect the performance of

computer system.

2. When aggregate data transfer demand approaches the capacity of the bus, the bus may

become a bottleneck. In such situations, we have to increase the data rate of the bus (high

speed shared bus) or we have to use wider bus.

The need of high speed shared bus is impractical to satisfy with single bus. Thus most

systems use the multiple buses.

There are two approaches used to overcome this.

1. buffer registers

2. multiple bus

Speed Operation (using buffer registers):

Devices connected to a bus have different speed of operation. Among the functional units,

input and output devices are slower devices and memory and processor units are faster devices.

Since all these functional units are connected over a bus, if the speed of bus is bounded by the

slowest device connected to it, the efficiency will be very low.

A common approach to solve this is using “buffer registers”. Buffer registers are used to

hold the information during transfers. They prevent high speed processor from being locked to

slower I/O devices during data transfers. This allows processor to switch rapidly from one

device to another processing the data transfers involving several I/O devices.

Example: consider the transfer of data from processor to printer.

The processor sends data to printer buffer over the bus.

Once the buffer is loaded, printer starts printing without any intervention by the

processor.

Now, the bus and processor are no longer needed and can be released for other activity.

Printer continues printing data in its buffer and is not available until this process is

completed.

Thus, buffer registers smooth out the timing differences among processors, memories and I/O

devices.

2. Multiple Bus Structure:

In multiple bus structure, several devices are connected using more than one bus. These

buses will have the hierarchical structure.

Page 16: Computer Science & Engineering II B.Tech. - II Semester

Computer Organization -R16 UNIT-1

Kallam Haranadhareddy Institute of Technology Page 14

Using multiple bus structure, two or more transfers can be carried out at a time, thus

achieving more concurrency in operations, which leads to better performance at an increased

cost.

_____________________________________________________________________________

System Software

Q17.“System software is responsible for coordination of all activities in a computing

system”-Justify this statement with the functionalities of it.

In order for a user to enter and run an application program, the computer must already contain

some system software in memory.

System Software is a collection of programs that are executed to perform the following

functions:

3. Receiving and interpreting user commands.

4. Enter, edit, and store application programs in secondary storage devices in the form of files.

5. Managing the storage and retrieval of files in secondary storage devices.

6. Linking and running application programs with existing library functions.

7. Running standard application programs with data supplied by user.

8. Translating application programs from source form (high level language) to object form

(machine level language) which contains machine instructions.

9. Controlling I/O units to receive input information and produce output results.

System software is thus responsible for coordination of all activities in a computing system.

_____________________________________________________________________________

Q18. Define system software? Discuss briefly about software and its processor time.

Software: Software is a collection of programs. There are two types of software. They are:

1. Application software

2. System software

Application Software: Application Software is software used to help the user to perform a

specific task and designed to fulfill the requirements of the user.

Application programs are written in high level language such as C, C++, java etc. a

programmer need not know the details of machine level instructions.

Examples for Application Software are MS Office, Photoshop, games etc.

System Software: System Software is software designed to operate the computer hardware and

run application programs. The System Software start running when the system is turned on,

makes the systems understand, the command entered by the user and manages all the resources

of the system and it runs till the system is turned off.

The commonly used system software programs are compiler, text editor and operating

system.

Compiler translates the high level language program (source program) into machine level

language program (object program) which contains machine instructions.

Text editor is used to enter, edit and store application programs in secondary storage devices in

Page 17: Computer Science & Engineering II B.Tech. - II Semester

Computer Organization -R16 UNIT-1

Kallam Haranadhareddy Institute of Technology Page 15

the form of files.

Operating System ensures that the system resources are utilized efficiently.

When the computer starts, BIOS first identify system devices such as keyboard, mouse

and other hardware. It runs a series of tests called POST (Power On Self Test) to make sure that

system devices are working correctly. Then it identifies software on hard disk or CD, loads

operating system into computer’s main memory and executes that software. This gives control

over the computer resources.

It interprets user commands, assigns memory and disk space, moves information

between the memory and the disk, and handles I/O operations.

It makes it possible for a user to use the text editor, compiler, assembler, and linker to

prepare application programs. The loader is normally part of the OS, and it is invoked when a

user enters a command to execute an application program.

Q. How the operating system overlaps processing, disk transfers and printing for several

programs to make the best possible use of the resources available.

Steps involved in running one application program:

Consider a computer with a processor and I/O devices consisting of a keyboard, a display, a

disk, and a printer. Assume that the program’s task involves reading a data file from the disk

into the memory, performing some computation on the data, and printing the results.

1. Assume that the application program has been compiled from high level language to

machine level language and stored on the disk in the form of a file.

2. When execution of the program reaches the point where the data file is needed, the

program requests the OS to transfer the data file from the disk to the memory.

3. This causes the loader to transfer the file into the memory.

4. Once the data files are transferred, the OS passes execution control back to the

application program and then application program proceeds to perform the required

computation.

5. When the computation is completed and the results stored in memory are ready to be

printed, the application program again sends a request to the OS.

6. An OS program is then executed to print the results.

Execution control passes back and forth between the application program and the OS routines,

which share the processor to perform their respective tasks.

t0, t1 …t5 are the instances of time and the interaction during various instances is as given

below:

During the time period t0 to t1: the loader transfers the object program from the disk to the

memory.

At t1: the OS passes execution control to the application program, and program executes until it

needs the data on the disk.

During the time period t2 to t3: The OS transfers the required data.

At t3: the OS passes execution control to the application program, and program executes to

perform the computations.

At t4: application program again sends a request to the OS

Page 18: Computer Science & Engineering II B.Tech. - II Semester

Computer Organization -R16 UNIT-1

Kallam Haranadhareddy Institute of Technology Page 16

During the time period t4 to t5: Finally, the OS prints the results stored in the memory.

At t5: the OS may load and begin execution of another program

Steps involved in running multiple application programs:

Note that the disk and the processor are idle during most of the time period t4 to t5. If

the user is allowed to enter a command during this period, the OS can load and begin execution

of another program while the printer is printing. Similarly, during the time period t0 to t1, the

OS can cause the printer to print previous programs results while current program is loading.

Thus the OS is responsible for efficient use of the computer resources, if there are

several application programs to be executed, by overlapping the tasks performed by I/O

operations (to reduce the total time needed to execute them), and managing the concurrent

execution in some interleaved time order, which is called as “multiprogramming” or

“multitasking”.

Elapsed time:

The total time required to execute the program is called as elapsed time. (t5-t0)

It depends on all units in computer system.

elapsed time is a measure of the performance of the entire computer system.

It is affected by the speed of the processor, the disk and the printer.

Processor time:

The sum of the time periods of the elapsed time, during which the processor is active is

called processor time.

The processor time depends on the hardware involved in the execution of individual

machine instructions.

This hardware comprises of processor and memory connected by a bus.

processsor time is a measure of the performance of the processor.

____________________________________________________________________________

Q19. Let the input and output steps of a collection of programs could be overlapped to

reduce the total time needed to execute them. Let each of the six OS routine execution

intervals be 1 unit of time, with each disk operation requiring 3 units, printing requiring 3

units, and each program execution interval requiring 2 units. Compute the ratio of best

overlapped time to non-overlapped time for a long sequence of programs. Ignore startup

and ending transients.

non-overlapped time is 19 units

Page 19: Computer Science & Engineering II B.Tech. - II Semester

Computer Organization -R16 UNIT-1

Kallam Haranadhareddy Institute of Technology Page 17

overlapped time is 15 units

the ratio of best overlapped time to non-overlapped time is 15/19.

_____________________________________________________________________________

Q20. Compute the ratio of overlapped time to non-overlapped time for completing the

execution of a collection of programs, where each program has about equal balance among

input, compute, and output activities?

If it is possible to do output, compute, and input by overlapping at the same time, involving all

three units of printer, processor, and disk continuously, then potentially the ratio could be

reduced toward 1/3. The OS routines needed to coordinate multiple unit activity cannot be fully

overlapped with other activity because they use the processor. Therefore, the ratio cannot

actually be reduced to 1/3.

_____________________________________________________________________________

Performance

Q21. Discuss the basic aspects of computer performance.

The most important measure of the performance of a computer is how quickly (speed) it can

execute programs.

The factors that affect the computer performance (The speed with which a computer

executes program) are

1. hardware design

2. instruction set

3. compiler

For best performance, it is necessary to design the compiler, the machine instruction set, and

the hardware in a coordinated way.

Various parameters used for measuring and improving performance are

1. Elapsed time

2. Processor time

3. Processor clock

4. Clock rate

5. Basic Performance equation

6. Pipelining and Superscalar Operations

7. Cache memory

8. Instruction set

9. Optimizing compiler

10. SPEC rating (performance measurement)

Processor clock:

CPI and IPC are used to describe computer performance.

CPI (cycles per instruction) is the number of clock cycles required to execute each

instruction. Computer processors can execute one or more instructions per clock cycle,

depending on the type of processor. Then IPC (instructions executed per cycle) is used

instead of CPI.

Page 20: Computer Science & Engineering II B.Tech. - II Semester

Computer Organization -R16 UNIT-1

Kallam Haranadhareddy Institute of Technology Page 18

Processor circuits are controlled by a timing signals called a clock which defines regular

time intervals, called clock cycles.

To execute a machine instruction, the processor divides the action to be performed into a

sequence of basic steps, such that each step can be completed in one clock cycle.

The length P (clock period) of one clock cycle is an important parameter that affects

processor performance.

Clock Rate:

The clock speed or clock rate is a measure of the performance of the computer

processor.

The inverse of clock period is the clock rate, R = 1/P.

It determines the speed of calculations, a processor can perform in one second of time.

It is measured in cycles per second or Hertz, typically either megahertz (MHz) or

gigahertz (GHz).

If the clock rate R is 500 million cycles per second, then the corresponding clock period

P is 2 nanoseconds.

There are two possibilities for increasing the clock rate, R.

1. First, improving the integrated circuit (IC) technology makes logic circuit faster, which

reduces the time needed to complete a basic step. This allows the clock period, P, to be

reduced and the clock rate, R, to be increased.

2. Second, reducing the amount of processing done in one basic step also makes it possible

to reduce the clock period , P.

Elapsed time:

The total time required to execute a program is called elapsed time .

This elapsed time is a measure of the performance of the entire computer system.

The elapsed time for the execution of a program depends on all units in a computer

system.

It is affected by the speed of the processor, the disk and the printer.

Processor time:

The time needed to execute a instruction is called processor time

It is the sum of the time periods of the elapsed time, during which the processor is

active.

This processor time is a measure of the performance of the processor.

The processor time depends on the hardware involved in the execution of individual

machine instructions. This hardware comprises the processor and the memory which are

usually connected by the bus.

Basic Performance equation:

Assume that the application program is compiled into machine language.

the program execution time is given by

𝑇 =NxS

R

This is often referred to as the basic performance equation.

where ‘T’ - the processor time required to execute a program

‘N’ – number of executable machine language instructions.

‘S’ - the total number of basic steps needed to execute one machine instruction

‘R’ - clock rate in cycles per second

The product NxS is the total number of clock cycles needed to execute a program.

The effective value of S is 1

To achieve high performance, value of T must be reduced. i.e, reducing values of N,S

and increasing R.

The value of N is reduced, if program is compiled into fewer machine instructions.

The value of S is reduced, if smaller number of basic steps needed to execute

instructions or if the execution of instructions are overlapped.

Page 21: Computer Science & Engineering II B.Tech. - II Semester

Computer Organization -R16 UNIT-1

Kallam Haranadhareddy Institute of Technology Page 19

The value of R is increased, if high frequency clock is used i.e., time needed to execute a

basic execution step is reduced .

Pipelining:

Instructions are not necessarily executed one after another.

Concurrent execution can be done using multiprogramming or multitasking. Another

way of concurrent execution is pipelining.

A substantial improvement in performance can be achieved by overlapping the

execution of successive instructions, using a technique called pipelining .

Consider the instruction

Add R1, R2, R3

which adds the contents of registers R1 and R2, and places the sum into R3.

– The contents of R1 and R2 are first transferred to the inputs of the ALU.

– After the add operation is performed, the sum is transferred to R3.

– Processor can read the next instruction from the memory while the addition operation is

being performed.

– Then, if that instruction also uses the ALU, its operands can be transferred to the ALU

inputs at the same time that the result of Add instruction is being transferred to R3.

Thus, pipelining increases the rate of executing instructions significantly and cause the

effective value of S to approach 1.

Hence, effective value of S in a pipelined processor is close to 1, even though the

number of basic steps per instruction may be considerably larger.

Superscalar Operations:

A higher degree of concurrency can be achieved if multiple instruction pipelines are

implemented in the processor.

This means that multiple function units are used, creating parallel paths through which

different instructions can be executed in parallel.

With such an arrangement, it becomes possible to start the execution of several

instructions in every clock cycle.

This mode of execution is called Superscalar operation.

Cache memory:

Cache memory is used to store frequently used data.

Cache memory is a smallest amount of memory which can be placed as a part of the

processor fabricated on a single IC chip, which is called as internal cache memory.

At the start of execution, all program instructions and the required data are stored in the

main memory.

When CPU requests the data, first it checks data in cache memory. If it is found in the

cache, it is read from the cache memory.

If the word requested by CPU is not found in the cache, the word is read from the main

memory and a copy is transferred to cache memory

Later if the same instruction or data item is needed a second time, it is read directly from

the cache.

For example:- Suppose a number of instructions are executed repeatedly over a short

period of time as happens in a program loop. If these instructions are available in the

cache, they can be fetched quickly during the period of repeated use.

The internal speed of cache performing the basic steps of instruction processing on such

chip is very high and is considerably faster than the speed at which the instruction and

data can be fetched from the main memory.

Page 22: Computer Science & Engineering II B.Tech. - II Semester

Computer Organization -R16 UNIT-1

Kallam Haranadhareddy Institute of Technology Page 20

Thus, a program will be executed faster using the cache improving the performance of

computer system.

Instruction set : CISC and RISC

The terms CISC and RISC refer to design principles and techniques.

1. RISC : Reduced instruction set computers

Simple instructions require a small number of basic steps to execute.

For a processor that has only simple instructions, a large number of instructions may be

needed to perform a given programming task.

This could lead to a large value of N and a small value for S.

It is much easier to implement efficient pipelining in processors with simple instruction

sets.

2. CISC: Complex instruction set computers.

Complex instructions involve a large number of steps.

If individual instructions perform more complex operations, fewer instructions will be

needed.

This could lead to a lower value of N and a larger value of S.

Since, effective value of S in a pipelined processor is close to 1, even though the number

of basic steps per instruction may be considerably larger., Complex instructions

combined with pipelining would achieve good performance.

Compiler

A compiler translates a high-level language program into a sequence of machine

instructions. An optimizing compiler reduces code by rearranging program instructions

to achieve better performance.

To reduce N, we need to have a suitable machine instruction set and a compiler that

makes good use of it.

An optimizing compiler takes advantage of various features of the target processor to

reduce the product NxS, the total number of clock cycles needed to execute a program.

Performance measurement

The performance of a computer can be described by computing the execution time T,

𝑇 =NxS

R

But, computing the value of T is not simple, and moreover, clock speed and various

architectural features are not reliable indicators of expected performance.

For this reason, the performance of a computer is measured using benchmark programs –

the set of programs that are believed to be typical of the programs that will be run on the

system .

The performance measure is the time taken for a computer to execute all of the programs

in a benchmark suite.

One of the best known benchmark suite is SPEC suite, produced by a non profit

organization called “System Performance Evaluation Corporation” (SPEC). It selects

and publishes representative application programs for different application domains.

The SPEC rating is computed as follows

SPEC rating =Running time on the reference computer

Running time on the computer under test

A program is compiled for the computer under test and running time on real computer is

measured. The same program is compiled and run on computer selected as reference.

Thus SPEC rating of 50 means that the computer under test is 50 times faster than the

reference computer for this particular benchmark.

The test is repeated for all the programs in the SPEC suite, and the geometric mean of

the results is computed.

The overall SPEC rating for the computer is given by

Page 23: Computer Science & Engineering II B.Tech. - II Semester

Computer Organization -R16 UNIT-1

Kallam Haranadhareddy Institute of Technology Page 21

SPEC rating = (∏ SPECi

n

i=1

)

1n

where SPECi be the rating for program ‘i’ in the suite

n is the number of programs in the suite.

Thus SPEC rating is used to measure the actual execution time. Hence it is a measure of

combined effect of all factors affecting performance, including compiler, OS, processor

and memory of computer being tested.

_____________________________________________________________________________

Q22. A program contains 1000 instructions. Out of that 25% instructions requires 4

clock cycles,40% instructions requires 5 clock cycles and remaining require 3 clock

cycles for execution. Find the total time required to execute the program running in a 1

GHz machine.

Given N = 1000

25% of N= 250 instructions require 4 clock cycles.

40% of N =400 instructions require 5 clock cycles.

35% of N=350 instructions require 3 clock cycles.

T = (N*S)/R= (250*4+400*5+350*3)/1X109 =(1000+2000+1050)/1*109= 4.05 μs.

_____________________________________________________________________________

Q23. For the following processor, obtain the performance. Clock rate = 800 MHz No. of instructions executed = 1000 Average no of steps needed / machine instruction = 20

_____________________________________________________________________________

Q24a. Program execution time T is to be examined for a certain high-level language

program. The program can be run on a RISC or a CISC computer. Both computers use

pipelined instruction execution, but pipelining in the RISC machine is more effective

than in the CISC machine. Specifically, the effective value of S in the T expression for

the RISC machine is 1.2, bit it is only 1.5 for the CISC machine. Both machines have the

same clock rate R. What is the largest allowable value for N, the number of instructions

executed on the CISC machine, expressed as a percentage of the N value for the RISC

machine, if time for execution on the CISC machine is to be longer than on the RISC

machine?

Let TR = (NR X SR)/RR & TC = (NC X SC)/RC be execution times on RISC and

CISC processors. Equating execution times and clock rates, we have

1.2NR = 1.5NC Then

NC/NR = 1.2/1.5 = 0.8 Therefore, the largest allowable value for NC is 80% of NR.

b. Repeat Part (a) if the clock rate R for the RISC machine is 15 percent higher than

that for the CISC machine. In this case,

1.2NR/1.15 = 1.5NC/1.00 Then

NC/NR =1.2/(1.15 X 1.5) = 0.696 Therefore, the largest allowable value for NC is 69.6% of NR.

_____________________________________________________________________________

The history of computer development.

Q25. Write about the history of development of the computer.

Development of technologies used to fabricate the processors, memories and I/O units of the

computers has been divided into various generations as given below:

Page 24: Computer Science & Engineering II B.Tech. - II Semester

Computer Organization -R16 UNIT-1

Kallam Haranadhareddy Institute of Technology Page 22

1. First generation

2. Second generation

3. Third generation

4. Fourth generation

5. Beyond the fourth generation

First generation:

1946 to 1955: Computers of this generation used Vacuum Tubes.

The computers were built using stored program concept. Ex: ENIAC, EDVAC, IAS,

IBM 701.

Computers of this age typically used about ten thousand vacuum tubes.

They were bulky in size had slow operating speed, short life time and limited

programming facilities.

Mercury delay- line memory were used.

Magnetic core memories and magnetic tape storage devices were developed.

Second generation:

1955 to 1965: Computers of this generation used the germanium transistors as the active

switching electronic device. Ex: IBM 7000, B5000, IBM 1401.

Comparatively smaller in size, and had about ten times faster operating speed as

compared to first generation vacuum tube based computers.

Consumed less power, had fairly good reliability.

Availability of large memory was an added advantage. Magnetic core memories and

magnetic drum storage devices were used.

High level languages such as FORTRAN, compilers and separate I/O processors were

developed.

Third generation:

1965 to 1975: The computers of this generation used the Integrated Circuits as the active

electronic components. Ex: IBM system 360, PDP minicomputer etc.

They were still smaller in size.

They had powerful CPUs with the capacity of executing 1 million instructions per

second (MIPS).

Used to consume very less power consumption.

Integrated circuit memories were used.

Microprogramming, parallelism, pipelining,cache and virtual memories were developed.

Fourth generation:

1976 to 1990: The computers of this generation used the LSI chips like microprocessor

as their active electronic element (large scale integrated circuits). Ex: HCL horizen III,

and WIPRO‟S Uniplus+ HCL‟s Busybee PC etc.

They used high speed microprocessor as CPU.

They were more user friendly and highly reliable systems.

They had large storage capacity disk memories.

Beyond Fourth Generation:

1990 onwards: Specialized and dedicated VLSI chips are used to control specific

functions of these computers. Ex: Modern Desktop PC‟s, Laptops or Notebook

Computers.

It includes artificial intelligence, parallel machines, distributed sytems.

Evolution performance:

Replacement of electromechanical devices with vacuum tubes caused a 100-1000 fold

increase, from seconds to milliseconds.

Replacement of vacuum tubes by transistors caused a 1000 fold increase, from

milliseconds to microseconds.

Replacement of transistors with integrated circuits caused a 10000 fold increase, from

microseconds to nanoseconds.

Page 25: Computer Science & Engineering II B.Tech. - II Semester
Page 26: Computer Science & Engineering II B.Tech. - II Semester

Powered by TCPDF (www.tcpdf.org)Powered by TCPDF (www.tcpdf.org)


Recommended