Rochester Institute of Technology
RIT Scholar Works
Theses
Thesis/Dissertation Collections
6-1-1984
A Microprocessor based hybrid system for digital
error correction
Peter H. Sohn
Follow this and additional works at:
http://scholarworks.rit.edu/theses
This Thesis is brought to you for free and open access by the Thesis/Dissertation Collections at RIT Scholar Works. It has been accepted for inclusion
in Theses by an authorized administrator of RIT Scholar Works. For more information, please contact
Recommended Citation
A MICROPROCESSOR BASED HYBRID
SYSTEM FOR DIGITAL ERROR CORRECTION
by
Peter H.
Sohn
A Thesis
Submitted
in
Partial
Fulfillment
of
the
Requirements for
the
Degree
of
MASTER OF SCIENCE
in
Electrical
Engineerin~
Approved
by:
Harry E. Rhody
Prof • •:
_
(Thesis Advisor,
Department
Head)
Pr of.
Alton
F.
Riethman
Pr of.
Kenneth W. Hisu
Prof.
Ray D. Seminkowski
DEPARTME~T
OF ELECTRICAL ENGINEERING
COLLEGE OF ENGINEERING
ROCHESTER INSTITUTE OF TECHNOLOGY
ROCHESTER,
NEW YORK
PREFACE
I
would
like
to
acknowledge
the
invaluable
assistance
ofmy
thesis
advisor,
Dr-
Harvey
E.
Rhody,
whofirst
exposed meto
the
fields
ofdigital
communications
and error correctioncoding.
Without
his
advice
and
criticismthis
thesis
would
not
have
been
possible.
I
also wishto
thank
the
faculty
and
staff ofthe
Electrical
Engineering
Department
ofRochester
Institute
ofTechnology,
many
of whomadvised
and
assisted meABSTRACT
The
design
ofa
microprocessorbased
hybrid
system
for
digital
error
correctionis
presented.It
is
shownthat
such a systemallows
for
implementation
ofseveral
cyclic codesat
avariety
ofthroughput
rates
providing
variabledegrees
of error correctiondepending
on currentuser requirements.
The
theoretical
basis
for
encoding
and
decoding
ofbinary
BCH
codes
is
reviewed.
Design
and
implementation
of systemhardware
andsoftware
are
described.
A
methodfor
injection
ofindependent
bit
errorswith
controllable
statistics
into
the
systemis
developed,
and
its
accuracy
verifiedby
computersimulation.
This
method ofcontrollable
errorinjection
is
usedto
test
performance ofthe
designed
system.
In
analysis,
these
results
demonstrate
hybrid
nature
ofthe
system.
Finally,
potentialapplications
and
modificationsare
presentedto
reinforce
the
wide
applicability
ofthe
systemTABLE
OF
CONTENTS
LIST
OF
FIGURES
viiLIST
OF
TABLES
ix
LIST
OF
SYMBOLS
x
CHAPTER
1
INTRODUCTION
1
CHAPTER
2
DESCRIPTION
OF
THE
CODES
12
2.1
MATHEMATICAL
STRUCTURE
OF
THE
CODES
12
2.2
ADAPTIVE
B.C.H.
ENCODER
IMPLEMENTATION
....17
2.2.1
Hardware
Description
17
2.2.2
Software
Control
25
CHAPTER
3
THE
DECODING
PROCESS
27
3.1
THEORY
OF
BCH
DECODING
27
3.2
GALOIS
FIELD
OPERATIONS
40
3.3
DECODER
IMPLEMENTATION
44
3.4
ILLUSTRATIVE
EXAMPLES
61
CHAPTER
4
RANDOM
ERROR
INJECTION
65
CHAPTER
5
RESULTS
79
CHAPTER
6
APPLICATIONS
AND
MODIFICATIONS
96
6.1
APPLICATION
TO
LONGER
BCH
CODES
101
6.2
EXPANSION
TO
NON-BINARY
CYCLIC
CODES
....108
CHAPTER
7
CONCLUSIONS
112
REFERENCES
116
APPENDIX
B
ASSEMBLY
LANGUAGE
SOFTWARE
LISTINGS
. .125
APPENDIX
C
ERROR
SIMULATION
RESULTS
137
LIST
OF
FIGURES
2.1
-General
(n-k)
Stage
Encoder
19
2.2
-(15,11)
Single
E.C.C.
Encoder
20
2.3
-Encoder
Control
Signal
Timing
23
2.4
-General
System
Software
Flowchart
26
3.1
-Galois
Field
Table
Look-Up
Flowchart
43
3.2
-Galois
Field
Multiplication
Flowchart
43
3.3
-Galois
Field
Division
Flowchart
43
3.4
-Decoder
Block
Diagram
45
3.5
-Decoder
Control
Signal
Timing
48
3.6
-Single
E.C.C.
Flowchart
51
3.7
-Double
E.C.C.
Flowchart
53
3.8
-Triple
E.C.C.
Flowchart
55
4.1
-Error
Generator
Block
Diagram
67
4.2
-Error
Simulation
Results
(graph)
71-75
4.3
-Error
Simulation
Flowchart
76
5.1
-Single
E.C.C.
Results
(graph)
85
5.2
-Double
E.C.C.
Results
(graph)
86
5.3
-Triple
E.C.C.
Results
(graph)
87
5.4
-18
kBaud
Results
(graph)
88
5.5
-36
kBaud
Results
(graph)
89
6.1
-Tree
Search
for
GF(2^)
Element
Identification
.105
A.l
-Encoder
Schematic
Diagram
120
A. 2
-Syndrome
Generator
Schematic
Diagram
121
A. 3
-Chien
Searcher
Schematic
Diagram
122
A. 4
-Error
Generator
LIST
OF
TABLES
2.1
-Elements
of
GF(2i')
15
2.2
-Generator
Polynomials
over
GF(2^)
17
2.3
-Encoder
Shift
Register
Contents
(example)
...21
3.1
-(15.11)
Single
E.C.C.
Syndrome
Register
Contents
62
3.2
-(15,5)
Triple
E.C.C.
Syndrome
Register
Contents
63
4.1
-Error
Probabilities
ofSimulated
Results
...70
5.1
-Code
andInformation
Throughput
Rates
fortheCodes
80
5.2
-Performance
Test
Results
84
5.3
-Selected
Error
Probabilities
andData
Rates
for
Optimum
Performance
94
A.l
-Prototype
Parts
List
124
B.l
-Assembly
Language
Software
Memory
Map
125
LIST
OF
SYMBOLS
k
-number
ofinformation
digits
in
a code wordn
-total
number
ofdigits
in
a codeword
t
-number
ofcorrectable
errorsin
areceived
n-tuple
v
-number
oferrors
which
occured
C(x)
-a
code
word
e(x)
-a
received
error
patterng(x)
-a
code
generator
polynomial
m(x)
-a
factor
ofthe
generatorpolynomial
R(x)
-an
n-tuple receivedby
the
decoder
r(x)
-remainder
after
division
by
g(x)
orits
factors
S(x)
-the
errorsyndrome
X*
-the
errorlocator
numberYj.
- error magnitude(1
for
the
binary
case)
oC
-a
primitive element ofa
Galois
field
C(x)
- errorlocator
polynomialA(x)
-intermediate
term
in
solutionfor
errorlocator
7~(x)
-intermediate
term
in
solutionfor
error
locator
GF(q)
CHAPTER
1
INTRODUCTION
This
thesis
presents
the
theory,
design
andimplementation
of ahybrid
microprocessor-basedsystem
for
digital
error
correction.
This
system utilizesfamiliar
techniques
in
a
newsetting
to
allowfor
greater
flexibility
and
scope
ofapplication
than
do
traditional
hardware
methods.
The
theoretical
basis
ofcyclic
code construction anddecoding
is
first
developed
and
illustrated.
Following
this
fundamental
framework,
the
specifics
ofsystem
implementation
are
presented.
A
methodfor
injection
ofrandom
bit
errorsinto
the
system
is
developed.
After
presentation of system
performance
results,
various
possible
It
is
strongly
felt
that
this
system
has
awide
application
base
and
could
easily
be
adapted
for
a
variety
of
digital
coding
tasks.
In
this
work
one
suchapplication
has
been
chosen
for
full
investigation,
but
many
others
are
conceivable
.Before
describing
the
means
by
whichdigital
error
correction
is
possible,
let
us
consider
why
it
is
necessary.
In
the
communication
ofany
signal,
be
it
a
telephone
call,
radio
broadcast
or
transmission
ofdata
through
a
computer
network,
the
information
being
sent
mustpass
through
acommunications
channel
ormedium.
This
mediummay
be
the
ionosphere,
free
space
orsimply
a
transmission
line.
Distortion
andnoise,
as
well
as
attenuation
ofthe
transmitted
signal
are
introduced.
This
will
affect
the
signal
seen
by
the
receiver,
and
makeit
difficult
for
the
receiver
to
properly
interpret
this
signal.
In
the
case ofdigital
communications,
the
information
sent
and receivedis
a
stream
of
numbers
(digits).
The
receiver
is
faced
with
the
task
of
converting
the
signal
it
reads
into
the
proper
series
ofdigits.
When
noise
is
introduced,
the
receiver canbe
fooled
into
improper
translation;
hence,
the
received
information
will
contain
errors.
If,
however,
the
signal
which
is
transmitted
includes
redundantinformation
about
that
message,
and
if
it
will
have
a
better
chance
ofrelaying
the
proper
message
to
the
user.
This
is
the
task
of
error
correcting
codes.
The
codes
to
be
studied
here
are
a
sub-class oflinear
block
codes.
Because
oftheir
strong
algebraic
structure,
linear
block
codes
have
proven
to
be
very
powerfultools,
both
as
models
ofcode
structure
and
as
directly
implemented
error
correcting
codes.
The
basic
structure
oflinear
block
codes
is
just
as
the
name
implies.
The
message
to
be
sent
is
divided
into
small
blocks
(of
length
k).
The
encoderappends
to
each ofthese
information
blocks
one
or moreparity
checkdigits
to
form
a
larger
block
(of
length
n;
n>k)
which
is
then
transmitted.
These
parity
checkdigits
provide
information
aboutthe
content
ofthe
information
block;
they
allowthe
receiver/decoder
to
determine
the
identity
ofthe
transmitted
code
word.
Many
ofthe
linear
block
codes
alsobelong
to
asubclass
of
codes whichare
cyclic.
Cyclic
codes
have
long
been
a
favorite
ofresearchers
and
designers
alike.
In
addition
to
their
cyclicnature,
which
simplifies
implementation,
they
are
based
on
a
large
amount
ofvery
well
understoodand
much studiedmathematical
structure.
Much
is
known
aboutthe
structure andfunction
of
cyclic
linear
block
codes,
and
this
wealth
of
knowledge
has
Among
the
cyclic
codes,
easily
the
most powerfuland
useful
code
for
the
correction
of
independent
bit
errors
is
the
class
of
codes
discovered
by
Bose,
Chaudhuri
andHocquenghem
(by
the
first
two
in
1960
,by
the
third,
independently,
in
1959
).
Initially,
the
codes weredescribed
in
binary
terms.
In
1960,
Gorenstein
andZierler
M
expanded
their
formulation
to
include
non-binary
symbols.Also
in
1960,
the
first
efficient
decoding
algorithmwas
devised
by
Peterson
.Since
then,
numerousimprovements
and
alternative
interpretations,
as
well
as
new applicationsfor
the
codes,
have
been
presented.
It
was
shownearly
in
their
development
that
among
the
BCH
codes,
those
of shortblock
length
(n-15
orless)
are
optimal,
meaning
they
do
the
best
possible
job
in
correcting
independent
bit
errors
giventhe
additional(parity
check)
information
they
contain.
r>7
(Peterson
*)
Therefore,
because
oftheir
simplicity
in
structure
and utilization andtheir
optimalfunction,
the
BCH
codeswere
an obviouschoice
for
this
thesis.
For
the
systemdescribed
here,
binary
BCH
codes
will
be
utilized.Non-binary
codes
will
be
discussed
in
Chapter
6,
whichdescribes
potentialadaptations
of
the
system.
The
main reason
for
this
is
one
ofpracticality
in
construction
of
the
prototype.The
extensionto
the
non-binary
case
is
straight-forward,
and
the
theoretical
aspects
of
it
well
In
the
early
development
of
error
correcting
codes,
vast
amounts
of
hardware
were
required
for
implementation.
In
1962,
Bartee
and
Schneider
constructed
an
encoder
and
decoder
to
correct
five
or
fewer
errors
in
a
127
bit
codeword.
Their
encoder
consisted
ofa
35
stage
shift
register,
the
decoder
included
a
127
stage
registerand
a
special-purpose
digital
computer
whichtook
up
space
equivalent
to
the
size ofa
desk
drawer.
More
recently,
Pehlert
designed
a
decoder
to
correct
up
to
four
errors
per
block
using
a
shortened
(144,96)
BCH
code.
This
design
utilized
several
feedback
registers
and
a
singlearithmetic
unit
designed
to
perform
Galois
field
operations
ona
time-sharing
basis.
Due
to
advances
in
logic
technology,
Pehlert's
system
is
faster
and
more
compactthan
that
ofBartee
and
Schneider,
but
these
and
the
many
other
similar
hardware-based
systemssuffer
from
one
commondrawback
in
addition
to
the
complexity
and
size
ofthe
hardware
involved;
these
decoders
are
capable
ofhandling
only
asingle
BCH
code.
A
moreflexible
approach
mightinvolve
decoding
by
computer.A
software
implementation
would allowfor
the
decoding
of morethan
one
code-type
at
one
of
Lin
(1970)
described
the
decoding
procedures
for
BCH
codes
in
terms
of
software
and
hardware
implementation.
The
use
of
a
general
purpose
computeris
examined
and
comparedto
the
use
offully-dedicated
hardware.
It
is
shown
that
a
small
computer
programmed
to
decode
the
same
(127,92)
BCH
code
utilized
by
Bartee
and
Schneider
couldcorrect
five
orless
errors
per
block
at
the
rate
of4800
bits
per
second
compared
to
the
2500
bit
persecond
rate
achieved
in
hardware
only
eight
years
before.
However,
if
compared
to
anewer
hardware
system,
Lin's
general
computerimplementation
would
be
muchslower.
Lin
then
consideredan
implementation
combining
the
superior
operating
speed ofspecially-designed
hardware
with
the
flexibility
ofa
general-purpose
computer.This
hybrid
implementation
canincrease
decoding
speed
by
almost
two
orders of magnitude over
a
fully
software-based
system.
Utilizing
a
general purpose computerfor
acertain
portionof
the
decoding
processdoes
not
reduce
system
speed
greatly,
yet
it
can
easily
enhance
system
flexibility.
The
hardware
generally
usedin
decoding,
as
first
presented
by
Bartee
andSchneider
is
nothing
morethan
a
special
purpose
computer.
Lin
pointsout
that
a
very
fast
hardware
implementation
of
the
full
decoder
would
be
extremely
expensive,
and
the
simpleone
would
behave
much
like
a03]
The
main
goal
ofa
hybrid
system,
then,
is
animprovement
in
system
flexibility.
A
fully
hardware-based
system
is
generally
capable
ofutilizing
only
one
particular
code
type
within
a
small
range
ofoperable
data
rates.
One
of
the
chief
benefits
of
the
BCH
codes
is
their
cyclic
structure
which
leads
to
simple
implementation.
The
membersof
this
code
family
have
similar
structure,
and
the
methodsof
decoding
are
generally
applicable
to
a
wide
range
ofthem.
By
implementing
a portion ofthe
decoding
scheme
in
software,
a
single
system
can utilizeany
number ofsimilar,
yet
different
code
types,
underdifferent
circumstances.
There
are
distinct
performance
trade-offs
in
error
correction.
An
increase
in
the
number
oferrors
to
be
corrected
causesan
increase
in
decoding
time,
since
moreequations must
be
solvedfor
more unknownquantities.
This
additional error
correcting
ability
also
requires
agreater
number of check
digits
per codeword,
therefore
reducing
the
rate
ofinformation
throughput
even
further.
Hence,
the
time
requiredto
receiveand
decode
a
given
amount
ofinformation
increases
withthe
amount
of correctiondesired.
There
areinstances
where channelnoise
is
so
great
that
large
amounts of correctionare
calledfor,
at
the
expense
of speed.
And
the
oppositeis
also
likely
to
occur.
A
single system able
to
function
optimally
underthese
varying
The
key
to
this
flexibility
lies
in
the
combination
ofhardware
and
software
in
the
error
correcting
scheme.
The
software
implementation
of aportion
ofthe
decoding
scheme
will
not,
by
itself,
provide
the
required
flexibility.
What
is
needed
is
a
complete
system
which
can
be
easily
altered
to
serve
these
varying
needs.
A
general
purpose computerwould
meet
this
requirement,
but
with
aloss
of
speed.
The
solution
presented
in
this
thesis
involves
hardware
for
encoding,
computation
ofthe
errorsyndrome
and
final
correcting
stage
ofthe
decoder.
The
central
step
ofdecoding,
the
formulation
ofthe
error-locator
polynomial,
is
implemented
through
software-Additionally,
the
functional
nature
ofthe
encoder andportions
ofthe
decoder
are
controlled
through
software
to
provide
additional
flexibility.
A
system
comprised ofspecially
designed
hardware
anda general-purpose computer
satisfies
systemrequirements,
but
untilrecently,
sucha
systemwould
have
required
the
use of
a
large
mainframecomputer.
The
recent
boom
in
the
microprocessor
industry
has
produced
small,
inexpensive
microcomputer systems
and
single-board
computers
that
caneasily
interface
withother
digital
hardware.
This
makes
the
notion of sucha
hybrid
system
very
attractive
by
removing
the
needfor
a
mainframe.In
a1978
paper,
Tho
Le-Ngoc
described
sucha
decoder;
involving
a
combination
CO
an
implementation
were
discussed.
The
systempresented
in
this
thesis
utilizes
a
16-bit
microprocessor(Intel
8086)
and
peripheral
devices
including
a
parallelinterface
for
the
specially-designed
encoding/decoding
hardware.
The
major
differences
between
this
system
and
the
previous
processor-based
systems
lie
in
the
methodsby
which
decoding
is
accomplished
in
both
hardware
and
software.
The
microprocessor
serves
several
basic
functions.
One
is
the
control
ofencode
and
decode
hardware
function.
By
the
use
ofsimple
combinational
logic
with externalcontrol
inputs
provided
through
anI/O
port
from
the
processor,
the
system's
function
canbe
altered
to
handle
any
ofseveral
BCH
code
types.
The
other majorrole
ofthe
processor
is
the
implementation
ofone
segment ofthe
decoding
scheme.
This
is
advantageousbecause
ofthe
natureof
BCH
codesand
their
decoding.
The
portions
ofthe
decoding
processimplemented
in
hardware
remain
basically
the
same
for
all
ofthe
codes.
The
greatest
changes
occurwithin
those
parts ofthe
system whichare
handled
through
the
microprocessor.The
hardware
changes
required
for
different
codesare
easily
controlledby
the
software.
Simply
by
altering
the
softwareroutine,
one
system
ofhardware
is
capable ofencoding
and
decoding
a
variety
ofImplementation
by
microprocessoris
made
moreattractive
by
the
nature
ofthe
operationsrequired
in
the
decoding
algorithm.
The
Arithmetic
Logic
Unit
required
in
the
decoding
process
must
perform
mathematicaloperations
over
a
Galois
field
rather
than
simplebinary
arithmetic.
In
hardware,
such
operations
are
handled
by
the
traditional
shift-register
methods.
Although
shift
register
implementation
has
the
advantage
ofsuperior
speed,
it
lacks
any
sort
offlexibility
ofoperation.
A
shift
register
hard-wired
to
perform
a
specific
multiplicationroutine
cannot
be
easily
modified
to
implement
the
multiplicativeoperations
required
by
another
decoding
algorithm,
orthe
handling
of adifferent
code
structure.
A
microprocessor-basedimplementation
adds
greatflexibility
to
the
decoding
system.
Through
software
modification,
the
system canbe
altered
to
handle
a
variety
of code
types
and structures.The
task
of
error correctionis
alsosimplified,
since
the
operations
needed
for
Galois
field
operationscan
be
done
by
basic
processorinstructions
(addition,
subtraction,
comparisonand
logical
exclusive-OR)
.In
the
Intel
8086
these
have
an
average
execution
time
of0.6
microseconds.The
specifics
of
this
To
illustrate
the
potential
flexibility
of
the
proposed
system,
yet
to
allowthe
use ofa
preexisting
microprocessor
development
kit
(SDK-86),
and
to
keep
hardware
construction
simple,
small
block
length
(n-15)
codes
will
be
utilized.
Specifically,
three
codes
willbe
included.
These
codes
have
information
block
lengths
of
11,
7
and
5
bits
(k)
and
are
capable
ofcorrecting
single,
double,
and
triple
errors,
respectively,
withina
code
block
15
bits
in
length.
More
variety
in
code
choiceis
possible,
and
for
many
suchchoices
the
hardware
follows
the
basic
pattern
ofthe
proposed
system.
Such
alternativeswill
be
CHAPTER
2
DESCRIPTION
OF
THE
CODES
2.1
MATHEMATICAL
STRUCTURE
OF
THE
CODES
All
linear
block
codes
are
governed
by
aset
of
rules
which
control
the
transformation
ofthe
message
sequence
into
aseries
ofcode
words
in
encoding,
and
the
attempted
recovery
ofthe
message sequencefrom
the
received
data
in
decoding.
The
block
encoder
systematically
transforms
ablock
ofinformation
(of
length
*k')
to
a
longer
block
of *n'digits,
calleda
codeword
orcode
vector.
Since
there
are
*k'
message
digits
perblock,
binary
codes
will
contain2
possible messageblocks.
Thus
the
set
ofall
possible
code words must contain
2
elements.
All
cyclic codewords
have
the
additional
characteristic
that
if
a
given
n-tuple
(X)
is
a
code
word,
then
the
n-tuple obtainedby
shifting
X
cyclically
one
(or
possible
to
represent
the
set
of
code
words
by
an
equivalent
set
of
code
polynomials
with
binary
coefficients.
The
polynomial
which
has
the
lowest
degree
is
referred
to
as
the
generator
polynomial,
g(X).
By
definition
of
the
codes,
the
fj67
generator
polynomial
g(X)
mustbe
unique.For
eachindependent
generator
polynomial
ofdegree
(n-k),
there
will
be
a
distinct
(n,k)
code.
The
parity
checkdigits
to
be
appended
to
each
message
block
are
the
remainder
found
by
jmia
&7J
n-k
division
ofthe
message
polynomial
pre-mult
iplied
by
X
by
the
generator
polynomial
g(X).
The
definition
ofthe
codepolynomial
for
binary
BCH
codes
is
based
onthe
mathematics
ofthe
two-valued
Galois
field
GF(2),
and
a
Galois
field
of 2melements,
referred
to
as
GF(2m).
First,
afield
oftwo
elements
and
a
primitivepolynomial
p(x)
are
defined.
Given
a
primitive
element
<*-for
whichp(<*)
0,
the
Galois
field
will
consist
ofthis
primitive
andthe
sequence
ofits
powers
from
1
to
(2
-2),
as
well
as
the
element0,
whose
power
is
undefined.
For
a
t-error
correcting
BCH
code,
the
generator
polynomial
is
defined
as
the
least
common
multiple ofthe
minimum polynomials
of
the
first
(2t)
consecutive
powers
ofthe
primitiveoc
.In
equationform,
if
m^
is
the
minimum
polynomial associated with
*C
,then
the
generator
polynomial
is
defined
as:
The
Galois
field
elements
*,**,...
areroots
ofg(X).
By
definition
ofa
finite
field,
all
evenpowers
of
a
given
field
element
must
have
the
same
irreducible
root.
Thus,
the
only
distinct
minimum polynomials arethose
related
to
odd
powers
ofthe
primitive
OC
.Consequently,
Equation
2.1
is
reduced
to:
g(X)
-LCM
(m,(X),
m3(X),...,m^.,
(X))
(Eq.
2.2)
From
Equation
2.2,
for
at-error
correcting
code,
there
must
be
"t
'irreducible,
independent
factors
ofthe
generator
polynomial.
The
number
of checkdigits
in
acode
word
equals
the
order
ofg(x).
Each
factor
m;(x)
has
orderm
or
less.
As
the
number offactors
ofg(x)
equalsthe
number of
errors
the
codecan
correct,
the
order
ofg(x)
must
be
less
than
or equalto
(rot).
The
relationship
between
the
number
of
irreducible
sequential
roots
ofthe
generator
polynomial
and
the
number
of correctible errors
in
a
codeword
defines
the
formation
[19]
ofthe
generator polynomial.According
to
the
BCH
bound
,the
minimumdistance
(d)
of
a
code
is
greaterthan
the
largest
number of consecutiveroots
ofg(x).
The
errorcorrecting
ability
ofa
code(t)
is
then
defined
as
being
This
will
be
illustrated,
by
way
of anexample,
withthe
set
of
codes
for
which
n-15(m-4).
Table
2.1
lists
the
4
elements
of
GF(2
)
with
the
primitive polynomial shownbelow.
TABLE
2.1
-Elements
of
GF(2^)
power
element
binary
form
hexadecimal
0
0000
0
0
1
0001
1
1
0i0010
2
2
**-0100
4
3
31000
8
4
<** OC+
1
0011
3
5
K*m OCZ+<X.OHO
6
6
*' -*+<**1100
C
7
*3+
<X+
1
1011
B
8
.*+
1
0101
5
9
Of9-ot3+
OC
1010
A
10
^'"-oc'+
ck+
1
0111
7
11
,*"-r3+a
+ec
1110
E
12
pc'*-*3**^*.+
1
mi
F
13
ec'-3-a:3+pt2-+1
1101
D
"
,*'":*+
1
1001
!
p(<*)
-e>C+
#+
1
-0
(Eq.
2.3)
To
determine
the
generator polynomialsfor
the
three
codesunder
investigation,
the
three
polynomials,
m,
,m3
and
m^-,being
the
minimum polynomialsof
,*3
and
frespectively,
must
be
found.
This
is
easily
done
utilizing
one
of severalmethods outlined
in
any
standardtext
oncoding
theory.
As
an
example,
if
one wishesto
form
the
m,
,the
minimum
polynomial associated
vith*X,
onemust
first
form
the
*
C
,*Cof.
(Eq.
2.4)
This
sequence
has
only
four
distinct
elements,
oc.eC
,GC
and
0r.
These
are
the
roots
of
m,
,and
therefore,
with
the
aidof
Table
2.1,
the
product
ofthese
four
terms
can
be
found
to
be:
m,(X)
-(X+et)(X+K2-)(X+rf*)(X+S)
=1
+
X
+
X4(Eq.
2.5)
The
two
other
irreducible
polynomials
desired
are
obtainedin
a
similar
manner,
and
are
listed
below.
m,
(X)
-1
+
X
+
X
m3(X)
-1
+
X
+
X*
+
X3+
X4mj-(X)
-1
+
X
+
X2-(Eq.
2.6)
For
the
(15,11)
Hamming
code,
the
generator
polynomial
2.
4fi
has
roots
PC
, Oi,
oe.
and
oc ,and
therefore
has
minimumdistance
d
3.
From
the
abovedefinition,
tl,
and
the
code
can
correctsingle
errors.To
correct
double
errors,
g(x)
must
then
containfour
consecutiveroots,
oc , ^(
^
and
oC
.To
have OC
as
a root ofg(x),
the
factor
mj(x)
mustbe
multiplied
by
m^(x)
to
form
g(x).The
final
generator
polynomial
for
15
bit
block
length
codes
has
the
additional
factor
n,(x),
adding
the
root
oe
to
the
consecutive
series
(cc*
is
nowpart
ofthe
consecutiveseries,
being
aroot
ofi3(x))
so
that
the
minimumdistance
nowequals
seven.
This
forms
the
(15,5)
BCH
code,
which
is
capable
of
triple
error
The
generator
polynomials
for
the
single,
double
andtriple
error
correcting
codes
appearas
Table
2.2,
whichlists
n,k,t
and
g(X)
for
each
of
the
three
codes.
TABLE
2.2
-generator
polyno:nia
Is
,g(x)
over
GF(24)
(n
-15)
k
t
factors
generator
polynomial11
7
5
1
2
3
m,
(x)
ra,
(x)ni3(x)
m,
(x)m3
(x)m5>(x)
x*1
+
x
+
1
x*+
x7+
x*+
+
1
x/0
+
x8+
x*+
x*+
yP-+
x
+
1
2.2
ADAPTIVE
B.C.H.
ENCODER
IMPLEMENTATION
2.2.1
Hardware
Description
The
first
step
in
any
errordetecting
/
correcting
process
is
the
properencoding
ofthe
input
messagesource.
For
cycliccodes,
this
involves
calculation
ofthe
necessary
parity
checkdigits
for
a given messageblock
m(X).There
are
two
basic
configurationsfor
such
anencoder;
the
first
being
based
on an(n-k)
length
shift
register,
the
second
being
based
ona
register oflength
k.
For
the
purposes
ofthis
design,
the
(n-k)
design
is
utilized.The
basic
reason
for
this
is
ease ofimplementation
ofswitching
circuits,
and
the
needfor
oneless
shift
registerin
the
designed
(n-k)
length
register
contains
ten
register
stages
for
the
(15,5)
triple
error
correcting
code.
The
maximumlength
ofa
k
length
shift
register
would
contain elevenstages,
to
accomodate
the
(15,11)
single
errorcorrecting
code.
For
an
(n-k)
binary
encoder,
the
parity
check sequenceis
simply
the
remainder
ofthe
division
ofm(X)
by
the
appropriate
codegenerator
polynomial
g(X).
This
canbe
implemented
in
hardware
by
use of adivision
circuit
whichis
afeedback
shift
register
withfeedback
taps
appliedthe
generator
polynomialg(X)-l+g,
X+g2X*+.
.-+g.|M
XP"
.
The
polynomialcoefficients
are
either
one
orzero
(connection
or noconnection)
depending
onthe
codeused.
according
to
The
generaldesign
of such an encoderis
shown
in
Figure
2.1
below
with
the
symbol
-O*denoting
asingle
binary
shift
registerstage,
the
symbol
0-being
a
modulo-2adder
(exclusive
OR
gate)
andthe
symbol
^>-
being
the
connection/no connection
based
onthe
generator
polynomial.
The
basic
encoding
processfor
a
givenk-digit
block
message
is
givenhere.
Step
1
-The
k
information
digits
are
shifted
into
the
communications channel
and
the
feedback
loop
ofthe
shift
register,
withall
switchesin
position
*A'.
After
these
k
FIGURE
2.1
-General
(n-k)
Stage
Encoder
gate.*
:hanriei
digits
.Step
2
-The
feedback
connection
is
then
broken
(switches
in
position
*B')
andthe
messagesource
is
disconnected
from
the
channel
(either
sent
into
abuffer,
orif
possibleinterrupted).
Step
3
-The
(n-k)
checkdigits
are
then
shifted
outof
the
register
andinto
the
channel,
completing
the
desired
n-digit
codeword.
This
processis
then
repeated
for
the
next
k-digit
messageblock.
The
serial outputof
the
encoder(to
the
channel)
thus
consists of
a
string
of n-lengthcode
words.
The
first
k
digits
of eachword
are
the
information
digits
(high
order
bit
first),
the
remainder arethe
redundant
check
digits.
For
the
singleerror-correcting
(15,11)
Hamming
code,
the
encoderis
shownas
Figure
2.2.
As
an
example,
let
the
(11010001101).
It
has
the
polynomialrepresentation
(x'+x9+x7+x3+x2+l).
FIGURE
2.2
-(15,11)
Single
E.C.C.
Encoder
-t;
^)4VM^1-^
Saurt*.
3?
n-k
4
Multiplying
by
X
orX
yields
the
binary
block
(110100011010000)
in
binary
(detached
coefficients)
representation.
Using
this
form,
the
single
errorcorrecting
generatorpolynomial
(x
+x+l)
is
(10011).
4fDividing
X
m(x)
by
the
generator
polynomial
yields aremainder
of(1110)
or(x^+x2+x).
Table
2.3
illustrates
the
contents
of
the
four-stage
shift register andthe
channeloutput
after eachregister
shift.
After
the
eleventh shifthas
occurred,
the
gating
logic
setsthe
three
switches
in
Figure
2.2
to
position*B',
disabling
the
messagesource
andfeedback
loop,
andconnecting
the
shift
register
output
to
the
channel.The
remainder of(1110)
whichare
the
parity
checkdigits
are
appendedto
the
messageword
to
form
the
codeword
(110100011011110).
This
same code wordwill
be
usedin
TABLE
2.3
-Encoder
Shift
Register
Contents
(
example
)
j
s
f
h
\
hift
register
contents
after
j*^si
|
Tr-LLrL
r^i
*ra
iL
m(x)i
*-HlrflnZr"0
H*!IM
9*>output
I
1
1
i
i
0
0
1
2
1
1
i
0
l
0
1
3
0
0
0
i
0
1
0
4
1
0
0
0
i
0
1
5
0
0
0
0
0
1
0
6
0
1
i
1
0
0
0
7
0
0
0
1
1
0
0
8
1
1
i
1
1
1
1
9
1
0
0
1
1
1
1
10
0
1
i
1
1
1
0
11
1
0
0
1
1
1
1
12
- -0
0
1
1
1
13
- -0
0
0
1
1
14
- -0
0
0
0
1
15
-0
0
0
0
0
To
implement
this
procedurefor
severaldifferent
coding
lengths
(values
of
k)
the
following
basic
modifications
to
the
design
were accomplished.The
mostimportant
is
the
alteration offeedback
taps
to
allowfor
external control.
Not
only
do
the
locations
offeedback
taps
change withk,
but
the
overalllength
ofthe
registervaries
as
well.To
allowfor
these
variations,
eachregister stage
(U-5,6)
includes
a
feedback
tap
through
a
two-input
AND
gate(U-8,9,10).
One
input
to
this
gateis
simply
the
feedback
line.
The
second
is
a
control
signal
which
is
sentfrom
the
8086
microprocessorthrough
an
8255A
*-
schematicdiagrams
of allhardware
appearas
Appendix
A
parallel
interface
port
to
encoderboard
inputs
C(0-5).
Thus,
the
length
ofthe
shift
register
and
the
generator
polynomial
coefficients
become
programmable.It
is
only
necessary
to
construct
aregister
of maximallength
according
to
the
highest
(n-k)
desired.
In
the
process
ofencoding,
it
is
necessary
to
controlthe
input
to
the
shift
register,
the
feedback
connection andthe
output
to
the
communications
channel.
In
a standardhardware
design,
this
is
accomplished
withrelatively
simplecombinational
logic.
To
allowfor
morethan
one code-typeto
be
utilized,
the
circuitry
involved
is
slightly
morecomplex.
A
4-bit
binary
counter
(U-3)
is
usedto
countthe
15
bit
blocks.
It
supplies
an activelow
"end
of block"pulse
during
the
final
clock cycle ofthe
codeblock.
To
allowfor
the
variati-onsin
the
number of messagedigits
in
eachblock,
decoding
circuitry
wasdesigned
to
supply
gating
controlfor
the
data
bus.
This
was
accomplished with
the
use of atype
D
flip-flop
(U-7)
clocked
by
a series of combinationallogic
(U-16,17)
afterthe
k
clock ofthe
block
cycle.
This
signal
is
reset
by
the
rising
edge ofthe
end
ofblock
signal.
Thus,
the
Q
output
is
low
for
the
first
k
clocks
and
high
for
the
remainder of
a
15-bit
block.
Both
Q
and
its
inverse
areDuring
the
first
k
clockcycles
of
a
given
block,
this
gating
logic
enables
the
shift
register
feedback
loop
and
routes
the
information
digits
to
both
the
shift
register
and
channel.
After
k
clock
cycles,
this
output
opens
the
feedback
loop,
disables
the
message
source
and
connects
the
output
ofthe
shift
register
to
the
channel.
For
the
three
(n-15)
codes
usedin
this
design,
three
sets
ofreset
logic
for
the
flip-flop
controller
were
required.
The
selection
of
one
ofthese
three
reset
schemes
is
provided
by
three
ofthe
external
inputs
provided
by
the
microprocessor
via
the
8255A
ports.
A
timing
diagram
illustrating
those
signals
used
in
encoding
is
shown
below
as
Figure
2.3.
FIGURE
2.3
-Encoder
Control
Signal
Timing
Ol
23*iS,fc"r8K>iliti1IHi?0
*,
njiJiJTJiJTJxriJTJij^^
gated
clock,
rijiJiJiJTJiJiTTjnj"iJxriJ^^
ripple
carry.
end of
f
block
|
t-1
ftatlng
t-2
The
remainder
ofthe
encoderhardware
is
basic
systemsupport.
Two
counters
(U-1,2)
are utilizedto
supply
the
system
clock
from
the
processor.
The
SDK-86
development
kit
utilized
in
this
prototype
system providesa
2.45
MHz
clockoutput
for
external
peripheral
devices.
This
is
divided
down
by
increments
oftwo
to
providevarious
clocks
for
useby
the
system
hardware.
Three
alternative clocks areutilized
to
provide
abasic
system clock of19.2,
38.4
or
76.8
kHz.
In
fact,
two
clocks of equalfrequency
aregenerated,
with
a
400
nanoseconddelay
between
them
(provided
by
flip-flop
U-7).
The
"original" clock(
CLK
1)
drives
all
control
signal
generation,
whilethe
delayed
clock
(CLK
2)
drives
the
assortedshift
registers.
This
ensures
control
signal
stability
at
the
time
of registershift.
An
8
bit
shiftregister
(U-4)
is
usedto
create
a255
bit
pseudo-randomstring
to
serve asthe
information
source.
This
allowsthe
individual
messageblocks
to
appear randomto
the
system,
eventhough
the
overallbit
patternis
known.
Further,
the
generation ofinformation
digits
canbe
easily
controlled
simply
by
gating
ofthe
shift
register
clockinput.
Thus
the
pseudo-randombit
pattern servesonly
as
the
information
sequencewith
aknown
and
controllable
2.2.2
Software
Control
The
software
involved
in
the
encoderis
relatively
simple.
Its
two
basic
functions
are
to
controlthe
feedback
shift
register
and
the
counter
decoding
to
be
usedfor
signal
bus
gating.
This
is
accomplishedthrough
use ofthe
8255A
parallel
interface
ports.
First,
the
8255A
is
initialized
to
provide
the
desired
ports asinput
and
outputfor
both
the
encoder
and
decoder.
The
controlfor
the
generator
polynomial
and
desired
codetype
(kll,7
or5)
are programmedto
the
port
and
sent
to
the
encoderthrough
inputs
C(0-5).
Finally
a'clear'
signal
is
sentto
the
two
shift
registersand
the
system clockis
enabled,
thus
starting
the
encoding
process.The
microprocessorthen
FIGURE
2.4
-General
System
Software
Flowchart
initialize 825S-A Parallel
Peripheral
Interface
PORT A
- outputPORT B
-output
(low
byte)
-
Input
(high
byte)
PORT
C
-input
set
up
encoderfeedback
tapsnd
control;
set externalclear
high
aet-up byte
>
PORT
A
low
reset external clear
wait
for
decode data
from
syndrome stage
Zread
syndromefrom
/
PORTS
b
and c/
determine
errorlocator
polynomial
(Berlekamp's
algorithm)Z:
output errorloca
toChlen
stageZD
CHAPTER
3
THE
DECODING
PROCESS
In
order
to
retrieve
information
from
the
received
signal,
the
errorcorrection
code
mustfirst
be
properly
decoded.
The
theory
ofthe
decoding
processis
based
onthe
same
system
of
algebrapreviously
usedto
formulate
the
codes
and
the
generatorpolynomials.
This
chapter willdevelop
the
theoretical
basis
for
BCH
decoding
anddescribe
its
implementation.
3.1
THEORY
OF
BCH
DECODING
Given
an(n,k)
binary
errorcorrecting
code,
the
set
of
all
possible code wordsforms
a
set
of
2
elements.
This
is
a
subset ofthe
full
set of2
possiblen-digit
vectors.
Proper
decoding
mustbe
governedby
some
pattern orrule
A
k
which
can
separatethese
2
possibleelements
into
2
disjoint
setsin
sucha
way
that
eachset
contains
only
one
of
the
2^which
ofthese
sets
contains
the
received
vector.
The
codeword
which
is
also
a
member
of
that
set
is
then
chosento
correspond
to
the
received
vector.
The
generally
accepted
method
by
which
the
full
set
of
n-tuples
is
partitionedis
the
formation
of astandard
array
in
which
each rowis
a'coset',
and
the
leftmost
element
in
each rowis
a'coset
leader
' .The
method
ofconstructing
astandard
array
is
asfollows.
All
2
code
words
areplaced
in
the
top
row withthe
zero-vector
as
the
first
(left)
element
of
that
row.
After
this
row
is
complete,
an
unused
n-tuple
is
chosenfrom
n
k
the
(2
-2)
unused vectorsand
placed
immediately
underthe
zero
vector.
This
chosen
n-tuple
(which
is
not
a
codeword)
is
then
addedto
each codeword
withthe
sum
being
placed
immediately
underthat
original
codeword.
The
result
is
asecond row of
2
elements,
all
ofwhich
aredifferent
from
the
set
of code words.This
operationis
repeated,
always
chosing
an
unused n-tupleas
the
first
elementin
a
row,
until
all
possible2
n-tuples appearin
the
table.
The
n-k
standard
array
mustthen
contain2
distinct
rows.
It
has
been
shownthat
each row must contain2
distinct
n-tuples,
and
that
each row mustbe
disjoint.
Thus,
each
n-tuple
To
decode
utilizing
a
standard
array,
the
decoder
mustlocate
the
received
code
word
in
the
array.
The
leader
of
the
coset
which
contains
the
received
vector
is
an
errorpattern
which
will
yield
the
received
vector
when
addedto
the