<s>
In	O
computing	O
,	O
input/output	B-General_Concept
(	O
I/O	B-General_Concept
,	O
i/o	B-General_Concept
,	O
or	O
informally	O
io	O
or	O
IO	O
)	O
is	O
the	O
communication	O
between	O
an	O
information	O
processing	O
system	O
,	O
such	O
as	O
a	O
computer	O
,	O
and	O
the	O
outside	O
world	O
,	O
possibly	O
a	O
human	O
or	O
another	O
information	O
processing	O
system	O
.	O
</s>
<s>
Inputs	O
are	O
the	O
signals	O
or	O
data	B-General_Concept
received	O
by	O
the	O
system	O
and	O
outputs	O
are	O
the	O
signals	O
or	O
data	B-General_Concept
sent	O
from	O
it	O
.	O
</s>
<s>
The	O
term	O
can	O
also	O
be	O
used	O
as	O
part	O
of	O
an	O
action	O
;	O
to	O
"	O
perform	O
I/O	B-General_Concept
"	O
is	O
to	O
perform	O
an	O
input	B-General_Concept
or	I-General_Concept
output	I-General_Concept
operation	I-General_Concept
.	O
</s>
<s>
are	O
the	O
pieces	O
of	O
hardware	B-Architecture
used	O
by	O
a	O
human	O
(	O
or	O
other	O
system	O
)	O
to	O
communicate	O
with	O
a	O
computer	O
.	O
</s>
<s>
For	O
instance	O
,	O
a	O
keyboard	B-Device
or	O
computer	B-Device
mouse	I-Device
is	O
an	O
input	B-Device
device	I-Device
for	O
a	O
computer	O
,	O
while	O
monitors	O
and	O
printers	O
are	O
output	B-Device
devices	I-Device
.	O
</s>
<s>
Devices	O
for	O
communication	O
between	O
computers	O
,	O
such	O
as	O
modems	B-Application
and	O
network	B-Protocol
cards	I-Protocol
,	O
typically	O
perform	O
both	O
input	B-General_Concept
and	I-General_Concept
output	I-General_Concept
operations	O
.	O
</s>
<s>
Any	O
interaction	O
with	O
the	O
system	O
by	O
an	O
interactor	O
is	O
an	O
input	B-General_Concept
and	O
the	O
reaction	O
the	O
system	O
responds	O
is	O
called	O
the	O
output	O
.	O
</s>
<s>
The	O
designation	O
of	O
a	O
device	O
as	O
either	O
input	B-General_Concept
or	O
output	O
depends	O
on	O
perspective	O
.	O
</s>
<s>
Mice	O
and	O
keyboards	B-Device
take	O
physical	O
movements	O
that	O
the	O
human	O
user	O
outputs	O
and	O
convert	O
them	O
into	O
input	B-General_Concept
signals	O
that	O
a	O
computer	O
can	O
understand	O
;	O
the	O
output	O
from	O
these	O
devices	O
is	O
the	O
computer	O
's	O
input	B-General_Concept
.	O
</s>
<s>
Similarly	O
,	O
printers	O
and	O
monitors	O
take	O
signals	O
that	O
computers	O
output	O
as	O
input	B-General_Concept
,	O
and	O
they	O
convert	O
these	O
signals	O
into	O
a	O
representation	O
that	O
human	O
users	O
can	O
understand	O
.	O
</s>
<s>
A	O
further	O
complication	O
is	O
that	O
a	O
device	O
traditionally	O
considered	O
an	O
input	B-Device
device	I-Device
,	O
e.g.	O
,	O
card	O
reader	O
,	O
keyboard	B-Device
,	O
may	O
accept	O
control	O
commands	O
to	O
,	O
e.g.	O
,	O
select	O
stacker	O
,	O
display	O
keyboard	B-Device
lights	O
,	O
while	O
a	O
device	O
traditionally	O
considered	O
as	O
an	O
output	B-Device
device	I-Device
may	O
provide	O
status	O
data	B-General_Concept
,	O
e.g.	O
,	O
low	O
toner	O
,	O
out	O
of	O
paper	O
,	O
paper	O
jam	O
.	O
</s>
<s>
In	O
computer	O
architecture	O
,	O
the	O
combination	O
of	O
the	O
CPU	B-General_Concept
and	O
main	O
memory	O
,	O
to	O
which	O
the	O
CPU	B-General_Concept
can	O
read	O
or	O
write	O
directly	O
using	O
individual	O
instructions	O
,	O
is	O
considered	O
the	O
brain	O
of	O
a	O
computer	O
.	O
</s>
<s>
Any	O
transfer	O
of	O
information	O
to	O
or	O
from	O
the	O
CPU/memory	O
combo	O
,	O
for	O
example	O
by	O
reading	O
data	B-General_Concept
from	O
a	O
disk	B-Device
drive	I-Device
,	O
is	O
considered	O
I/O	B-General_Concept
.	O
</s>
<s>
The	O
CPU	B-General_Concept
and	O
its	O
supporting	O
circuitry	O
may	O
provide	O
memory-mapped	B-Architecture
I/O	I-Architecture
that	O
is	O
used	O
in	O
low-level	O
computer	B-General_Concept
programming	I-General_Concept
,	O
such	O
as	O
in	O
the	O
implementation	O
of	O
device	B-Application
drivers	I-Application
,	O
or	O
may	O
provide	O
access	O
to	O
I/O	B-Device
channels	I-Device
.	O
</s>
<s>
An	O
I/O	B-Application
algorithm	I-Application
is	O
one	O
designed	O
to	O
exploit	O
locality	O
and	O
perform	O
efficiently	O
when	O
exchanging	O
data	B-General_Concept
with	O
a	O
secondary	O
storage	O
device	O
,	O
such	O
as	O
a	O
disk	B-Device
drive	I-Device
.	O
</s>
<s>
An	O
I/O	B-General_Concept
interface	I-General_Concept
is	O
required	O
whenever	O
the	O
I/O	B-General_Concept
device	I-General_Concept
is	O
driven	O
by	O
a	O
processor	O
.	O
</s>
<s>
Typically	O
a	O
CPU	B-General_Concept
communicates	O
with	O
devices	O
via	O
a	O
bus	B-General_Concept
.	O
</s>
<s>
Handshaking	B-Protocol
should	O
be	O
implemented	O
by	O
the	O
interface	O
using	O
appropriate	O
commands	O
(	O
like	O
BUSY	O
,	O
READY	O
,	O
and	O
WAIT	O
)	O
,	O
and	O
the	O
processor	O
can	O
communicate	O
with	O
an	O
I/O	B-General_Concept
device	I-General_Concept
through	O
the	O
interface	O
.	O
</s>
<s>
If	O
different	O
data	B-General_Concept
formats	O
are	O
being	O
exchanged	O
,	O
the	O
interface	O
must	O
be	O
able	O
to	O
convert	O
serial	O
data	B-General_Concept
to	O
parallel	O
form	O
and	O
vice	O
versa	O
.	O
</s>
<s>
Because	O
it	O
would	O
be	O
a	O
waste	O
for	O
a	O
processor	O
to	O
be	O
idle	O
while	O
it	O
waits	O
for	O
data	B-General_Concept
from	O
an	O
input	B-Device
device	I-Device
there	O
must	O
be	O
provision	O
for	O
generating	O
interrupts	B-Application
and	O
the	O
corresponding	O
type	O
numbers	O
for	O
further	O
processing	O
by	O
the	O
processor	O
if	O
required	O
.	O
</s>
<s>
A	O
computer	O
that	O
uses	O
memory-mapped	B-Architecture
I/O	I-Architecture
accesses	O
hardware	B-Architecture
by	O
reading	O
and	O
writing	O
to	O
specific	O
memory	O
locations	O
,	O
using	O
the	O
same	O
assembly	O
language	O
instructions	O
that	O
computer	O
would	O
normally	O
use	O
to	O
access	O
memory	O
.	O
</s>
<s>
An	O
alternative	O
method	O
is	O
via	O
instruction-based	O
I/O	B-General_Concept
which	O
requires	O
that	O
a	O
CPU	B-General_Concept
have	O
specialized	O
instructions	O
for	O
I/O	B-General_Concept
.	O
</s>
<s>
Both	O
input	B-General_Concept
and	I-General_Concept
output	I-General_Concept
devices	O
have	O
a	O
data	B-General_Concept
processing	I-General_Concept
rate	O
that	O
can	O
vary	O
greatly	O
.	O
</s>
<s>
With	O
some	O
devices	O
able	O
to	O
exchange	O
data	B-General_Concept
at	O
very	O
high	O
speeds	O
direct	B-General_Concept
access	I-General_Concept
to	O
memory	O
(	O
DMA	O
)	O
without	O
the	O
continuous	O
aid	O
of	O
a	O
CPU	B-General_Concept
is	O
required	O
.	O
</s>
<s>
Higher-level	O
operating	B-General_Concept
system	I-General_Concept
and	O
programming	O
facilities	O
employ	O
separate	O
,	O
more	O
abstract	O
I/O	B-General_Concept
concepts	O
and	O
primitives	O
.	O
</s>
<s>
For	O
example	O
,	O
most	O
operating	B-General_Concept
systems	I-General_Concept
provide	O
application	O
programs	O
with	O
the	O
concept	O
of	O
files	O
.	O
</s>
<s>
The	O
C	B-Language
and	O
C++	B-Language
programming	I-Language
languages	I-Language
,	O
and	O
operating	B-General_Concept
systems	I-General_Concept
in	O
the	O
Unix	B-Application
family	O
,	O
traditionally	O
abstract	O
files	O
and	O
devices	O
as	O
streams	B-Architecture
,	O
which	O
can	O
be	O
read	O
or	O
written	O
,	O
or	O
sometimes	O
both	O
.	O
</s>
<s>
The	B-Language
C	I-Language
standard	I-Language
library	I-Language
provides	O
functions	B-Language
for	I-Language
manipulating	I-Language
streams	I-Language
for	O
input	B-General_Concept
and	I-General_Concept
output	I-General_Concept
.	O
</s>
<s>
In	O
the	O
context	O
of	O
the	O
ALGOL	B-Language
68	I-Language
programming	I-Language
language	I-Language
,	O
the	O
input	B-General_Concept
and	I-General_Concept
output	I-General_Concept
facilities	O
are	O
collectively	O
referred	O
to	O
as	O
transput	B-General_Concept
.	O
</s>
<s>
The	O
ALGOL	B-Language
68	I-Language
transput	B-General_Concept
library	O
recognizes	O
the	O
following	O
standard	O
files/devices	O
:	O
stand	O
in	O
,	O
stand	O
out	O
,	O
stand	O
errors	O
and	O
stand	O
back	O
.	O
</s>
<s>
An	O
alternative	O
to	O
special	O
primitive	O
functions	O
is	O
the	O
I/O	B-General_Concept
monad	O
,	O
which	O
permits	O
programs	O
to	O
just	O
describe	O
I/O	B-General_Concept
,	O
and	O
the	O
actions	O
are	O
carried	O
out	O
outside	O
the	O
program	O
.	O
</s>
<s>
This	O
is	O
notable	O
because	O
the	O
functions	O
would	O
introduce	O
side-effects	O
to	O
any	O
programming	O
language	O
,	O
but	O
this	O
allows	O
purely	B-Application
functional	I-Application
programming	I-Application
to	O
be	O
practical	O
.	O
</s>
<s>
Channel	B-Device
I/O	I-Device
requires	O
the	O
use	O
of	O
instructions	O
that	O
are	O
specifically	O
designed	O
to	O
perform	O
I/O	B-General_Concept
operations	I-General_Concept
.	O
</s>
<s>
The	O
I/O	B-General_Concept
instructions	O
address	O
the	O
channel	O
or	O
the	O
channel	O
and	O
device	O
;	O
the	O
channel	O
asynchronously	O
accesses	O
all	O
other	O
required	O
addressing	O
and	O
control	O
information	O
.	O
</s>
<s>
Port-mapped	B-Architecture
I/O	I-Architecture
also	O
requires	O
the	O
use	O
of	O
special	O
I/O	B-General_Concept
instructions	O
.	O
</s>
<s>
Direct	B-General_Concept
memory	I-General_Concept
access	I-General_Concept
(	O
DMA	O
)	O
is	O
a	O
means	O
for	O
devices	O
to	O
transfer	O
large	O
chunks	O
of	O
data	B-General_Concept
to	O
and	O
from	O
memory	O
independently	O
of	O
the	O
CPU	B-General_Concept
.	O
</s>
