Assignment On

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 27

ASSIGNMENT ON

MICROPROCESSOR APPLICATION

(EEE 438)

SUBMITTED BY

ABUBAKRY ABDULWASIU ALABI

(ET20190102766)

SUBMITTED TO

ENGR ABUBAKAR, M.A

19TH OF OCTOBERSS, 2021


QUESTION 1

EXPLAIN THE FUNCTION OF AN OPERATION SYSTEM

Application management. An operating system handles the launch and management of every

application. This typically supports an array of behaviors, including timesharing multiple

processes, or threads, so that various tasks can share the available processors’ time; handling

interruptions that applications produce to gain a processor’s immediate attention, ensuring there

is enough memory to execute the application and its corresponding data without interfering with

other processes; carrying out error handling that can gracefully remove an application’s

processes; and performing memory management without disrupting other applications or the OS.

An operating system can also support APIs that enable applications to utilize OS and hardware

functions without the need to know anything about the low-level OS or hardware state. As an

example, a Windows API can enable a program to obtain input from a keyboard or mouse; create

GUI elements, such as dialog windows and buttons; read and write files to a storage device; and

more. Applications are almost always tailored to use the operating system on which the

application intends to run.

Additionally, an operating system can perform the following services for applications:

In a multitasking operating system, where multiple programs can be running at the same time,

the OS determines which applications should run in what order and how much time should be

allowed for each application before giving another application a turn.

It handles input/output (I/O) to and from attached hardware devices, such as hard disks, printers

and dial-up ports.


It sends messages to each application or interactive user – or to a system operator – about the

status of operation and any errors that may have occurred.

It can offload the management of batch jobs – for example, printing – so that the initiating

application is freed from this work.

On computers that can provide parallel processing, an operating system can manage how to

divide the program so that it runs on more than one processor at a time.

All major computer platforms (hardware and software) require, and sometimes include, an

operating system, and operating systems must be developed with different features to meet the

specific needs of various form factors.

Device management. An operating system is responsible for identifying, configuring, and

providing applications with common access to underlying computer hardware devices. As the

OS recognizes and identifies hardware, the OS will install corresponding device drivers that

enable the OS and applications running on the OS to use the devices without any specific

knowledge of the hardware or devices.

Processor Management –

In a multi-programming environment, the OS decides the order in which processes have access

to the processor, and how much processing time each process has. This function of OS is called

process scheduling. An Operating System performs the following activities for processor

management.

Keeps track of the status of processes. The program which performs this task is known as a

traffic controller. Allocates the CPU that is a processor to a process. De-allocates processor when

a process is no more required.


Device Management –

An OS manages device communication via their respective drivers. It performs the following

activities for device management. Keeps track of all devices connected to the system. Designates

a program responsible for every device known as the Input/output controller. Decides which

process gets access to a certain device and for how long. Allocates devices in an effective and

efficient way. Deal locates devices when they are no longer required.

Management – File

A file system is organized into directories for efficient or easy navigation and usage. These

directories may contain other directories and other files. An Operating System carries out the

following file management activities. It keeps track of where information is stored, user access

settings and status of every file, and more… These facilities are collectively known as the file

system.

An operating system is responsible for identifying the correct printer and installing the

appropriate printer drivers so that an application needs to only make calls to the printer without

having to use codes or commands that are specific to that printer – that is the operating system’s

job. The situation is similar for other devices, such as USB ports; networking ports; graphics

devices, such as graphics processing units (GPUs); motherboard chipsets; and storage devices,

such as Serial-Attached SCSI (SAS) disk adapters and disks that are formatted with a suitable

file system.

QUESTION 2

STATE THE DIFFERENT BETWEEN A JOB-SHOP AND BATCH SYSTEM


BATCH PROCESSING SYSTEM ONLINE PROCESSING SYSTEM

In batch processing system input data is In online processing system data is prepared

prepared before the execution. at time of execution as needed.

In batch processing system the processing In online processing system the processing

sequence is predictable sequence is unpredictable.

In batch processing system recovery and In online processing system recovery and

restart is easy restart requires additional process.

QUESTION 3

MULTIPROGRAMMING

A multiprogramming operating system is one which can run multiple programs(or processes)

concurrently. A multiprogramming operating system needn’t be multiprocessing, it could be

round robin based system that allows each process to execute only for a certain period of time

and then puts it into the ready queue. A multiprogramming operating system may run many

programs on a single processor computer. If one program must wait for an input/output transfer

in a multiprogramming operating system, the other programs are ready to use the CPU. As a

result, various jobs may share CPU time. However, the execution of their jobs is not defined to

be at the same time period.

INTERACTIVE SYSTEM

It is a computer device made up by a CPU and peripherals, whose functioning requires a constant

interaction with the user. Currently these systems tend to their miniaturization, the mobility and

wireless connect ability among them. Learn more in: Phaneroscopy for Video Games
QuestiDirect Memory Access (DMA)

The technique described earlier, programmed I / O and Interrupt-Driven I / O has a weakness,

namely the process that occurs in the I / O module still involves the CPU directly. This has

implications for:

· The I / O transfer rate depends on the CPU operating speed.

· CPU work is interrupted due to direct interruptions.

Starting from the weaknesses above, moreover to handle large-volume data transfer developed a

better technique, known as Direct Memory Access (DMA).

The working principle of DMA is that the CPU will delegate the work of I / O to the DMA, the

CPU will only be involved at the beginning of the process to give complete instructions on the

DMA and the end of the process. Thus the CPU can run other processes without much

interference with interruptions.

In carrying out data transfers independently, DMA requires the transfer of bus control from the

CPU. For this reason DMA will use the bus if the CPU does not use it or DMA forces the CPU

to temporarily stop using the bus. The last technique is more commonly used, often called cycle

stealing, because the DMA module takes over the bus cycle.

Temporarily stopping the use of the bus is not a form of interruption, but only a temporary

termination of the process that has implications only for CPU execution delays. Machine code,

also known as machine language, is the elemental language of computers. It is read by the

computer's central processing unit (CPU), is composed of digital binary numbers and looks like a

very long sequence of zeros and ones. Ultimately, the source code of every human-readable
programming language must be translated to machine language by a compiler or an interpreter,

because code is the only language that computer hardware can understand.

Each CPU has its own specific machine language. The processor reads and handles instructions,

which tell the CPU to perform a simple task. Instructions are comprised of a certain number of

bits. If instructions for a particular processor are 8 bits, for example, the first 4 bits part (the

opcode) tells the computer what to do and the second 4 bits (the operand) tells the computer what

data to use.

01001000 01100101 01101100 01101100 01101111 00100001

Depending upon the processor, a computer's instruction sets may all be the same length, or they

may vary, depending upon the specific instruction. The architecture of the particular processor

determines how instructions are patterned. The execution of instructions is controlled by

firmware or the CPU's internal wiring.

Assembly Language: Assembly languages were originally designed with a one-to-one

correspondence between mnemonics and machine language instructions, as shown in this


example.1 Translating from mnemonics to machine language became the job of a systems

program known as an assembler. Assemblers were eventually augmented with elaborate “macro

expansion” facilities to permit programmers to define parameterized abbreviations for common

sequences of instructions.

QUESTION 5

STATE THE MERITS AND DEMERIT OF EACH OF THE LANGUAGE STATED IN

Q4 ABOVE.

Advantages of High-Level Language – It has several advantages over machine language and

assembly language.

Machine Independent – High-level languages are machine independent. This is a very valuable

advantage because it means that a company changing computers even one from a different

manufacturer, will not be required to rewrite all the programs that it is currently using.

Easy to Learn and Use – These languages are very similar to the languages normally used by us

in our day-to-day life. Hence they are easy to learn and use.

Fewer Errors – In case of high-level languages, since the programmer need not to write all the

small steps carried out by the computer, he is much less likely to make an error.

Lower Program Preparation Cost – Writing programs in high-level languages requires less time

and effort which ultimately leads to lower program preparation cost.

Better Documentation – A high-level language is designed in such a way that its instructions

may be written more like the language of the problem. Thus the statements of a program written

in a high-level language can be easily understood by a person familiar with the problem.
Easier to Maintain – programs written in high level language are easier to maintain then

assembly language or machine language programs.

Limitations of High-level Languages – Two disadvantages of high-level languages are –

Lower Efficiency – Generally a program written in assembly language or machine language is

more efficient than one written in high-level language. That is, the program written in high –

level language take more time to run and require more main storage.

Less Flexibility – Generally, high-level languages are less flexible than assembly languages,

because they do not normally have instructions or mechanism to control the computer’s CPU,

memory and registers. An assembly language provides the programmers access to all the special

features of the machine they are using. Certain types of operations, which are easily programmed

using the assembly language, are impractical to attempt using a high-level language. This lack of

difficulty means that some tasks cannot be done in a high level language, or can be done only

with great difficulty.

QUESTION6

EXPLAIN THE OPERATION OF INTERPRETER AND COMPILERS

Compilers and interpreters are computer programs that convert a code written in a high-level

language into a lower-level or machine code understood by computers. However, there are

differences in how they work and when to use them.


Even if you’re not going to implement the next compiler or interpreter, these insights should help

to improve your knowledge of the tools you use as a developer every day.

Definition of Interpreter

The interpreter is an alternative for implementing a programming language and does the same

work as a compiler. Interpreter performs lexing, parsing and type checking similar to a compiler.

But interpreter processes syntax tree directly to access expressions and execute statement rather

than generating code from the syntax tree.

An interpreter may require processing the same syntax tree more than once that is the reason why

interpretation is comparatively slower than executing the compiled program.

Compilation and interpretation probably combined to implement a programming language. In

which a compiler generates intermediate-level code then the code is interpreted rather than

compiled to machine code.

Employing an interpreter is advantageous during program development, where the most

important part is to be able to test a program modification rapidly rather than run the program

efficiently.

Definition of Compiler

A compiler is a program that reads a program written in the high-level language and converts it

into the machine or low-level language and reports the errors present in the program. It converts

the entire source code in one go or could take multiple passes to do so, but at last, the user gets

the compiled code which is ready to execute.


Compiler operates on phases; various stages can be grouped into two parts that are:

Analysis Phase of the compiler is also referred to as the front end in which program is divided

into fundamental constituent parts and checks grammar, semantic and syntax of the code after

which intermediate code is generated. Analysis phase includes lexical analyzer, semantic

analyzer and syntax analyzer.

Synthesis phase of the compiler is also known as the back end in which intermediate code is

optimized, and the target code is generated. Synthesis phase includes code optimizer and code

generator.

Phases of Compiler

Now let’s understand the working of each stage in detail.

Lexical Analyzer: It scans the code as a stream of characters, groups the sequence of characters

into lexemes and outputs a sequence of tokens with reference to the programming language.

Syntax Analyzer: In this phase, the tokens that are generated in the previous stage are checked

against the grammar of programming language, whether the expressions are syntactically correct

or not. It makes parse trees for doing so.


Semantic Analyzer: It verifies whether the expressions and statements generated in the previous

phase follow the rule of programming language or not and it creates annotated parse trees.

Intermediate code generator: It generates an equivalent intermediate code of the source code.

There are many representations of intermediate code, but TAC (Three Address Code) is the used

most widely.

Code Optimizer: It improves time and space requirement of the program. For doing so, it

eliminates the redundant code present in the program.

Code generator: This is the final phase of the compiler in which target code for a particular

machine is generated. It performs operations like memory management, Register assignment,

and machine-specific optimization

The symbol table is somewhat a data structure which manages the identifiers along with the

relevant type of data it is storing. Error Handler detect, report, correct the errors encountering in

between the different phases of a compiler.

DIFFERENCES BETWEEN COMPILER AND INTERPRETER


Let’s look at major differences between Compiler and Interpreter.

The compiler takes a program as a whole and translates it, but interpreter translates a program

statement by statement.

Intermediate code or target code is generated in case of a compiler. As against interpreter doesn’t

create intermediate code.

A compiler is comparatively faster than Interpreter as the compiler take the whole program at

one go whereas interpreters compile each line of code after the other.

The compiler requires more memory than interpreter because of the generation of object code.

Compiler presents all errors concurrently, and it’s difficult to detect the errors in contrast

interpreter display errors of each statement one by one, and it’s easier to detect errors.

In compiler when an error occurs in the program, it stops its translation and after removing error

whole program is translated again. On the contrary, when an error takes place in the interpreter,

it prevents its translation and after removing the error, translation resumes.

In a compiler, the process requires two steps in which firstly source code is translated to target

program then executed. While in Interpreter It’s a one-step process in which Source code is

compiled and executed at the same time.

The compiler is used in programming languages like C, C++, C#, Scala, etc. On the other

Interpreter is employed in languages like PHP, Ruby, Python, etc.

QUESTION 7
EXPLAIN THE FUNCTION OF THE TERMINAL AND MONITOR IN TYPICAL
INTERACTIVE COMPUTER SYSTEM

What is the function of a terminal in a computer? A terminal in its simplest definition is a point

at which one can input or output data; which actually predates computers. “Terminal” in today’s

definitions can refer to the black screen(command prompt) like the one MS-DOS commands are

entered at or it can be in the form of an emulator as well, such as how thin clients access servers

for the bulk of their computing power( a terminal from a Computer-to-Computer relationship).

In my opinion “terminal” is synonymous with the computer itself however Windows is a very

big reason why so many can and do use computers. Without the GUI covering over the core

programming of a typical PC, you would still have a computer terminal however it would lose its

appeal rather quickly to all except most hardcore operators out there that prefer using command

lines interfaces over mice and touch screens.

Displays information in pictorial or text for

The function of a terminal is have an efficient area to input/output/configure/alter or edit data

whether that is a personal computer in a house or a host of computers networked to all function

in the same way. From what I understand the only criteria for a terminal to be labeled as such is

that it is interactive.

in addition to how the terminal function

Dumb terminals are just connected to a particular host via cables. They are mostly monochrome

and are CRT type display with key board. These were used when Time sharing was introduced in

Mainframes. They transmit and receive only text.


Smart terminals had some enhanced facilities like color monitors, pixel based displays, and some

function keys. These also usually had some memory.

Intelligent terminals had more functions. These are normally a small computer having memory

and OS. Your smart phone, laptop, PC desktop are also intelligent terminals.

A monitor usually comprises the visual display, circuitry, casing, and power supply. The display

device in modern monitors is typically a thin film transistor liquid crystal display (TFT-LCD)

with LED backlighting having replaced cold-cathode fluorescent lamp (CCFL) backlighting.

Previous monitors used a cathode ray tube (CRT) and some Plasma (also called Gas-Plasma)

displays. Monitors are connected to the computer via VGA, Digital Visual Interface (DVI),

HDMI, Display Port, USB-C, low-voltage differential signaling (LVDS) or other proprietary

connectors and signals.


Originally, computer monitors were used for data processing while television sets were used for

entertainment. From the 1980s onwards, computers (and their monitors) have been used for both

data processing and entertainment, while televisions have implemented some computer

functionality. The common aspect ratio of televisions, and computer monitors, has changed from

4:3 to 16:10, to 16:9.


Modern computer monitors are easily interchangeable with conventional television sets and vice

versa. However, as computer monitors do not necessarily include integrated speakers nor TV

tuners (such as digital television adapters), it may not be possible to use a computer monitor as a

TV set without external components

The performance of a monitor is measured by the following parameters:

DISPLAY GEOMETRY:

Viewable image size - is usually measured diagonally, but the actual widths and heights are more

informative since they are not affected by the aspect ratio in the same way. For CRTs, the

viewable size is typically 1 in (25 mm) smaller than the tube itself.

Aspect ratio - is the ratio of the horizontal length to the vertical length. Monitors usually have the

aspect ratio 4:3, 5:4, 16:10 or 16:9.

Radius of curvature (for curved monitors) - is the radius that a circle would have if it had the

same curvature as the display. This value is typically given in millimeters, but expressed with the

letter "R" instead of a unit (for example, a display with "3800R curvature" has a 3800 mm radius

of curvature.

Display resolution is the number of distinct pixels in each dimension that can be displayed. For a

given display size, maximum resolution is limited by dot pitch or DPI.

Dot pitch or pixel pitch represents the size of the primary elements of the display. In CRTs, dot

pitch is defined as the distance between sub-pixels of the same color. In LCDs it is the distance

between the centers of two adjacent pixels. Dot pitch is the reciprocal of pixel density.
Pixel density is a measure of how densely packed the pixels on a display are. In LCDs, pixel

density is the number of pixels in one linear unit along the display, typically measured in pixels

per inch (px/in or ppi).

Color characteristics:

Luminance - measured in candelas per square meter (cd/m2, also called a nit).

Contrast ratio is the ratio of the luminosity of the brightest color (white) to that of the darkest

color (black) that the monitor is capable of producing simultaneously. For example, a ratio of

20,000∶1 means that the brightest shade (white) is 20,000 times brighter than its darkest shade

(black). Dynamic contrast ratio is measured with the LCD backlight turned off.

Color depth - measured in bits per primary color or bits for all colors. Those with 10 bpc (bits per

channel) or more can display more shades of color (approximately 1 billion shades) than

traditional 8 bpc monitors (approximately 16.8 million shades or colors), and can do so more

precisely without having to resort to dithering.

Gamut - measured as coordinates in the CIE 1931 color space. The names sRGB or Adobe RGB

are shorthand notations.

Color accuracy - measured in ΔE (delta-E); the lower the ΔE, the more accurate the color

representation. A ΔE of below 1 is imperceptible to the human eye. A ΔE of 2–4 is considered

good and requires a sensitive eye to spot the difference.

Viewing angle is the maximum angle at which images on the monitor can be viewed, without

excessive degradation to the image. It is measured in degrees horizontally and vertically.

Input speed characteristics:


Refresh rate is (in CRTs) the number of times in a second that the display is illuminated (the

number of times a second a raster scan is completed). In LCDs it is the number of times the

image can be changed per second, expressed in hertz (Hz). Maximum refresh rate is limited by

response time. Determines the maximum number of frames per second (FPS) a monitor is

capable of showing.

Response time is the time a pixel in a monitor takes to change between two shades. The

particular shades depend on the test procedure, which differs between manufacturers. In general,

lower numbers mean faster transitions and therefore fewer visible image artifacts such as

ghosting.

Input latency is the time it takes for a monitor to display an image after receiving it, typically

measured in milliseconds (ms).

ASSIGNMENT2

I INPUT/OUTPUT MODUL STRUCTURE AND FUNCTION

I / O module is a hardware interface (interface) to the system bus or central switch and

controls one or more peripheral devices. The I / O module is not just a connecting module, but a

device that contains logic in performing the communication function between peripherals and the

computer bus.
There are several reasons why devices are not directly connected to the computer system bus,

namely:

The various methods of operating peripheral devices, so it is not practical if the computer system

must handle various kinds of peripheral device operating systems.

The data transfer rate of peripheral devices is generally slower than the data transfer rate on the

CPU or memory.

The data format and length of data on peripheral devices are often different from the CPU, so

modules need to be synchronized.

For some of the reasons above, the I / O module has two main functions, namely:

a. As an interface device to the CPU and memory through the system bus.

b. As an interface device with other peripheral equipment using certain data links.

How the I / O module can carry out its work, namely bridging the CPU and memory with the

outside world is the most important thing for us to know. The core of studying a computer’s I / O

system is knowing the function and structure of the I / O module. Take a look at Figure 1, which

presents the generic model of the module I / O.

Function of I / O Module

I / O module is a component in a computer system that is responsible for controlling an external

device or more and is also responsible for exchanging data between that external device with

main memory or with CPU registers. In realizing this, an internal interface with the computer
(CPU and main memory) is required and an interface with its external devices to carry out

control functions.

The function in carrying out the tasks for the I / O module can be divided into several categories,

namely:

• Control and timing.

• CPU communication.

• Communication of external devices.

• Data buffering.

• Error detection.

Control and timing functions (control & timing) are important to synchronize the work of each

computer component. At one time the CPU communicates with one or more devices with erratic

patterns and the speed of transfer of data communication varies, both with internal devices such

as registers, main memory, secondary memory, peripheral devices. The process can run if there

are control and timing functions that govern the system as a whole. Examples of controls for

transferring data from peripherals to the CPU via an I / O module can include the following

steps:

Request and check device status from CPU to I / O module.

The I / O module provides answers to CPU requests.

When an external device is ready for data transfer, the CPU will send commands to the I / O

module.
The I / O module will receive data packets of a certain length from the peripherals.

Then the data is sent to the CPU after synchronizing the data length and the transfer speed by the

I / O module so that the data packets can be received by the CPU properly.

Data transfer will not be separated from the use of the bus system, so the CPU and I / O module

interaction will involve the control and timing of a bus arbitration or more. The communication

function between the CPU and the I / O module includes the following processes:

Command Decoding, i / O module receives commands from the CPU that are sent as signals to

the control bus. For example, an I / O module for disks can receive commands: Read sector, Scan

record ID, Format disk.

Data, the exchange of data between the CPU and I / O modules via the data bus.

Status Reporting, i.e. reporting the status of I / O module status and peripheral devices, generally

in the form of Busy or Ready status. Also the status of wide – range fault condition (error).

Address Recognition, that the equipment or components making up a computer can be contacted

or called must have a unique address, as well as on peripheral devices, so that each I / O module

must know the address of the controlled peripheral.

On the side of the I / O module to the peripheral device there is also communication which

includes data communication, control

I. PROGRAMMED INPUT/OUTPUT

Programmable I/O is one of the I/O technique other than the interrupt-driven I/O and direct

memory access (DMA). The programmed I/O was the simplest type of I/O technique for the
exchanges of data or any types of communication between the processor and the external

devices. With programmed I/O, data are exchanged between the processor and the I/O module.

The processor executes a program that gives it direct control of the I/O operation, including

sensing device status, sending a read or write command, and transferring the data. When the

processor issues a command to the I/O module, it must wait until the I/O operation is complete.

If the processor is faster than the I/O module, this is wasteful of processor time. The overall

operation of the programmed I/O can be summaries as follow:

The processor is executing a program and encounters an instruction relating to I/O operation.

The processor then executes that instruction by issuing a command to the appropriate I/O

module.

The I/O module will perform the requested action based on the I/O command issued by the

processor (READ/WRITE) and set the appropriate bits in the I/O status register.

The processor will periodically check the status of the I/O module until it find that the operation

is complete.

In programmed I / O, data is exchanged between the CPU and I / O modules. The CPU executes

programs that provide CPU I / O operations directly, such as moving data, sending read and

write commands, and monitoring devices. The weakness of this technique is that the CPU will

wait until the I / O operation is complete, making the I / O module waste time, especially since

the CPU is operating faster. In this technique, the I / O module cannot interrupt the CPU of the

processes that are instructed on it. The entire process is the responsibility of the CPU until the

complete operation is carried out.


To carry out I / O commands, the CPU will issue an address for the I / O module and its

peripheral devices so that it is specifically specified and an I / O command to be performed.

There are four classifications of I / O commands, namely:

a. Control command.

This command is used to activate the peripheral device and notify the task that was ordered to

him.

b. Test command.

This command is used by the CPU to test various I / O module status conditions and peripherals.

The CPU needs to know the peripherals are active and ready to use, also to find out the I / O

operations that are performed and detect errors.

c. The read command.

The command in the I / O module is to take a data packet and then place it in the internal buffer.
The next process the data packet is sent via the data bus after data synchronization and transfer
speed occur.

d write the command

This command is the opposite of read. The CPU instructs the I / O module to retrieve data from
the data bus to be given to the peripheral device for which the data is intended.

In engineering I / O programmed, there are two kinds implements I / O command that is stated in
the instruction I / O, namely: memory-mapped I / O and isolated I / O .

II. INTERRUPT - DRIVEN INPUT/OUTPUT

This technique is used to overcome the limitation of programmed I/O.


In interrupt driven I/O, instead of making the processor to verify the status of I/O module. It is
the responsibility of I/O module to intimate the processor by interrupt signal.

CPU responds to interrupt signals and stores the return address from the program counter (PC)
into the memory stack and then the control branches to a interrupt service routine (ISR).

ISR processes the required I/O Transfer.

After completion of executing interrupt routine CPU returns to previous program and continue
what it was doing before.

Interrupt:

An interrupt or exception causes CPU to transfer the control temporarily from its current
program to another program i.e. interrupt handler.

Block Diagram for Interrupt Driven I/O

III. DIRECT MEMORY ACCESS(DMA)

The technique described earlier, programmed I / O and Interrupt-Driven I / O has a

weakness, namely the process that occurs in the I / O module still involves the CPU
directly. This has implications for:

· The I / O transfer rate depends on the CPU operating speed.

· CPU work is interrupted due to direct interruptions.

Starting from the weaknesses above, moreover to handle large-volume data transfer

developed a better technique, known as Direct Memory Access (DMA).

The working principle of DMA is that the CPU will delegate the work of I / O to the

DMA, the CPU will only be involved at the beginning of the process to give complete

instructions on the DMA and the end of the process. Thus the CPU can run other

processes without much interference with interruptions.

In carrying out data transfers independently, DMA requires the transfer of bus control

from the CPU. For this reason DMA will use the bus if the CPU does not use it or DMA

forces the CPU to temporarily stop using the bus. The last technique is more commonly

used, often called cycle stealing, because the DMA module takes over the bus cycle.

Temporarily stopping the use of the bus is not a form of interruption, but only a

temporary termination of the process that has implications only for CPU execution

delays

IV. Drawback of programmed and interrupt Driven i/o

Drawback of a programmed I/O: BUSY-WAIT LOOP


Due to the time needed to poll if I/O device is ready, the processor cannot often perform useful
computation
Instead of using a BUSY-WAIT LOOP, let I/O device alert the processor when it is ready
Hardware sends an interrupt-request signal
to the processor at the appropriate time, much like a phone call.
Meanwhile, processor performs useful tasks

Consider a task with extensive computation and periodic display of current results
Timer circuit can be used for desired interval, with interrupt-request signal to processor
Two software routines: COMPUTE & DISPLAY
Processor suspends COMPUTE execution to execute DISPLAY on interrupt, then returns

DISPLAY is an interrupt-service routine


Differs from subroutine because it is executed at any time due to interrupt, not due to Call
For example, assume interrupt signal asserted when processor is executing instruction i
Instruction completes, then PC saved to temporary location before executing DISPLAY
Return-from-interrupt instruction in DISPLAY
restores PC with address of instruction i + 1.

You might also like