Professional Documents
Culture Documents
Single-Bit Parity Detection and Correction Using Hamming Code 7-Bit Model
Single-Bit Parity Detection and Correction Using Hamming Code 7-Bit Model
ABSTRACT 2. THEORIES
In the world of technology is already integrated into the 2.1 Data Transmission
network must have a data transmission process. Sending and The data transmission is the process of sending data from one
receiving data communications systems do not avoid mistakes. data source to a data receiver using an electronic device. To
Packets of data sent from the server to the client computer perform data transmission requires the medium, this medium
always have an error in transmission. These shipments have itself has several kinds such as buses, cables commonly found
leaks that occur due to changes in voltage, frequency or on the computer, while the external computer in the
impact. One of the methods used to detect and correct errors transmission of data can use external cables (Wired) and Wi-Fi
in data transmission is the Hamming method. This method (Wireless).
will check bit errors in delivery. Hamming is to do the process
at fault detection, and then the error will be corrected so that Wired Cable
the arrangement of the bits will go back to the bit sequence Wired cable is used to perform the data transmission process
before the data is sent. With the application of this method, the directly; there are several kinds of which are as follows:
data transmission process will avoid mistakes. Data will be
• Wired UTP or commonly known as Unshielded
saved to the destination.
Twisted Pair cable is used for transmitting over a
General Terms computer network such as in the office or cafe. In
Data Transmission addition to UTP, STP (Shielded Twisted Pair) in
which there are several wires in one bundle can also
Keywords be used to transmit data.
Hamming Code, Error Detection • Coaxial cable which consists of two kinds of
conductors separated by using an insulator.
1. INTRODUCTION
Delivery of a message from someone that is confidential or • Fiber Optics is commonly called FO, where a cable
personal to others or the desired person is a way to change the that can transmit information by passing data using
message to be sent into a code word so the secret message can light waves.
be read only by the sender and the person concerned. The
Wireless
theory is used to change a secret message into a code word or
Wireless communication is having telecommunications using
otherwise change the code word becomes the message is the
electromagnetic waves instead of cable media. Nowadays
theory Encoding [1]. Encoding is the process of adding binary
wireless technology has developed rapidly. It can be seen by
numbers of n-m characters in each code to form a code word.
the increasing number of cellular phone use, besides
Decoding is the process of outlining a code word into a
developing wireless technology is also used for integrated into
message [7][8]. The examples of encoding and decoding
the same network. Wireless, also known as Media
techniques are repetition and Hamming. In the encoding form
Transmission Wireless is unguided, can only transmit data
of repetition code, the code word obtained by repeating a
without too much obstacles. The cast of data on the network is
message that has been modified in the form k times as much
typically done using a tool known as the antenna or
code. In Hamming encoding, the code word is obtained by
transceiver. Some of the wireless are:
adding the binary numbers on every message that has been
modified as K characters [9][10]. Meanwhile, in the form of • Radio
repetition code decoding, the message is obtained by dividing
the total code word K parts. In decoding such as Hamming • Microwave
code, the message was obtained by deleting the code word • Infra Red
before by K character. To determine the received message is
equal to sent it needs to be checked, and the error correcting • Bluetooth
code word is received, i.e., the specific ways to obtain the • NFC
actual message.
12
International Journal of Computer Applications (0975 – 8887)
Volume 154 – No.2, November 2016
cb = 2𝑛 − 𝑛 − 1 > 7
= 22 − 2 − 1
= 1<7
13
International Journal of Computer Applications (0975 – 8887)
Volume 154 – No.2, November 2016
When the recipient sees an invalid codeword, there has been Bit 1 0 0 1 0 0 0
an error in transmission. Likewise, to correct d errors, it needs
a code within 2d + 1 because it was declared legal codeword Position 1 2 3 4 5 6 7
can be separated even with d changes, the original codeword
will be closer than the other, then the error recovery can be The bit length is 7 represented by p.
determined uniquely.
p = 7
As a simple example for error detection code, download a
code in which a single parity bit is added to the data. The cb = 2𝑛 − 𝑛 − 1 > 7
parity bit is chosen so that the number of 1 bits in the
codeword becomes even (or odd). For example, if 10110101 is = 21 − 1 − 1
delivered in even-numbered parity by adding a bit at the = 0<7
edges, then the data was 101101011, while the even-numbered
10110001 parity becomes 101100010. A code with a single cb = 2𝑛 − 𝑛 − 1 > 7
parity bit has a distance of 2 because any single-bit error
produces a codeword with parity wrong. = 22 − 2 − 1
The following steps are done to calculate the hamming code = 1<7
as cited from Tim Downey from Florida International
University [2]. The key to the Hamming Code is the use of cb = 2𝑛 − 𝑛 − 1 > 7
extra parity bits to allow the identification of a single error. = 23 − 3 − 1
Create the codeword as follows:
= 4<7
• Mark all bit positions that are powers of two as
parity bits. (positions 1, 2, 4, 8, 16, 32, 64, etc.) cb = 2𝑛 − 𝑛 − 1 > 7
• All other bit positions are for the data to be encoded. = 24 − 4 − 1
(positions 3, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17,
etc.) = 11 > 7
• Each parity bit calculates the parity for some of the After the calculation, the total check-bits is 4 check-bits.
bits in the code word. The position of the parity bit
determines the sequence of bits that it alternately Parity x x 1 x 0 0 1 x 0 0 0
checks and skips. Position 1 2 3 4 5 6 7 8 9 10 11
• Position 1: check 1 bit, skip 1 bit, check 1 bit, skip 1
bit, etc. (1,3,5,7,9,11,13,15,...) There will be four check-bits must be inserted to the bit data.
• Position 2: check 2 bits, skip 2 bits, check 2 bits, The total length will be 11 bits (𝑏𝑖𝑡𝑑𝑎𝑡𝑎 + 𝑏𝑖𝑡𝑝𝑎𝑟𝑖𝑡𝑦). The
skip 2 bits, etc. (2,3,6,7,10,11,14,15,...) bits are still unknown. There is a technique to replace the x
with 0 or 1.
• Position 4: check 4 bits, skip 4 bits, check 4 bits,
skip 4 bits, etc. (4,5,6,7,12,13,14,15,20,21,22,23,...) Table 4. Data extraction
• Position 8: check 8 bits, skip 8 bits, check 8 bits, Pos Binary Parity Data
skip 8 bits, etc. (8-15,24-31,40-47,...) 11 1011 0
• Position 16: check 16 bits, skip 16 bits, check 16 10 1010 0
bits, skip 16 bits, etc. (16-31,48-63,80-95,...)
9 1001 0
• Position 32: check 32 bits, skip 32 bits, check 32
bits, skip 32 bits, etc. (32-63,96-127,160-191,...) 8 1000 x
Set a parity bit to 1 if the total number of ones in the positions 7 0111 1
it checks is odd. Set a parity bit to 0 if the total number of 6 0110 0
ones in the positions it checks is even.
5 0101 0
4. EVALUATION 4 0100 x
4.1 Transmit 3 0011 1
This section describes the calculation of the Hamming code.
Assume the data to transmit is the character of H. The bit 2 0010 x
value of the character is 01001000. Since the Hamming code 1 0001 x
uses 7 bits in this research, the bit value of H is 1001000. The
following calculation will explain how the character is
transmitted. Table 4 shows the extraction from the previous parity data.
This step is to determine the value of x whether 0 or 1. The
Character : H method is to calculate how many “1” in each index of binary
Decimal : 72 data (Parity not included).
Binary : 1001000
14
International Journal of Computer Applications (0975 – 8887)
Volume 154 – No.2, November 2016
Table 5 show the value of every parity. There is rule to Table 8 show the value of every parity. The value is different
determine the value.If the amount is even then the value is 0 from the first before the error. Until now, it is proved there
and if the amount is odd then the value is 1. was a modification of the bit value. It means the data is not
retrieved perfectly.
Table 6. Data and parity
Table 9. Error position
Position Insertion
T. Parity R. Parity Error Pos
1 x1 1 0 0 1 0 0 0
x 0 1 1
2 x1 1 0 0 1 0 0 0
2 0 0 0
x x 1 0 1
4 x1 1 0 0 1 0 0 0
2 3
x x 0 0 0
8 x1 1 0 0 1 x4 0 0 0
2 3 Error Position : 1010
Result 0 0 1 1 0 0 1 0 0 0 0
Position Index : 5
Table 6 shows the final result of the data and parity formation. The Hamming code detected the error in the fifth position as
There are 11 bits now after the parity addtion. determined previously. It is proved that the method works to a
significant condition.
New Binary : 00110010000
5. CONCLUSION
4.2 Receive By the test results and discussion programs that do, it can be
This section tries to detect and fix the error from previous concluded that the method of Hamming code can detect bit
binary string. The following calculation describes the full errors in the file received by the receiver file. The checking is
explanation of the Hamming. Assume that the error is set to done by comparing the value of the check bits with the
the fifth bit. original value of bits that exist in the file. Methods hamming
Set Error : 00111010000 (the 5th) code can make corrections damage bits as a bit, or it is called
Bit Received : 1101000 single bit error detection. It is the unfortunate method of
Hamming code can not detect if there is more than one-bit
error. Error detected just as much as the pieces only error even
Bit 1 1 0 1 0 0 0 though possessed more than one.
Position 1 2 3 4 5 6 7
6. FUTURE SCOPE
The next research is needed to expand the single error parity
Table 7. Data extraction checking to the multi-error parity checking. The Hamming
code is limited to one error only. If multi-error or burst error
Pos Binary Parity Data happens, Hamming can only detect the single error. By
11 1011 0 composing the block system, it lets the computer program
perform the multi-error checking.
10 1010 0
9 1001 0 7. REFERENCES
[1] R. S. Geiger and A. Lampinen, "Old Against New, or a
8 1000 x Coming of Age? Broadcasting in an Era of Electronic
7 0111 1 Media," Journal of Broadcasting & Electronic Media,
vol. 58, no. 3, pp. 333-341, 2014.
6 0110 0
[2] T. Downey, "Calculating the Hamming Code," Florida
5 0101 1 International University, 25 2 2016. [Online]. Available:
4 0100 x http://users.cis.fiu.edu/~downeyt/cop3402/hamming.html
. [Accessed 1 10 2016].
3 0011 1
[3] K. P. Debalina Roy Choudhury, "Design of Hamming
2 0010 x Code Encoding and Decoding Circuit Using
1 0001 x Transmission Gate Logic," International Research
Journal of Engineering and Technology, vol. 2, no. 7, pp.
1165-1169, 2015.
Table 7 shows the extraction from the previous parity data.
15
International Journal of Computer Applications (0975 – 8887)
Volume 154 – No.2, November 2016
[4] E. S. Abuelyaman and A.-A. S. Al-Sehibani, Check Bit Precomputation for Memories," Journal of
"Optimization of the Hamming Code for Error Prone Semiconductor Technology and Science, vol. 12, no. 4,
Media," International Journal of Computer Science and pp. 418-425, 2012.
Network Security, vol. 8, no. 3, pp. 278-285, 2008.
8. AUTHOR PROFILE
[5] R. W. Hamming, "Error Detection and Error Correction Wirda Fitriani was born in Medan, Indonesia, in 1979. She
Codes," Bell Systems Tech. Journal, vol. 29, no. 1, pp. received the S.Kom. degree in computer science from
147-160, 1950. Universitas Pembangunan Panca Budi, Medan, Indonesia, in
[6] Z. Ramadhan and A. P. U. Siahaan, "Stop-and-Wait ARQ 2005, She joined the Department of Engineering, Universitas
Technique for Repairing Frame and Acknowledgment Pembangunan Panca Budi, as a Lecturer in 2008, and in 2014,
Transmission," International Journal of Engineering she entered the post-graduate university, AMIKOM,
Trends and Technology, vol. 38, no. 7, pp. 384-387, 2016. Yogyakarta. She is now studying for her master degree. She
has become a writer in several conferences. She is still
[7] N. Shep and P. Bhagat, "Implementation of Hamming working as a System Support at PT. Buana Varia Komputama,
code using VLSI," International Journal of Engineering Medan.
Trends and Technology, vol. 4, no. 2, pp. 186-190, 2013.
Andysah Putera Utama Siahaan was born in Medan,
[8] D. R. Choudhury and K. Podder, "Design of Hamming Indonesia, in 1980. He received the S.Kom. degree in
Code Encoding and Decoding Circuit Using computer science from Universitas Pembangunan Panca Budi,
Transmission Gate Logic," International Research Medan, Indonesia, in 2010, and the M.Kom. in computer
Journal of Engineering and Technology, vol. 2, no. 7, pp. science as well from the University of Sumatera Utara,
1165-1169, 2015. Medan, Indonesia, in 2012. In 2010, he joined the Department
[9] H. Saleh, "Design of Hamming Encoder and Decoder of Engineering, Universitas Pembangunan Panca Budi, as a
Circuits For (64, 7) Code and (128, 8) Code Using Lecturer, and in 2012 became a researcher. He is applying for
VHDL," Journal of Scientific and Engineering Research, his Ph.D. degree in 2016. He has written several international
vol. 2, no. 1, pp. 1-15, 2015. journals. He is now active in writing papers and joining
conferences.
[10] S. Cha and H. Yoon, "Efficient Implementation of Single
Error Correction and Double Error Detection Code with
IJCATM : www.ijcaonline.org 16