Professional Documents
Culture Documents
Design of (15, 11) Hamming Code Encoding and Decoding System Based on FPGA
Tongsheng Zhang, Qun Ding
Heilongjiang University
Key Laboratory of Electronic Engineering, College of Heilongjiang Province
Harbin, China
qunding@yahoo.cn zhangtongsheng2006@163.com
Abstract—In the digital communication systems, due to the one bit error capacity, so it has a very widely range of
random interference from the outside, digital code may be applications in the communication systems. In this thesis,
distorted during the transmission, so the receiver can’t judge we take (15, 11) linear block codes for example to expound
correctly, it makes the communication systems’ BER increases the principle of Hamming code encoding and decoding by
greatly and affects the quality of communication. The target of
FPGA in detail. Generally, linear block codes use (n,k). k
this thesis is to design the encoding and decoding of Hamming
code by VHDL language to elaborate how hamming code to stands for information code, the length of n is encoded code
error detection and correction. So it will enhance the reliability words, and n-k=r. Linear block codes is to encoding k-bits
of communication systems. information accordance with the linear equation to
Key words-Hamming code;FPGA;error-detection-correction determine the r-bits redundancies [3]. We suppose the input
code is M=(M0,M1,…,Mk) and output code words is
I. INTRODUCTION A=(A1,A2,…,An), then we have the following
High-speed information transmission and high reliability relationship[4]:
becomes the two most important measures in modern A = M •G (1)
communication systems, high-speed means that the G is linear block codes’ generator matrix, H is check
information transforms as soon as possible from the sender matrix. Before encoding when we choose a fixed generator
to the receiver, that is source coding; high reliability matrix G. and then the relationship between information
requires information should be as correctly as possible code and check code is fixed. If we want to change the
accepted by the receiver, that is channel coding. Obviously, encoding of linear block codes, as long as we change the
the two sides are contradictory. This requires us to be generator matrix G can we change the encoding. For linear
dialectical and unity the two sides so that making block codes (n,k). If we want to indicate one bit error code,
information transfer faster and more accurately [1]. So we we should use r-bits check matrix, then the following
relationship is fixed [5]:
propose a kind of error detection and correction method by
FPGA-Hamming code, a kind of linear block codes. 2r − 1 ≥ n Or 2 r ≥ k + r + 1 (2)
Compared with other encoding methods, hamming code Besides, encoding efficiency of (n,k) is k , so
owns a higher encoding effect, encoding and decoding n
uncomplicated. Besides, vhdl is conform to ieee standards k k 1 , we may find, when r is fixed, then
= =
language, it realizes easy, and hardware owns a relatively n k + r 1+ r
faster processing speed, so data processing speed will be k
improved. encoding efficiency is growing with n increases.
II. CHANNEL CODING THEORY IV. HAMMING CODE ENCODING PRINCIPLE
Channel coding is to encoding the information according Suppose (n,k) Hamming code, k=11, n=15, r=n-k=4. We
to the certain rules and produce a fixed length of
use a14ǃa13ǃ…ǃa5ǃa4 stands for information code; S4ǃ
redundancies bits and attach it as a suffix after the
information code, and then transmitted in the channel, the S3ǃS2ǃS1 is corrector [6]. We have the following table I.
TABLE I. THE RELATIONSHIPS BETWEEN CORRECTOR AND
receiver uses the same algorithm to calculate redundancies ERROR MAP
bits and compare the both, if the two equals to each other wrong wrong
means that the information received accurately, if not, it S1 S2 S3 S4 S1 S2 S3 S4
code code
means the error happened [2]. The basic model of channel 0 0 0 1 a0 1 0 0 1 a8
coding as shown Figure 1 0 0 1 0 a1 1 0 1 0 a9
0 1 0 0 a2 1 0 1 1 a10
Figure 1. Basic model of channel coding 1 0 0 0 a3 1 1 0 0 a11
0 0 1 1 a4 1 1 0 1 a12
III. HAMMING CODE 0 1 0 1 a5 1 1 1 0 a13
Hamming code was first proposed in 1950, it is a kind of 0 1 1 0 a6 1 1 1 1 a14
linear block codes that can error detection and correction 0 1 1 1 a7 0 0 0 0 no-error
705
words s is 010010000000101. Similarly, if input is In the figure, the left is hamming encoding module, the
10001000100, then r-bits redundancies is 0010, and the right is Hamming code decoding module, the middle
code words is 100010001000010. simulate channel, the simulation result shown as Figure 7
B. design of Hamming code decoding
Hamming code decoding process is based on the
received signal and decoding rules to calculate the error
corrector and judge the received code words whether there
is error, the programming flow chart shown as Figure 4 Figure 7. Hamming code simulation results
a_data is the input information, a_r is the corrector after
encoded, s is the encoded words, s_s is wrong maps, y is
decoded information. The input information is
10000000000, according to the coding rules, we have 4 bits
redundancies 1111 and attach it after the information, so s is
100000000001111, on the other side, s_s is 0000, it means
the transmission is correct, and then y is 100000000001111,
equal to s.
B. based on the above, we change the design into
another system as Figure 8
706
In conclusion, hamming code improves the reliability of
data transmission and provides a new solution for data
transmission.
ACKNOWLEDGMENT
This work is supported by the National Natural Science
Foundation of China (No.61072072).
707