UNIT-I BASIC STRUCTURE OF COMPUTERS · PDF fileUNIT-I BASIC STRUCTURE OF COMPUTERS Q) ......

18
QUESTION & ANSWERS COMPUTER ORGANIZATION GRIET/ECE 1 UNIT-I BASIC STRUCTURE OF COMPUTERS Q) Write short note on types of computers. Computer Types: A computer is a fast electronic calculating machine that accepts digitized information from the user, processes it according to a sequence of instructions stored in the internal storage, and provides the processed information to the user. The sequence of instructions stored in the internal storage is called computer program and internal storage is called computer memory. According to size, cost, computational power and applications computers are classified as: Microcomputers Minicomputers Desktop Computers Personal Computers Portable notebook computers Workstations Mainframes or enterprise systems Servers Super Computers Microcomputers: Microcomputers are smaller computers. They contain only one CPU. One distinguishing feature of microcomputer is that the CPU is usually a single IC called microprocessor. Microcomputer is the integration of microprocessor and supporting peripherals (memory and I/O devices). The word length depends on the microprocessor used and is in the range of 8 bits to 32 bits. These types of computers are used for small industrial control and where storage and speed requirements are moderate. Minicomputers: Minicomputers are the scaled version of the microcomputers with the moderate speed and storage capacity. These are designed to process smaller data words, typically 32-bit words. These types of computers are used for scientific calculations, research, data processing applications etc. Desktop Computers: These are usually found on a home or office desk. They consist of processing unit, storage unit, visual display and audio as output units and keyboard and mouse as input units. Storage unit of such computer consists of hard disks, CD ROMs and diskettes. Personal Computers: The personal computers are the most common form of desktop computers. They found wide use in homes, schools and business offices. Portable Notebook Computers: Portable notebook computers are the compact version of personal computers. Laptops are good example of portable notebook computers. Workstations: Workstations have higher computation power than personal computers. They have high resolution graphics terminals and improved input/output capabilities. Workstations are used in engineering applications and in interactive graphics applications. Mainframes: Mainframe computers are implemented using two or more CPUs. These are designed to work at very high speeds with large data word lengths, typically 64 bits or greater. The data storage capacity of these computers is very high. These types of computers are used for scientific calculations, large data processing applications, and military defense control and for complex graphics applications.

Transcript of UNIT-I BASIC STRUCTURE OF COMPUTERS · PDF fileUNIT-I BASIC STRUCTURE OF COMPUTERS Q) ......

Page 1: UNIT-I BASIC STRUCTURE OF COMPUTERS · PDF fileUNIT-I BASIC STRUCTURE OF COMPUTERS Q) ... Storage unit of such computer consists of hard disks, ... Primary storage memory device Secondary

QUESTION & ANSWERS COMPUTER ORGANIZATION

GRIET/ECE 1

UNIT-I

BASIC STRUCTURE OF COMPUTERS

Q) Write short note on types of computers.

Computer Types:

A computer is a fast electronic calculating machine that accepts digitized information

from the user, processes it according to a sequence of instructions stored in the internal storage,

and provides the processed information to the user. The sequence of instructions stored in the

internal storage is called computer program and internal storage is called computer memory.

According to size, cost, computational power and applications computers are classified as:

Microcomputers

Minicomputers

Desktop Computers

Personal Computers

Portable notebook computers

Workstations

Mainframes or enterprise systems

Servers

Super Computers

Microcomputers:

Microcomputers are smaller computers. They contain only one CPU. One distinguishing

feature of microcomputer is that the CPU is usually a single IC called microprocessor.

Microcomputer is the integration of microprocessor and supporting peripherals (memory

and I/O devices).

The word length depends on the microprocessor used and is in the range of 8 bits to 32

bits.

These types of computers are used for small industrial control and where storage and

speed requirements are moderate.

Minicomputers:

Minicomputers are the scaled version of the microcomputers with the moderate speed and

storage capacity.

These are designed to process smaller data words, typically 32-bit words.

These types of computers are used for scientific calculations, research, data processing

applications etc.

Desktop Computers:

These are usually found on a home or office desk.

They consist of processing unit, storage unit, visual display and audio as output units and

keyboard and mouse as input units.

Storage unit of such computer consists of hard disks, CD ROMs and diskettes.

Personal Computers:

The personal computers are the most common form of desktop computers.

They found wide use in homes, schools and business offices.

Portable Notebook Computers:

Portable notebook computers are the compact version of personal computers.

Laptops are good example of portable notebook computers.

Workstations:

Workstations have higher computation power than personal computers.

They have high resolution graphics terminals and improved input/output capabilities.

Workstations are used in engineering applications and in interactive graphics

applications.

Mainframes:

Mainframe computers are implemented using two or more CPUs.

These are designed to work at very high speeds with large data word lengths, typically 64

bits or greater. The data storage capacity of these computers is very high.

These types of computers are used for scientific calculations, large data processing

applications, and military defense control and for complex graphics applications.

Page 2: UNIT-I BASIC STRUCTURE OF COMPUTERS · PDF fileUNIT-I BASIC STRUCTURE OF COMPUTERS Q) ... Storage unit of such computer consists of hard disks, ... Primary storage memory device Secondary

QUESTION & ANSWERS COMPUTER ORGANIZATION

GRIET/ECE 2

Servers:

These computers have large storage unit and faster communication links.

The large storage unit allows storing sizable database and fast communication links allow

faster communication of data blocks with computers connected in the network.

These computers serve major role in internet communication.

Super Computers:

These computers are basically multiprocessor computers used for the large scale numerical

calculations required in applications such as weather forecasting, robotic engineering, aircraft

design and simulation.

Q) Draw the block diagram of a computer and explain the function of each block.

Sol: Functional units of computer:

Figure 1.1 Basic functional units of a computer

The computer consists of five functionally independent units:

Input, memory, arithmetic and logic, output and control units.

Input unit:

A computer accepts digitally coded information through input unit using input devices.

The most commonly used input devices are keyboard and mouse.

The keyboard is used for entering text and numeric information.

On the other hand mouse is used to position the cursor and thereby to enter the

information.

Apart from keyboard and mouse there are many other input devices available, which include

joysticks, trackball, space ball, digitizers and scanners.

Memory unit:

The memory unit is used to store programs and data. Usually two types of memory

devices are used to form a memory unit:

Primary storage memory device

Secondary storage memory device

The primary memory, commonly called main memory is a fast memory commonly used

to store programs and active data.

The main memory is a semiconductor memory. It consists of a large number of

semiconductor storage cells, each capable of storing one bit of information.

These cells are read or written by the CPU in a group of fixed size called words.

To access data from a particular word from maim memory, each word has a distinct

address.

The number of bits in each word is referred to as word length of the computer, which

may vary from 8 to 64 bits. The number of such words in main memory decides the size

of memory.

An important characteristic of a memory is an access time, which is the time required to

access one word. The access time for main memory should be as small as possible, of the

order of 10 to 100 nanoseconds.

Arithmetic

and Logic

unit

Control unit

Input

unit

Output

unit

Memory unit

Page 3: UNIT-I BASIC STRUCTURE OF COMPUTERS · PDF fileUNIT-I BASIC STRUCTURE OF COMPUTERS Q) ... Storage unit of such computer consists of hard disks, ... Primary storage memory device Secondary

QUESTION & ANSWERS COMPUTER ORGANIZATION

GRIET/ECE 3

The access time depends on type of memory. These memories are fast but they are small

in capacities and expensive.

Therefore, the computer uses the secondary storage memories such as magnetic tapes,

magnetic disks for the storage of large amount of data.

Arithmetic and Logic Unit:

The ALU is responsible for performing arithmetic operations such as add, subtract,

division and multiplication and logical operations such as AND, OR, inverting etc.

To perform these operations operands from the main memory are brought into high speed

storage elements called registers of the processor.

The access times to registers are typically 5 to 10 times faster than access times to

memory.

Output Unit:

The output unit sends the processed results to the user using output devices such as video

monitor, printer, plotter etc.

The video monitors display the output on the CRT screen whereas printers and plotters

give the hardcopy output.

Printers are classified according to their printing methodology:

Impact printers press formed character faces against an inked printer.

Non impact printers and plotters use laser techniques, inkjet sprays, xerographic

processes, electrostatic methods to get images onto the paper.

Control Unit:

The control unit coordinates and controls the activities amongst the functional units.

The basic function of control unit is to fetch the instructions stored in the main memory,

identify the operations and devices involved in it and the devices involved in it and

accordingly generate control signals to execute the desired operations.

The control unit uses control signals or timing signals to determine when a given action is

to taken place. It controls input and output operations, data transfers between the

processor, memory and input/output devices using timing signals.

Q) Draw the diagram for connection between the processor and the memory and explain

basic operational concepts of computer.

Sol: Basic Operational Concepts:

The basic function of computer is to execute program (sequence of instructions) which is

stored in computer memory. The instructions are executed to process data stored in memory

through input unit. After processing the data, the result is stored back into computer memory for

further reference or it is sent to the outside world through the output port. Therefore, all

functional units of the computer contribute to execute a program.

To perform execution of instruction, in addition to ALU and control unit, the processor

contains a number of registers used for temporary storage of data and some special function

registers as shown below.

Processor

[Type a quote from the document or

the summary of an interesting point.

You can position the text box

anywhere in the document. Use the

Text Box Tools tab to change the

formatting of the pull quote text box.]

PC

IR

MDR

ALU

MAR

Main Memory

Control unit

R1

R0

R2

.

.

.

.

.

.

. Rn

General purpose

registers

Page 4: UNIT-I BASIC STRUCTURE OF COMPUTERS · PDF fileUNIT-I BASIC STRUCTURE OF COMPUTERS Q) ... Storage unit of such computer consists of hard disks, ... Primary storage memory device Secondary

QUESTION & ANSWERS COMPUTER ORGANIZATION

GRIET/ECE 4

The special function registers include program counter (PC), instruction register (IR), memory

address register (MAR) and memory data register (MDR).

PC:

The program counter is one of the important registers in the CPU.

The sequence of instruction execution is monitored by the program counter.

It keeps track of which instruction is being executed and what the next instruction will be.

IR:

It is used to hold the instruction that is currently being executed.

The contents of IR are available to control unit, which generate the timing signals.

MAR:

It holds the address of main memory to or from which data is to be transferred.

MDR:

It contains the data to be written into or read from addressed word of main memory.

It is necessary that computer system should give response to devices such as keyboard,

sensor etc. when they request service.

When the processor is asked to communicate with devices, it is said that processor is

servicing the devices.

Eg. Each time when a character is typed on the keyboard, a keyboard service routine is called.

The processor can service the device in one of two ways:

Polling routine:

Here, the processor’s software simply checks each of the I/O devices every often.

During this check, the processor tests to see if any device needs servicing.

Interrupt method:

Here, it allows the processor to be executing its main program and only stop to service

I/O devices when it is told to do so by the device itself.

Once this servicing is completed, the processor would resume exactly where it is left off.

It may happen that more than one input devices may request for I/O service

simultaneously. In such cases, the I/O device having highest priority is serviced first.

Therefore, to handle multiple interrupts processors use priority logic.

Fig. Single interrupt Fig. Nested interrupt

Therefore, the processor provides the requested service by executing an appropriate ISR. Saving

the state of processor at the time of interrupt is also one of the functions of the computer system.

Q) Write about bus structures.

Sol: Bus Structures:

The CPU, memory unit and I/O unit are hardware components of a computer which work

together with communicating each other and have paths for connecting the modules

together.

The collection of paths connecting the various modules is called interconnection

scheme/structure.

Main

program Interrupt service

routine (ISR)

Main

program ISR1

ISR2

Page 5: UNIT-I BASIC STRUCTURE OF COMPUTERS · PDF fileUNIT-I BASIC STRUCTURE OF COMPUTERS Q) ... Storage unit of such computer consists of hard disks, ... Primary storage memory device Secondary

QUESTION & ANSWERS COMPUTER ORGANIZATION

GRIET/ECE 5

A group of wires called bus is used to provide necessary signals for communication

between modules.

A bus that connects major computer components (CPU, memory, I/O) is called a system

bus.

Usually, the system bus is separated into three functional groups:

o Data bus

o Address bus

o Control bus

Data bus:

Data bus consists of 8, 16, 32, 64 or more parallel signal lines which are bidirectional.

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

these lines to memory or port.

Communication between CPU and a peripheral is activated by giving output enable pulse

to the peripheral.

Outputs of peripherals are floated when they are not in use.

Address bus:

Unidirectional

Consists of 16, 20, 24 or more parallel signal lines.

On these lines, CPU sends out the address of the memory location or I/O port that is to be

written to or read from.

Control bus:

Control lines regulate the activity on the bus.

CPU sends signals on the control bus to enable the outputs of addressed memory devices

or port devices.

Typical control bus signals include:

Memory Read (MEMR’)

Memory Write (MEMW’)

I/O Read (IOR’)

I/O Write (IOW’)

Bus Request (BR)

Bus Grant (BG)

Interrupt Request (INTR)

Interrupt Acknowledge (INTA)

Clock

Reset

Ready

Hold

Hold Acknowledge (HLDA)

Fig.

Fig. Bus interconnection scheme

Single bus structure:

Here address bus, data bus and control bus are shown by single bus called system bus. Hence,

such interconnection bus structure is called ‘single bus structure’.

System

Page 6: UNIT-I BASIC STRUCTURE OF COMPUTERS · PDF fileUNIT-I BASIC STRUCTURE OF COMPUTERS Q) ... Storage unit of such computer consists of hard disks, ... Primary storage memory device Secondary

QUESTION & ANSWERS COMPUTER ORGANIZATION

GRIET/ECE 6

Fig. Single bus structure

With single bus, only two units can communicate with each other at a time.

The bus control lines are used to arbitrate multiple requests for use of the bus.

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

peripheral devices.

In most of the processors, multiplexed address and data buses are used to reduce the

number of pins.

During first part of the bus cycle, address is present on the bus. Afterwards, the same bus

is used for data transfer purpose. So latches are required to hold the address sent by the

CPU initially.

Multiple bus structure:

Performance of system suffers when large numbers of devices are connected to the bus.

This is because of two reasons.

When more devices are connected to the common bus, they need to share the bus among

these devices, which requires finite time called propagation delay. This affects the

performance of system.

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

become a bottleneck. In such situations, data rate of the bus is to be increased.

Thus most computer systems use multiple buses:

Traditional bus configuration

High speed bus configuration

Traditional bus configuration:

Traditional bus connection uses three buses:

Local bus

System bus

Expanded bus

Fig. Traditional bus configuration

Page 7: UNIT-I BASIC STRUCTURE OF COMPUTERS · PDF fileUNIT-I BASIC STRUCTURE OF COMPUTERS Q) ... Storage unit of such computer consists of hard disks, ... Primary storage memory device Secondary

QUESTION & ANSWERS COMPUTER ORGANIZATION

GRIET/ECE 7

High speed bus configuration:

The high speed bus configuration uses high speed bus along with three buses used in the

traditional bus configuration.

Here, cache controller is connected to high speed bus.

This bus supports connection to high speed LANs, such as video and graphics

workstation controllers etc.

Fig. High speed bus configuration

Q) Define the terms

1) Editor 2) Assembler 3) Macro Assembler 4) Cross Assembler 5) Meta Assembler

6) Linker 7) Locater 8) Interpreter 9) Compiler 10) Debugger

11) Operating system

Sol: Software:

System software

User software

System software:

Includes OS, editors, assemblers, linkers, loader, compiler, interpreters and debuggers.

It is the collection of programs which are needed in the creation, preparation and

execution of other programs.

So system software in a microcomputer allows one to develop application/user programs

for microprocessor based systems.

1. Editor:

Editor is a source program which is used to create and modify source programs or

text.

The editor has commands to change, delete or insert lines or characters.

2. Assembler:

Assembler translates an assembly language source file into machine language such as

binary or object code.

It usually reads source file more than once.

It generates two files:

i) Object file: contains the binary codes for the instructions and information about the

addresses of the instructions.

Page 8: UNIT-I BASIC STRUCTURE OF COMPUTERS · PDF fileUNIT-I BASIC STRUCTURE OF COMPUTERS Q) ... Storage unit of such computer consists of hard disks, ... Primary storage memory device Secondary

QUESTION & ANSWERS COMPUTER ORGANIZATION

GRIET/ECE 8

ii) Assembler list file: contains the assembly language statements, the binary code for

each instruction and the offset for each instruction.

In first pass,

i) Reading the source program instructions.

ii) Creating a symbol table in which all symbols used in the program.

iii) Replacing all mnemonic codes by their binary codes.

iv) Detecting any syntax error in the program.

v) Assigning relative addresses to the instructions and data.

In second pass,

i) Assembler extracts the symbol from operand field and searches for it in symbol table.

ii) If symbol does not appear in the table, the corresponding statement is obviously

erroneous.

iii) If the symbol appears in the table, the symbol is replaced by its address or value.

3. Macro assembler:

Macro is a sequence of instructions to which a name is assigned.

Macro assembler replaces the macro call by the sequence of instructions that define

the macro.

Macro assembler functions similar to an assembler, with an additional task of macro

expansion.

4. Cross assembler:

Distinguishing feature of cross assembler is that it is not written in the same language

used by the microprocessor that will execute machine code generated by the

assembler.

Usually written in a high level language such as ‘C’ which will make them machine

independent.

5. Meta assembler:

It supports many different microprocessors.

6. Linker:

It is used to join several object files into one large object file.

Large program can be divided into modules and can be tested individually.

It produces a link file which contains the binary codes for all the combined modules.

It also produces a link map which contains the address information of link files.

It assigns only relative addresses to the program starting from zero. This form of

program is said to be relocatable as it can be put anywhere in memory for execution.

7. Locator:

It is a program used to assign specific addresses, at which the object code is to be loaded

into memory.

Eg. Locator program for IBM PC DOS is EXE2BIN.

8. Interpreter:

It processes higher level language program.

It executes only one statement at a time.

It reads a high level language statement of source program, translates it into machine

code, if it does not need information from another instruction, executes the code for

that statement immediately.

It then reads the next statement, translates it and executes it.

Advantage of using an interpreter is that if an error is found, source program can be

corrected and immediately rerun it

Disadvantage is that an interpreted program runs 5 to 25 times slower than the same

program when compiled.

The reason is that, with an interpreter each statement must be translated to machine

code every time the program is run.

Page 9: UNIT-I BASIC STRUCTURE OF COMPUTERS · PDF fileUNIT-I BASIC STRUCTURE OF COMPUTERS Q) ... Storage unit of such computer consists of hard disks, ... Primary storage memory device Secondary

QUESTION & ANSWERS COMPUTER ORGANIZATION

GRIET/ECE 9

Fig. Operation of interpreter

9. Compiler:

It takes the source program written in high level language and translates whole

program into machine language.

Compiler program reads through the entire high level language source program,

translates it to relocatable machine code programs.

The output file from the linker is then located to get absolute address.

Finally, located program is loaded into memory, and then the entire program can be

run without any further translation.

Therefore, it will run faster than it would if executed by an interpreter.

Disadvantage is that when an error is found, it is corrected in the source program and

the entire compile-load sequence is repeated.

Page 10: UNIT-I BASIC STRUCTURE OF COMPUTERS · PDF fileUNIT-I BASIC STRUCTURE OF COMPUTERS Q) ... Storage unit of such computer consists of hard disks, ... Primary storage memory device Secondary

QUESTION & ANSWERS COMPUTER ORGANIZATION

GRIET/ECE 10

Fig. Operation of compiler

10. Debugger:

It is a program which allows to load object code into system memory, execute the

program and debug it.

It allows looking at the contents of registers and memory locations after program

runs.

It allows changing the contents of registers and memory locations and rerun the

program.

It allows single step execution.

It allows setting breakpoints and stopping wherever required to check the results.

It helps to isolate problems in program.

11. Operating system:

It serves as an interface between user and machine.

It performs resource management.

It is a collection of programs that tells the machine what to do under a variety of

conditions.

Eg. DOS, UNIX, WINDOWS etc.

Q) What is the difference between Von Neumann and Harvard architectures?

Sol: There are basically two types of digital computer architectures. The first one is called Von

Neumann architecture and later Harvard architecture was adopted for designing digital

computers.

Von Neumann Architecture:

Page 11: UNIT-I BASIC STRUCTURE OF COMPUTERS · PDF fileUNIT-I BASIC STRUCTURE OF COMPUTERS Q) ... Storage unit of such computer consists of hard disks, ... Primary storage memory device Secondary

QUESTION & ANSWERS COMPUTER ORGANIZATION

GRIET/ECE 11

It is named after the mathematician and early computer scientist John Von Neumann.

The computer has single storage system (memory) for storing data as well as program to

be executed.

Processor needs two clock cycles to complete an instruction. Pipelining the instructions is

not possible with this architecture.

In the first clock cycle the processor gets the instruction from memory and decodes it. In

the next clock cycle the required data is taken from memory. For each instruction this

cycle repeats and hence needs two cycles to complete an instruction.

This is a relatively older architecture and was replaced by Harvard architecture.

Harvard Architecture:

The name is originated from "Harvard Mark I" a relay based old computer.

The computer has two separate memories for storing data and program.

Processor can complete an instruction in one cycle if appropriate pipelining strategies are

implemented.

In the first stage of pipeline the instruction to be executed can be taken from program

memory. In the second stage of pipeline data is taken from the data memory using the

decoded instruction or address.

Most of the modern computing architectures are based on Harvard architecture. But the

number of stages in the pipeline varies from system to system.

These are the basic differences between the two architectures.

Q) Explain about performance of computer and its basic performance

equation.

Sol: Performance: The faster computer runs a program in less time than other computers.

Time between the start and completion of program or event = execution time/response

time

Throughput is the total amount of work done in a given time.

Page 12: UNIT-I BASIC STRUCTURE OF COMPUTERS · PDF fileUNIT-I BASIC STRUCTURE OF COMPUTERS Q) ... Storage unit of such computer consists of hard disks, ... Primary storage memory device Secondary

QUESTION & ANSWERS COMPUTER ORGANIZATION

GRIET/ECE 12

Reduction in response time increases the throughput.

Ideal performance of a computer is achieved when there is a perfect match between

machine capability and program behavior.

Processor clock:

Processor is driven by a clock with a constant cycle time called processor clock.

Time period, P of the processor clock affects the processor performance.

Clock rate, R = 1/P,(cycles per second, CPS)

Basic performance equation:

For the execution of program, processor has to execute number of machine instructions

denoted by N.

N actual number of instructions executed by the processor and is not necessarily equal to the

number of instructions in machine language program, because some may be executed more than

once and others may not be executed at all.

S average number of basic steps required to execute one machine instruction.

T = (N x S)/R

= (N x CPI)/R

Each instruction execution involves cycle of events like instruction fetch, decode,

operand fetch, execution and store results.

So, memory access is to be performed for instruction fetch, operand fetch and to store

results.

Memory cycle time needed to complete one memory reference

= k times processor cycle, p (depends on speed of memory technology)

T = (N x (p +m x k))/R

P number of processor cycles required

m = number of memory references needed

k = ratio between memory cycle and processor cycle

Q) Explain about MIPS, throughput rate, MFLOPS rating of a processor. How do we

arrive at these values?

MIPS:

Another way to measure processor speed, measured in terms of million instructions per second

(MIPS)

MIPS rate = 1/(average time required for the execution of instruction x 106)

= R/ (CPIx106)

= N x R/(N x CPI x 106)

= N/ (T x 106)

Throughput rate:

Throughput rate indicates the number of programs a system can execute per unit time.

It is specified in programs/second.

Ws system throughput rate

Wp processor throughput rate

Wp = number of machine instructions executed. per second /number of machine instructions per

program

= MIPS rate x 106/N

Generally, Wp>Ws

Ws = Wp, if processor is kept busy in a perfect program interleaving fashion.

MFLOPS:

MFLOPS stands for million floating point operations/second.

MFLOPS = number of floating point operations in program/execution time x 106

MFLOPS rating is dependent on the program.

Page 13: UNIT-I BASIC STRUCTURE OF COMPUTERS · PDF fileUNIT-I BASIC STRUCTURE OF COMPUTERS Q) ... Storage unit of such computer consists of hard disks, ... Primary storage memory device Secondary

QUESTION & ANSWERS COMPUTER ORGANIZATION

GRIET/ECE 13

Q) Explain about pipelining and superscalar architecture in detail.

Sol: Pipelining and superscalar operation:

More than one clock cycles are involved in the instruction cycle, which are required to perform

various steps in the instruction execution, such as

S1 – Fetch (F): Read instruction from the memory.

S2 – Decode (D): Decode the Opcode and fetch the source operand if necessary.

S3 – Execute (E): Perform the operation specified by the instruction.

S4 – Store (S): Store the result in the destination.

Usually, instruction is executed by performing above steps one after the other.

When these stages for several instructions are performed simultaneously to reduce overall

processing time, the processing is called instruction pipelining.

In figure, instruction processing is divided into 4 stages hence it is known as four stage

instruction pipeline.

With this subdivision and assuming equal duration for each stage, the execution time for

four instructions is reduced to 7 time units from 16 time units.

This means that four distinct hardware units are needed.

Fig. Four stage instruction line

Pipelining can reduce effective number of clock cycles required for instruction execution

and thus increase the rate of executing instructions significantly.

Another way to improve the performance is to achieve high degree of concurrency, which

can be achieved by implementing multiple instruction pipelines in the processor.

To implement multiple instruction pipelines, processor has multiple functional units and

they are capable of executing multiple instructions at a time creating parallel execution

paths.

Such a processor is known as superscalar processor and such an operation is

known as superscalar execution.

Q) What are benchmark programs? Write the expression for SPEC rating.

Sol: Benchmark programs:

Measures of instruction execution performance are based on average figures, which are

usually determined experimentally by measuring the run times of representative called

benchmark programs.

The benchmark programs are different for checking the performance of processor for

different applications.

According to applications, the benchmark programs are classified as,

1. Desktop benchmark

2. Server benchmark

3. Embedded benchmark

A nonprofit organization called System Performance Evaluation Corporation (SPEC)

specified the benchmark programs and reference computers.

Clock

cycle

F1 D1 E1 S1

1 2 3 4 5 6 7 8 9

F2 D2 E2 S2

F3 D3 E3 S3

F4 D4 E4 S4

Instruction

I1

I2

I3

I4

……

Page 14: UNIT-I BASIC STRUCTURE OF COMPUTERS · PDF fileUNIT-I BASIC STRUCTURE OF COMPUTERS Q) ... Storage unit of such computer consists of hard disks, ... Primary storage memory device Secondary

QUESTION & ANSWERS COMPUTER ORGANIZATION

GRIET/ECE 14

The running time of a benchmark program is compared to decide the SPEC rating of the

computer under test.

SPEC rating = Running time on reference computer

Running time on computer under test

The SPEC rating for all selected programs is individually calculated and then the

geometric mean of results is computed to determine the overall SPEC rating for the

computer under test and is given by

SPEC rating = 1/n

n number of benchmark programs used for determining SPEC

rating

Computers providing higher performance have higher SPEC rating.

Q) Compare multiprocessors and multi computers.

Sol: Multiprocessors and Multicomputers:

To fulfill increasing demand for high performance in large computer system, multiple

processors are used. Such systems are known as multiprocessor systems.

These systems execute a number of different application tasks in parallel or they execute

subtasks of a single large task in parallel.

In multiprocessor systems, memory is shared between all processors i.e., all processors

have the access to entire memory in the system.

Such multiprocessor system is known as shared memory multiprocessor system in which

multiprocessors and memory unit are interconnected with complex interconnection

networks. This increases cost of the system.

Hence, we get higher performance at higher cost of the system.

It is possible to use multiple computers to achieve high performance. Such systems are

called multicomputer systems.

In these systems, group of complete computers are interconnected to achieve high total

computational power.

Here, computers have access only to their own memory units.

When the tasks they are executing need to communicate data or to access data from other

computers, they use message passing mechanism to exchange the information.

Message passing mechanism exchanges the messages over a communication network.

Q) Convert the decimal numbers to the bases indicated.

i. 7562 to octal

ii. 1938 to hexadecimal

Sol: (7562)10 = (16612)8

(1938)10 = (792)16

Q) Perform the arithmetic operations (+42) + (-13) and (-42) – (-13) in binary using signed

2'complement representation for negative numbers.

Sol: + 42 = 0101010 +13 = 0001101 – 42 = 1010110 –13 = 1110011 (+42) 0101010 (– 42) 1010110 (–13) 1110011 (+ 13) 0001101 (+29) 0011101 (– 29) 1100011

Q) Show the given decimal number 8620 in i) BCD ii) excess-3 code iii) 2421 code iv)Binary

number.

Sol: 8620 (a) BCD 1000 0110 0010 0000 (b) XS-3 1011 1001 0101 0011 (c) 2421 1110 1100 0010 0000 (d) Binary 10000110101100 (8192 + 256 + 128 + 32 + 8 + 4)

Page 15: UNIT-I BASIC STRUCTURE OF COMPUTERS · PDF fileUNIT-I BASIC STRUCTURE OF COMPUTERS Q) ... Storage unit of such computer consists of hard disks, ... Primary storage memory device Secondary

QUESTION & ANSWERS COMPUTER ORGANIZATION

GRIET/ECE 15

Q) Explain clearly the terms – Computer Organization, Computer Architecture.

Sol: A computer's architecture is its abstract model and is the programmer's view in terms of

instructions, addressing modes and registers. A computer's organization expresses the

realization of the architecture. Architecture describes what the computer does and organization

describes how it does it.

Architecture and organization are independent; you can change the organization of a

computer without changing its architecture. For example, a 64-bit architecture can be internally

organized as a true 64-bit machine or as a 16-bit machine that uses four cycles to handle 64-bit

values.

The difference between architecture and organization is best illustrated by a non-

computer example. Is the gear lever in a car part of its architecture or organization? The

architecture of a car is simple; it transports you from A to B. The gear lever belongs to the car's

organization because it implements the function of a car but is not part of that function (a car

does not intrinsically need a gear lever).

Q) Explain about the “sign magnitude” and “2’s complement” representations used for the

fixed point numbers. Which among the above is most preferred and why?

Sol: When an integer binary number is positive, the sign is represented by 0 and the magnitude

by a positive binary number. When the number is negative, the sign is represented by 1 but the

rest of the number may be represented in one of three possible ways:

1. Signed-magnitude representation

2. Signed l's complement representation

3. Signed 2's complement representation

The signed-magnitude representation of a negative number consists of the magnitude and

a negative sign. In the other two representations, the negative number is represented in either the

l's or 2's complement of its positive value.

Complements are used in digital computers for simplifying the subtraction operation and

for logical manipulation. There are two types of complements for each base r system: the r's

complement and the (r - l)'s complement.

Although there is only one way to represent +14, there are three different ways to represent —14

with eight bits.

In signed-magnitude representation 1 0001110

In signed-l's complement representation 1 1110001

In signed-2's complement representation 1 1110010

The signed-magnitude representation of – 14 is obtained from +14 by complementing only the

sign bit. The signed-l's complement representation of -14 is obtained by complementing all the

bits of +14, including the sign bit. The signed-2's complement representation is obtained by

taking the 2's complement of the positive number, including its sign bit.

Q) Obtain the 1’s and 2’s complement of the following.

i. 10101110 ii. 10000001 iii. 10000000 iv. 00000001

Sol:

S. no Given no. 1’s complement 2’s complement

i 10101110 01010001 01010010

ii 10000001 01111110 01111111

iii 10000000 01111111 10000000

iv 00000001 11111110 11111111

Q) Derive the circuit for a 3 bit parity generator and 4 bit parity checker using an odd

parity bit.

Sol: Binary information transmitted through some form of communication medium is subject to

external noise that could change bits from 1 to 0, and vice versa. In most practical systems, there

is always a finite probability of the occurrence of a single error. Two types of codes that are used

for single error detection and correction are error detection codes and error correction codes.

An error detection code is a binary code that detects digital errors during transmission.

The detected errors cannot be corrected but their presence is indicated. The most common error

detection code used is the parity bit. A parity bit is an extra bit included with a binary message

Page 16: UNIT-I BASIC STRUCTURE OF COMPUTERS · PDF fileUNIT-I BASIC STRUCTURE OF COMPUTERS Q) ... Storage unit of such computer consists of hard disks, ... Primary storage memory device Secondary

QUESTION & ANSWERS COMPUTER ORGANIZATION

GRIET/ECE 16

to make the total number of l's either odd or even. A message of three bits and two possible

parity bits is shown in Table.

Message

xyz

P (odd) P (even)

000 1 0

001 0 1

010 0 1

011 1 0

100 0 1

101 1 0

110 1 0

111 0 1

Table: Parity bit generation

The P (odd) bit is chosen in such a way as to make the sum of l's (in all four bits) odd.

The P (even) bit is chosen to make the sum of all l's even. In either case, the sum is taken over

the message and the Pbit.

The even-parity scheme has the disadvantage of having a bit combination of all 0's, while

in the odd parity there is always one bit (of the four bits that constitute the message and P) that is

1. Note that the P (odd) is the complement of the P (even).

During transfer of information from one location to another, the parity bit is handled as

follows. At the sending end, the message (in this case three bits) is applied to a parity generator,

where the required parity bit is generated. The message, including the parity bit, is transmitted to

its destination. At the receiving end, all the incoming bits (in this case, four) are applied to a

parity checker that checks the proper parity adopted (odd or even). An error is detected if the

checked parity does not conform to the adopted parity. The parity method detects the presence of

one, three, or any odd number of errors. An even number of errors is not detected. Parity

generator and checker networks are logic circuits constructed with exclusive-OR functions. An

odd function is a logic function whose value is binary 1 if, and only if, an odd number of

variables are equal to 1. According to this definition, the P (even) function is the exclusive-OR of

x, y, and z because it is equal to 1 when either one or all three of the variables are equal to 1. The

P (odd) function is the complement of the P (even) function.

Example:

Consider a 3-bit message to be transmitted with an odd parity bit. At the sending end, the odd-

parity bit is generated by a parity generator circuit. As shown in Fig. a, this circuit consists of

one exclusive-OR and one exclusive-NOR gate. Since P (even) is the exclusive-OR of x, y, z, and

P (odd) is the complement of P (even), it is necessary to employ an exclusive-NOR gate for the

needed complementation. The message and the odd parity bit are transmitted to their destination

where they are applied to a parity checker. An error has occurred during transmission if the

parity of the four bits received is even, since the binary information transmitted was originally

odd. The output of the parity checker would be 1 when an error occurs, that is, when the number

of l's in the four inputs is even. Since the exclusive-OR function of the four inputs is an odd

function, we again need to complement the output by using an exclusive-NOR gate.

Page 17: UNIT-I BASIC STRUCTURE OF COMPUTERS · PDF fileUNIT-I BASIC STRUCTURE OF COMPUTERS Q) ... Storage unit of such computer consists of hard disks, ... Primary storage memory device Secondary

QUESTION & ANSWERS COMPUTER ORGANIZATION

GRIET/ECE 17

Q) How to detect overflow in 2’s complement additional subtraction? Explain with

examples.

Sol:

When two numbers of n digits each are added and the sum occupies n + 1digits, we say that an overflow occurred. An overflow is a problem in digital computers because the width of registers is finite. A result that contains n + 1 bits cannot be accommodated in a register with a standard length of n bits.

For this reason, many computers detect the occurrence of an overflow, and when it occurs, a corresponding flip-flop is set which can then be checked by the user.

The detection of an overflow after the addition of two binary numbers depends on whether the numbers are considered to be signed or_ unsigned.

When two unsigned numbers are added, an overflow is detected from the end carry out of the most significant position.

In the case of signed numbers, the leftmost bit always represents the sign, and negative numbers are in 2's complement form. When two signed numbers are added, the sign bit is treated as part of the number and the end carry does not indicate an overflow.

An overflow cannot occur after an addition if one number is positive and the other is negative, since adding a positive number to a negative number produces a result that is smaller than the larger of the two original numbers.

An overflow may occur if the two numbers added are both positive or both negative. Example: Two signed binary numbers, +70 and +80, are stored in two 8-bit registers. The range of numbers that each register can accommodate is from binary +127 to binary -128. Since the sum of the two numbers is +150, it exceeds the capacity of the 8-bit register. This is true if the numbers are either both positive or both negative. The two additions in binary are shown below together with the last two carries.

Carries: 0 1 carries: 1 0 + 70 0 1000110 -70 1 0111010 + 80 0 1010000 -80 1 0110000

+ 150 1 0010110 -150 0 1101010 Note that the 8-bit result that should have been positive has a negative sign bit and the 8-bit

result that should have been negative has a positive sign bit.

If, however, the carry out of the sign bit position is taken as the sign bit of the result, the

9-bit answer so obtained will be correct. Since the answer cannot be accommodated

within 8 bits, we say that an overflow occurred.

Overflow detection: An overflow condition can be detected by observing the carry into

the sign bit position and the carry out of the sign bit position. If these two carries are not

equal, an overflow condition is produced. This is indicated in the examples where the two

carries are explicitly shown.

C

Page 18: UNIT-I BASIC STRUCTURE OF COMPUTERS · PDF fileUNIT-I BASIC STRUCTURE OF COMPUTERS Q) ... Storage unit of such computer consists of hard disks, ... Primary storage memory device Secondary

QUESTION & ANSWERS COMPUTER ORGANIZATION

GRIET/ECE 18

If the two carries are applied to an exclusive-OR gate, an overflow will be detected when

the output of the gate is equal to 1.

Q) Explain floating-point representation with example. What is meant by Normalization of

floating point numbers?

Sol: The floating-point representation of a number has two parts. The first part represents a signed, fixed-point number called the mantissa. The second part mantissa designates the position of the decimal (or binary) point and is called the exponent exponent. The fixed-point mantissa may be a fraction or an integer.

For example, the decimal number +6132.789 is represented in floating-point with a fraction and an exponent as follows:

Fraction Exponent

+0.6132789 + 04

The value of the exponent indicates that the actual position of the decimal point is four positions to the right of the indicated decimal point in the fraction. This representation is equivalent to the scientific notation +0.6132789 X 10

+4.

Floating-point is always interpreted to represent a number in the following form: m x r

e

A floating-point binary number is represented in a similar manner except that it uses base 2 for the exponent. For example, the binary number +1001.11 is represented with an 8-bit fraction and 6-bit exponent as follows:

Fraction Exponent

01001110 000100

The fraction has a 0 in the leftmost position to denote positive The exponent has the equivalent binary number +4. The floating-point number is equivalent to

m x 2e= +(.1001110)2 x 2

+4

A floating-point number is said to be normalized if the most significant digit of mantissa is

nonzero.

For example the decimal number_350 is normalized but 00035 is not. Regardless of

where the position of the radix point is assumed to be in the mantissa, the number is normalized

only if its leftmost digit is nonzero.

For example, the 8-bit binary number 00011010 is not normalized because of the three

leading 0's. The number can be normalized by shifting it three positions to the left and discarding

the leading 0's to obtain 11010000. Normalized numbers provide the maximum possible

precision for the floating-point number.

A zero cannot be normalized because it does not have a nonzero digit. It is usually rep-

resented in floating-point by all 0's in the mantissa and exponent.

Two main standard forms of floating-point numbers are from the following organizations

that decide standards: ANSI (American National Standards Institute) and IEEE (Institute of

Electrical and Electronic Engineers).

Arithmetic operations with floating-point numbers are more complicated than arithmetic

operations with fixed-point numbers and their execution takes longer and requires more complex

hardware. However, floating-point representation is a must for scientific computations because

of the scaling problems involved with fixed-point computations.

Q)