You are on page 1of 15

System Programming

Course Code:MCS-241
BSCS- 7th Semester

Lecture No. 02
Topic: Input Output

Teacher:
Orain Malik
Punjab College Kotli
MSCS
Contents

 Method of Input Output


 Discussion of I/O Model
 Pseudo code
 Flow Chart
 Input Output Controller
 Description of I/O Controller
 Functionality of I/O Controller
 Types Of I/O Controller
Method of Input Output

Overview
The input–process–output (IPO) model is a
widely used approach in systems analysis and
software engineering for describing the structure
of an information processing program or another
process. Many introductory programming and
systems analysis texts introduce this as the most
basic structure for describing a process.
Discussion of I/O Model
A computer program or any other sort of process using the
input-process-output model receives inputs from a user or
other source, does some computations on the inputs, and
returns the results of the computations. 

The system divides the work into three


categories

A requirement from the environment (input)


A computation based on the requirement (process)
A provision for the environment (output)
Explanation
Example
A program might be written to convert Fahrenheit temperatures
into Celsius temperatures.

Following the IPO model, the program must:


Ask the user for the Fahrenheit temperature (input)

Perform a calculation to convert the Fahrenheit temperature into


the corresponding Celsius temperature (process)

Display the Celsius temperature (output)


Pseudo code

Function Main ... This program converts an input Fahrenheit


temperature to Celsius.
Declare Real fahrenheit
Declare Real celsius
Output "Enter Fahrenheit temperature:"
Input fahrenheit
Assign celsius = (fahrenheit - 32) * 5 / 9
Output fahrenheit & "° Fahrenheit is " & celsius & "° Celsius"
End
Output
Enter Fahrenheit temperature:
100
100° Fahrenheit is 37.7777777777778° Celsius
Flow Chart
Input Output Controller

I/O Controllers

An I/O controller connects input and output (I/O)


devices to the bus system of a central processing unit
(CPU). It typically communicates with the CPU and
with the system memory over the system bus and
can control many devices. Control is usually
initiated by the CPU, which sends instructions to the
I/O controller concerning how the peripheral devices
and signals attached to it should be handled.
Description of I/O Controller
I/O controllers have functionality specific to handling the demands of talking to and
controlling peripheral devices. These include the ability to drive the devices with the
correct voltage level and with the correct interface standard. It also includes the
ability to connect to the devices with the correct protocol. Communicating and
controlling peripherals can be a very critical time function. I/O interfacing can be so
complex that it is impractical or impossible for a CPU to implement. In many cases,
the CPU cannot provide for the special physical needs of the I/O interface. Offloading
this processing to an I/O controller improves CPU performance and flexibility.

Modern Devices
Many modern microprocessors and microcontrollers have I/O controller
functionality built into them to reduce cost and size. These are used in embedded and
special purpose applications (for example cell phones) where the I/O requirements are
fixed, or tend to have similar requirements that can be allowed for.
Functionality of I/O Controller
Input/output controllers receive input and output requests from the central
processor, and then send device-specific control signals to the device they
control. They also manage the data flow to and from the device. This frees the
central processor from involvement with the details of controlling each device.
I/O controllers are needed only for those I/O devices that are part of the system .

Often the I/O controllers are part of the electronics on the main circuit board
(the mother board) of the computer. Sometimes an uncommon device requires its
own controller which must be plugged into a connector (an expansion slot) on
the mother board.

I/O controllers are sometimes called device controllers. The software that


directly interacts with a device controller is called a device driver. When you
install a new device on your computer (say, a new graphics board) you must also
install a device driver for it.
Types Of I/O Controller
Overview
Computer usefulness ultimately depends on its Input/output (I/O) capabilities  I/O are
computing facilities to provide user input/output, data storage and retrieval, and network
access capabilities in the computer system. I/O requires specialized hardware and
software facilities
       There are 4 types of I/O devices:
Input                                                e.g. keyboard
       Output                                            e.g. screen
       Both input and output  e.g. network
       Storage                                           e.g. disk (since it is performed as I/O
operation)
      
  One of the most important characteristics of an I/O device is its data rate
    Amount of data that can be transferred from/to the I/O device in a period of
time Data rate is typically measured as bytes or bits per second
         I/O devices varies in their data rates and their data traffic types
Types Of I/O Controller
Keyboard

 Keyboard is character-based input device capable of inputting


alphanumeric data
 Keyboard input is decoded internally in the form of Unicode, ASCII
or EBCDIC codes
   In multi-user systems many keyboards can be connected to the
computer system
   Input from keyboard is extremely slow (i.e. 100 of characters per
second)
    
   Traffic volume of the keyboard is very low due mainly to:
     
User typing speed
       User thought processing speed
Types Of I/O Controller

CRT Screen and Printer


 Screen and printers can be either text or graphic based
output devices  
  Screens and printers operates over a wide range of data
rates  
 Text-base printers and screens do not require high data rate
(i.e. data volume is low)
 Graphic output in recent screens and printers models
requires high data rates (i.e. data volume is high)
 Screens with video output requires even much higher data
rate (i.e. 10’s of MBs per second)
Types Of I/O Controller

Disk
      Disk is a storage device
       
  Disk storage and retrieval (i.e. read and write) is
performed as I/O
   Disk is considered as both input as well as output
device
       Disk is used to store files of data and programs with
variable sizes
  Disk data input or output requires very high data
rate (few MBs per second)
.

THE END

You might also like