Professional Documents
Culture Documents
Assignment On
Assignment On
Assignment On
MICROPROCESSOR APPLICATION
(EEE 438)
SUBMITTED BY
(ET20190102766)
SUBMITTED TO
Application management. An operating system handles the launch and management of every
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
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
It handles input/output (I/O) to and from attached hardware devices, such as hard disks, printers
It can offload the management of batch jobs – for example, printing – so that the initiating
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
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
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
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
In batch processing system input data is In online processing system data is prepared
In batch processing system the processing In online processing system the processing
In batch processing system recovery and In online processing system recovery and
QUESTION 3
MULTIPROGRAMMING
A multiprogramming operating system is one which can run multiple programs(or processes)
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
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)
namely the process that occurs in the I / O module still involves the CPU directly. This has
implications for:
Starting from the weaknesses above, moreover to handle large-volume data transfer developed a
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
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.
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
program known as an assembler. Assemblers were eventually augmented with elaborate “macro
sequences of instructions.
QUESTION 5
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
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
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
QUESTION6
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
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
An interpreter may require processing the same syntax tree more than once that is the reason why
which a compiler generates intermediate-level code then the code is interpreted rather than
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
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
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
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
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
Code generator: This is the final phase of the compiler in which target code for a particular
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
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
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
The compiler is used in programming languages like C, C++, C#, Scala, etc. On the other
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
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.
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
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
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
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
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
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
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
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
Gamut - measured as coordinates in the CIE 1931 color space. The names sRGB or Adobe RGB
Color accuracy - measured in ΔE (delta-E); the lower the ΔE, the more accurate the color
Viewing angle is the maximum angle at which images on the monitor can be viewed, without
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
ASSIGNMENT2
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
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
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
Function of I / O Module
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:
• CPU communication.
• 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:
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
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
On the side of the I / O module to the peripheral device there is also communication which
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
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
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
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.
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 .
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).
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.
weakness, namely the process that occurs in the I / O module still involves the CPU
directly. This has implications for:
Starting from the weaknesses above, moreover to handle large-volume data transfer
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
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
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