Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 11

University of kufa

College of Engineering
Department of Electrical Engineering
Microprocessors and Microcontrollers
How error detection and its possible elimination is done in USB?

‫ ليث محمد رضا‬: ‫أشراف األستاذ‬


‫ علي عايد عبدالشهيد‬: ‫األسم‬
‫ الثالثة – فصلي‬: ‫المرحلة‬
Index.
1. Abstract
2. Introduction
3. Types of Errors
4. Error Detection Techniques.
 Checksum method
 Cyclical Redundancy Checking(CRC)
5. Deference between CRC and Checksum.
6. Error Correction Techniques
7. Conclusion
8. References

1|PAGE
Abstract
We are as computer users always transfer data between our Pc or Laptop to an external
storage device (Flash, HDD, etc.) or vise verse through USB, When bits (our data) are
transmitted over the USB, they are subject to get corrupted our error out due to
interference and noise, etc. We will discuss errors types the methods that’s being used to
detect these errors and the deference between them how those methods work and the
methods that used to correct those errors.

Introduction

USB is a communication protocol that supports serial data transfer between a USB host
computer and wide range of simultaneously accessible peripherals. The host serves as the
master of the bus. Devices are divided into two speeds: 1.5Mbps or 12Mbps. Data
transfer rate of 1.5Mbps supports low speed devices such as keyboard, mice, printer etc.
Data transfer rate of 12Mbps supports wide variety of desktop peripherals such as
MODEM, audio, video devices, telephones.
USB employs two error checking methods to ensure that data is sent correctly. The first
method is cyclic redundancy check (CRC) is sent with all data transmissions to validate
data integrity within a packet. And the second one is Checksum (sometimes we use third
which is Parity Check)

2|PAGE
Types of Errors

1. Single bit error − in the received frame, only one bit has been
corrupted, i.e. either changed from 0 to 1 or from 1 to 0.

2. Multiple bits error − in the received frame, more than one bits are
corrupted.

3. Burst error − in the received frame, more than one consecutive bits
are corrupted.

3|PAGE
Error Detection Techniques.

Checksum method
Will calculate the total bits in a packet of data and include that total
checksum amount when the data is sent over communication lines.
The receiver will then look at the packet, read the checksum value and
then perform the same calculation to make sure everything adds up. If
the calculation on the receiver’s end matches the value passed in the
packet, all is good. The problem is a high probability that somewhere
between the sender and receiver the bits of data are changed,
corrupted or swapped yet still turn a correct checksum value after
calculation on the receiving end.

How Checksum works?


1. Data is divided into fixed sized frames or segments.
2. The sender adds the segments using 1’s complement arithmetic to
get the sum. It then complements the sum to get the checksum and
sends it along with the data frames.

4|PAGE
3. The receiver adds the incoming segments along with the checksum
using 1’s complement arithmetic to get the sum and then
complements it.
4. If the result is zero, the received frames are accepted; otherwise,
they are discarded.

1|PAGE
Cyclical Redundancy Checking(CRC)
Is about as straight forward as addition but using long division. The
advantage with this approach is looking throughout the entire packet
to verify if all the information arrived correctly, rather than depending
on one lump sum number as verification. As with traditional long
division, binary division works through the dividend number from the
divisor number.

Who CRC works?


1. To start the calculation a divisor number is set or “given.”
2. Next, you add in Zeros that are one less than the divisor
number. So for example if the divisor number is 5 digits long,
then you would add four zeros at the end of the packet.
3. The calculation would then start for binary long division.
4. Once the binary long division is done there will be a remainder
number.
5. Here is where the “cyclical” part comes in.
6. Now if the calculation swaps the remainder number with the
four zeros mentioned above (when the calculation first started),
then when the long division is ran again, there is no remainder
(remainder is zero).

Long division process in CRC

5|PAGE
Deference between CRC and Checksum.
CHECKSUM CRC

One of the oldest methods of Newer than Checksum


ensuring that data is correct.

Uses addition in its math CRC uses long division in its math
calculations to check data calculations to check data

most commonly 8 bits in length The CRC is most commonly 16 or


32 bits in length

designed for the sole purpose of purpose of CRC is to catch a diverse


noting regular errors that may occur range of errors that may come about
during software implementation during the transmission of data in
analog mode
Checksum has been shown to detect CRC can detect any double-bit
mainly single-bit errors errors being observed in the data
computation
Best method to verify data written to Best method for checking
a flash drive data written to a USB flash
drive

6|PAGE
Error Correction Techniques
Error correction techniques find out the exact number of bits that have
been corrupted and as well as their locations. There are two principle
ways

1. Backward Error Correction (Retransmission) –


If the receiver detects an error in the incoming frame, it requests the
sender to retransmit the frame. It is a relatively simple technique. But
it can be efficiently used only where retransmitting is not expensive as
in fiber optics and the time for retransmission is low relative to the
requirements of the application.

2. Forward Error Correction −


If the receiver detects some error in the incoming frame, it executes
error-correcting code that generates the actual frame. This saves
bandwidth required for retransmission. It is inevitable in real-time
systems. However, if there are too many errors, the frames need to be
retransmitted.

7|PAGE
Conclusion

The use of error detecting codes has proven to be an effective way to


overcome data corruption in transfer data. In this report Checksum & CRC
has been described. The proposed of CRC & Checksum .How they work and
the deference between the two. Errors types has been described.

8|PAGE
References

1. High Speed cyclic Redundancy Check for


USB(http://citeseerx.ist.psu.edu/viewdoc/download?
doi=10.1.1.87.9743&rep=rep1&type=pdf)
2. Differences Between CRC And
Checksum(http://www.differencebetween.net/technology/software-
technology/differences-between-crc-and-checksum/)
3. Question: CRC Verse Checksum Verification for USB Flash Drives?(
https://www.getusb.info/question-crc-verse-checksum-verification-
for-usb-flash-drives/)
4. Does USB have error correction in it?(
https://www.avrfreaks.net/forum/does-usb-have-error-correction-it)
5. Chapter 5 Efficient Error Detection and Correction in Block Data
Transmission Nikolaos G.
Bardis(file:///C:/Users/Ali/Downloads/5.Chapter-
EfficientErrorDetectionandCorrectioninBlockDataTransmission.pdf)

You might also like