<s>
Run-length	B-Protocol
limited	I-Protocol
or	O
RLL	B-Protocol
coding	I-Protocol
is	O
a	O
line	B-Protocol
coding	I-Protocol
technique	O
that	O
is	O
used	O
to	O
send	O
arbitrary	O
data	O
over	O
a	O
communications	O
channel	O
with	O
bandwidth	B-Algorithm
limits	O
.	O
</s>
<s>
RLL	B-Protocol
codes	I-Protocol
are	O
defined	O
by	O
four	O
main	O
parameters	O
:	O
m	O
,	O
n	O
,	O
d	O
,	O
k	O
.	O
The	O
first	O
two	O
,	O
m/n	O
,	O
refer	O
to	O
the	O
rate	O
of	O
the	O
code	O
,	O
while	O
the	O
remaining	O
two	O
specify	O
the	O
minimal	O
d	O
and	O
maximal	O
k	O
number	O
of	O
zeroes	O
between	O
consecutive	O
ones	O
.	O
</s>
<s>
Specifically	O
,	O
RLL	B-Protocol
bounds	O
the	O
length	O
of	O
stretches	O
(	O
runs	O
)	O
of	O
repeated	O
bits	O
during	O
which	O
the	O
signal	O
does	O
not	O
change	O
.	O
</s>
<s>
By	O
modulating	B-Application
the	O
data	O
,	O
RLL	B-Protocol
reduces	O
the	O
timing	O
uncertainty	O
in	O
decoding	O
the	O
stored	O
data	O
,	O
which	O
would	O
lead	O
to	O
the	O
possible	O
erroneous	O
insertion	O
or	O
removal	O
of	O
bits	O
when	O
reading	O
the	O
data	O
back	O
.	O
</s>
<s>
This	O
mechanism	O
ensures	O
that	O
the	O
boundaries	O
between	O
bits	O
can	O
always	O
be	O
accurately	O
found	O
(	O
preventing	O
bit	B-General_Concept
slip	I-General_Concept
)	O
,	O
while	O
efficiently	O
using	O
the	O
media	O
to	O
reliably	O
store	O
the	O
maximal	O
amount	O
of	O
data	O
in	O
a	O
given	O
space	O
.	O
</s>
<s>
Early	O
disk	O
drives	O
used	O
very	O
simple	O
encoding	B-Protocol
schemes	I-Protocol
,	O
such	O
as	O
RLL	B-Protocol
(	O
0	O
,	O
1	O
)	O
FM	B-Protocol
code	O
,	O
followed	O
by	O
RLL	B-Protocol
(	O
1	O
,	O
3	O
)	O
MFM	B-Protocol
code	O
,	O
which	O
were	O
widely	O
used	O
in	O
hard	B-Device
disk	I-Device
drives	I-Device
until	O
the	O
mid-1980s	O
and	O
are	O
still	O
used	O
in	O
digital	O
optical	O
discs	O
such	O
as	O
CD	B-Device
,	O
DVD	O
,	O
MD	O
,	O
Hi-MD	O
and	O
Blu-ray	O
.	O
</s>
<s>
Higher-density	O
RLL	B-Protocol
(	O
2	O
,	O
7	O
)	O
and	O
RLL	B-Protocol
(	O
1	O
,	O
7	O
)	O
codes	O
became	O
the	O
defacto	O
industry	O
standard	O
for	O
hard	B-Device
disks	I-Device
by	O
the	O
early	O
1990s	O
.	O
</s>
<s>
On	O
a	O
hard	B-Device
disk	I-Device
drive	I-Device
,	O
information	O
is	O
represented	O
by	O
changes	O
in	O
the	O
direction	O
of	O
the	O
magnetic	O
field	O
on	O
the	O
disk	O
,	O
and	O
on	O
magnetic	O
media	O
,	O
the	O
playback	O
output	O
is	O
proportional	O
to	O
the	O
density	O
of	O
flux	O
transition	O
.	O
</s>
<s>
(	O
Note	O
:	O
older	O
hard	B-Device
disks	I-Device
used	O
one	O
fixed	O
length	O
of	O
time	O
as	O
the	O
data	O
window	O
over	O
the	O
whole	O
disk	O
,	O
but	O
modern	O
disks	O
are	O
more	O
complicated	O
;	O
for	O
more	O
on	O
this	O
,	O
see	O
zoned	B-Architecture
bit	I-Architecture
recording	I-Architecture
.	O
)	O
</s>
<s>
By	O
limiting	O
the	O
number	O
of	O
zeros	O
written	O
consecutively	O
to	O
some	O
maximum	O
k	O
,	O
this	O
makes	O
it	O
possible	O
for	O
the	O
drive	B-General_Concept
controller	I-General_Concept
to	O
stay	O
synchronized	O
.	O
</s>
<s>
All	O
codes	O
used	O
to	O
record	O
on	O
magnetic	O
disks	O
have	O
limited	O
the	O
length	O
of	O
transition-free	O
runs	O
and	O
can	O
therefore	O
be	O
characterized	O
as	O
RLL	B-Protocol
codes	I-Protocol
.	O
</s>
<s>
The	O
earliest	O
and	O
simplest	O
variants	O
were	O
given	O
specific	O
names	O
,	O
such	O
as	O
modified	B-Protocol
frequency	I-Protocol
modulation	I-Protocol
(	O
MFM	B-Protocol
)	O
,	O
and	O
the	O
name	O
"	O
RLL	B-Protocol
"	O
is	O
commonly	O
used	O
only	O
for	O
the	O
more	O
complex	O
variants	O
not	O
given	O
such	O
specific	O
names	O
,	O
but	O
the	O
term	O
technically	O
applies	O
to	O
them	O
all	O
.	O
</s>
<s>
The	O
first	O
"	O
RLL	B-Protocol
"	O
code	O
used	O
in	O
hard	B-Device
drives	I-Device
was	O
RLL	B-Protocol
(	O
2	O
,	O
7	O
)	O
,	O
developed	O
by	O
IBM	O
engineers	O
and	O
first	O
used	O
commercially	O
in	O
1979	O
on	O
the	O
IBM	O
3370	O
DASD	B-Application
,	O
for	O
use	O
with	O
the	O
4300	O
series	O
mainframe	B-Architecture
.	O
</s>
<s>
During	O
the	O
late	O
1980s	O
,	O
PC	B-Device
hard	I-Device
disks	I-Device
began	O
using	O
RLL	B-Protocol
proper	O
(	O
i.e.	O
</s>
<s>
variants	O
more	O
complex	O
than	O
those	O
that	O
had	O
received	O
their	O
own	O
proper	O
names	O
,	O
such	O
as	O
MFM	B-Protocol
)	O
.	O
</s>
<s>
RLL	B-Protocol
codes	I-Protocol
have	O
found	O
almost	O
universal	O
application	O
in	O
optical-disc	O
recording	O
practice	O
since	O
1980	O
.	O
</s>
<s>
In	O
consumer	O
electronics	O
,	O
RLLs	B-Protocol
like	O
the	O
EFM	B-Protocol
code	I-Protocol
(	O
rate	O
=	O
8/17	O
,	O
d	O
=	O
2	O
,	O
k	O
=	O
10	O
)	O
are	O
employed	O
in	O
the	O
Compact	O
Disc	O
(	O
CD	B-Device
)	O
and	O
MiniDisc	O
(	O
MD	O
)	O
,	O
and	O
the	O
EFMPlus	B-Protocol
code	O
(	O
rate	O
=	O
8/16	O
,	O
d	O
=	O
2	O
,	O
k	O
=	O
10	O
)	O
used	O
in	O
the	O
DVD	O
.	O
</s>
<s>
Parameters	O
d	O
and	O
k	O
are	O
the	O
minimal	O
and	O
maximal	O
allowed	O
run	B-Algorithm
lengths	I-Algorithm
.	O
</s>
<s>
Generally	O
run	B-Algorithm
length	I-Algorithm
is	O
the	O
number	O
of	O
bits	O
for	O
which	O
signal	O
remains	O
unchanged	O
.	O
</s>
<s>
A	O
run	B-Algorithm
length	I-Algorithm
of	O
3	O
for	O
bit	O
1	O
,	O
represents	O
a	O
sequence	O
111	O
.	O
</s>
<s>
However	O
,	O
run-length	B-Protocol
limited	I-Protocol
coding	I-Protocol
terminology	O
assumes	O
NRZI	O
encoding	O
,	O
so	O
1	O
bits	O
indicate	O
changes	O
and	O
0	O
bits	O
indicate	O
the	O
absence	O
of	O
change	O
,	O
the	O
above	O
sequence	O
would	O
be	O
expressed	O
as	O
11000101001000001	O
,	O
and	O
only	O
runs	O
of	O
zero	O
bits	O
are	O
counted	O
.	O
</s>
<s>
Somewhat	O
confusingly	O
,	O
the	O
run	B-Algorithm
length	I-Algorithm
is	O
the	O
number	O
of	O
zeros	O
(	O
0	O
,	O
3	O
,	O
1	O
,	O
2	O
and	O
5	O
in	O
the	O
preceding	O
)	O
between	O
adjacent	O
ones	O
,	O
which	O
is	O
one	O
less	O
than	O
the	O
number	O
of	O
bit	O
times	O
the	O
signal	O
actually	O
remains	O
unchanged	O
.	O
</s>
<s>
Run-length	B-Protocol
limited	I-Protocol
sequences	O
are	O
characterized	O
by	O
two	O
parameters	O
,	O
d	O
and	O
k	O
,	O
which	O
stipulate	O
the	O
minimal	O
and	O
maximal	O
zero-bit	O
run	B-Algorithm
length	I-Algorithm
that	O
can	O
occur	O
in	O
the	O
sequence	O
.	O
</s>
<s>
So	O
RLL	B-Protocol
codes	I-Protocol
are	O
generally	O
specified	O
as	O
(	O
d	O
,	O
k	O
)	O
RLL	B-Protocol
,	O
e.g.	O
</s>
<s>
:	O
(	O
1	O
,	O
3	O
)	O
RLL	B-Protocol
.	O
</s>
<s>
Generally	O
,	O
the	O
term	O
"	O
RLL	B-Protocol
code	I-Protocol
"	O
is	O
used	O
to	O
refer	O
to	O
more	O
elaborate	O
encodings	O
,	O
but	O
the	O
original	O
Frequency	O
Modulation	B-Application
code	O
,	O
also	O
called	O
differential	B-Protocol
Manchester	I-Protocol
encoding	I-Protocol
,	O
can	O
be	O
seen	O
as	O
a	O
simple	O
rate-1/2	O
RLL	B-Protocol
code	I-Protocol
.	O
</s>
<s>
By	O
extending	O
the	O
maximal	O
run	B-Algorithm
length	I-Algorithm
to	O
2	O
adjacent	O
0	O
bits	O
,	O
the	O
data	O
rate	O
can	O
be	O
improved	O
to	O
4/5	O
.	O
</s>
<s>
Note	O
that	O
to	O
meet	O
the	O
definition	O
of	O
(	O
0	O
,	O
2	O
)	O
RLL	B-Protocol
,	O
it	O
is	O
not	O
sufficient	O
only	O
that	O
each	O
5-bit	O
code	O
contain	O
no	O
more	O
than	O
two	O
consecutive	O
zeros	O
,	O
but	O
it	O
is	O
also	O
necessary	O
that	O
any	O
pair	O
of	O
5-bit	O
codes	O
as	O
a	O
combined	O
sequentially	O
not	O
contain	O
more	O
than	O
two	O
consecutive	O
zeros	O
.	O
</s>
<s>
This	O
is	O
required	O
because	O
for	O
any	O
RLL	B-Protocol
code	I-Protocol
,	O
the	O
run-length	B-Algorithm
limits	O
0	O
and	O
2	O
in	O
this	O
case	O
apply	O
to	O
the	O
overall	O
modulated	B-Application
bitstream	O
,	O
not	O
just	O
to	O
the	O
components	O
of	O
it	O
that	O
represent	O
discrete	O
sequences	O
of	O
plain	O
data	O
bits	O
.	O
</s>
<s>
The	O
IBM	O
GCR	O
code	O
above	O
meets	O
this	O
condition	O
,	O
since	O
the	O
maximal	O
run	B-Algorithm
length	I-Algorithm
of	O
zeros	O
at	O
the	O
beginning	O
of	O
any	O
5-bit	O
code	O
is	O
one	O
,	O
and	O
likewise	O
the	O
maximal	O
run	B-Algorithm
length	I-Algorithm
at	O
the	O
end	O
of	O
any	O
code	O
is	O
one	O
,	O
making	O
a	O
total	O
run	B-Algorithm
length	I-Algorithm
of	O
two	O
at	O
the	O
junction	O
between	O
adjacent	O
codes	O
.	O
</s>
<s>
(	O
An	O
example	O
of	O
the	O
maximal	O
run	B-Algorithm
length	I-Algorithm
occurring	O
between	O
codes	O
can	O
be	O
seen	O
in	O
the	O
example	O
given	O
above	O
,	O
where	O
the	O
code	O
for	O
the	O
data	O
"	O
0010	O
"	O
ends	O
with	O
a	O
zero	O
and	O
the	O
code	O
for	O
the	O
next	O
data	O
,	O
"	O
1101	O
"	O
,	O
begins	O
with	O
a	O
zero	O
,	O
forming	O
a	O
run	O
of	O
two	O
zeros	O
at	O
the	O
junction	O
of	O
these	O
two	O
5-bit	O
codes	O
.	O
)	O
</s>
<s>
Modified	B-Protocol
frequency	I-Protocol
modulation	I-Protocol
begins	O
to	O
get	O
interesting	O
,	O
because	O
its	O
special	O
properties	O
allow	O
its	O
bits	O
to	O
be	O
written	O
to	O
a	O
magnetic	O
medium	O
with	O
twice	O
the	O
density	O
of	O
an	O
arbitrary	O
bit	O
stream	O
.	O
</s>
<s>
The	O
encoding	O
is	O
very	O
similar	O
to	O
the	O
FM	B-Protocol
encoding	O
.	O
</s>
<s>
Except	O
for	O
the	O
clock	O
bits	O
not	O
always	O
being	O
one	O
,	O
this	O
is	O
the	O
same	O
as	O
the	O
FM	B-Protocol
table	O
,	O
and	O
that	O
is	O
how	O
this	O
code	O
gets	O
its	O
name	O
.	O
</s>
<s>
(	O
1	O
,	O
7	O
)	O
RLL	B-Protocol
maps	O
2	O
bits	O
of	O
data	O
onto	O
3	O
bits	O
on	O
the	O
disk	O
,	O
and	O
the	O
encoding	O
is	O
done	O
in	O
2	O
-	O
or	O
4-bit	O
groups	O
.	O
</s>
<s>
(	O
2	O
,	O
7	O
)	O
RLL	B-Protocol
is	O
rate	O
-	O
code	O
,	O
mapping	O
n	O
bits	O
of	O
data	O
onto	O
2n	O
bits	O
on	O
the	O
disk	O
,	O
like	O
MFM	B-Protocol
,	O
but	O
because	O
the	O
minimal	O
run	B-Algorithm
length	I-Algorithm
is	O
50%	O
longer	O
(	O
3	O
bit	O
times	O
instead	O
of	O
2	O
)	O
,	O
the	O
bits	O
can	O
be	O
written	O
faster	O
,	O
achieving	O
50%	O
higher	O
effective	O
data	O
density	O
.	O
</s>
<s>
The	O
encoded	O
forms	O
begin	O
with	O
at	O
most	O
4	O
,	O
and	O
end	O
with	O
at	O
most	O
3	O
zero	O
bits	O
,	O
giving	O
the	O
maximal	O
run	B-Algorithm
length	I-Algorithm
of	O
7	O
.	O
</s>
<s>
The	O
HHH(1,13 )	O
code	O
is	O
a	O
rate-2/3	O
code	O
developed	O
by	O
three	O
IBM	O
researchers	O
(	O
Hirt	O
,	O
Hassner	O
,	O
and	O
Heise	O
)	O
for	O
use	O
in	O
the	O
16MB/s	O
IrDA	O
VFIR	O
physical	B-Application
layer	I-Application
.	O
</s>
<s>
In	O
particular	O
,	O
it	O
is	O
a	O
(	O
1	O
,	O
13|5	O
)	O
RLL	B-Protocol
code	I-Protocol
,	O
where	O
the	O
final	O
5	O
indicates	O
the	O
additional	O
constraint	O
that	O
there	O
are	O
at	O
most	O
5	O
consecutive	O
"	O
10	O
"	O
bit	O
pairs	O
.	O
</s>
<s>
A	O
modified	B-Protocol
frequency	I-Protocol
modulation	I-Protocol
,	O
or	O
(	O
1	O
,	O
3	O
)	O
RLL	B-Protocol
encoding	I-Protocol
,	O
stores	O
each	O
data	O
bit	O
as	O
two	O
bits	O
on	O
tape	O
,	O
but	O
since	O
there	O
is	O
guaranteed	O
to	O
be	O
one	O
0	O
(	O
no	O
flux	O
reversal	O
)	O
bit	O
between	O
any	O
1	O
(	O
flux	O
reversal	O
)	O
bits	O
,	O
then	O
it	O
is	O
possible	O
to	O
store	O
6400	O
encoded	O
bits	O
per	O
inch	O
on	O
the	O
tape	O
,	O
or	O
3200	O
data	O
bits	O
per	O
inch	O
.	O
</s>
<s>
A	O
(	O
1	O
,	O
7	O
)	O
RLL	B-Protocol
encoding	I-Protocol
can	O
also	O
store	O
6400	O
encoded	O
bits	O
per	O
inch	O
on	O
the	O
tape	O
,	O
but	O
since	O
it	O
only	O
takes	O
3	O
encoded	O
bits	O
to	O
store	O
2	O
data	O
bits	O
,	O
this	O
is	O
4267	O
data	O
bits	O
per	O
inch	O
.	O
</s>
<s>
A	O
(	O
2	O
,	O
7	O
)	O
RLL	B-Protocol
encoding	I-Protocol
takes	O
2	O
encoded	O
bits	O
to	O
store	O
each	O
data	O
bit	O
,	O
but	O
since	O
there	O
is	O
guaranteed	O
to	O
be	O
two	O
0	O
bits	O
between	O
any	O
1	O
bits	O
,	O
then	O
it	O
is	O
possible	O
to	O
store	O
9600	O
encoded	O
bits	O
per	O
inch	O
on	O
the	O
tape	O
,	O
or	O
4800	O
data	O
bits	O
per	O
inch	O
.	O
</s>
<s>
The	O
flux-reversal	O
densities	O
on	O
hard	B-Device
drives	I-Device
are	O
significantly	O
greater	O
,	O
but	O
the	O
same	O
improvements	O
in	O
storage	O
density	O
are	O
seen	O
by	O
using	O
different	O
encoding	O
systems	O
.	O
</s>
