CIS3355:
Business Data Structures |
What is Parity and how does it help in detecting errors?? Early computers suffered from a number of "transmission malfunctions". The vacuum tubes which were used to control the electricity flowing through the microswitches frequently broke. Wire connections sometimes got loose. Bugs sometimes landed on exposed wires, splattered, and interfered with data transfer. In short, if you were storing data, or trying to transfer data, say from RAM to the CPU, you could never be sure that the data that you had was really the correct data. For example, suppose you looked into RAM and saw the following sequence of switches (using a 7-bit sequence): Let's assume (just for illustration purposes) that we agreed that whenever we saw this sequence of settings, we agreed that it would represent the letter 'Y', which we would use to mean 'YES'. At any rate, we send this sequence to the CPU along a Bus (a subsystem that transfers data or power between computer components or between computers). However, when we look inside the CPU, we see the following sequence of switches: I know that is a little difficult to decipher, so let's go back to our alternative notation:
Here what we had stored
in RAM: 0 1 1
1 1 0 0 Obviously, there was a problem with the transmission. It may be that the character received by the CPU was actually an 'N', which we agreed would signify 'No' (the opposite of what we intended to send), So, how can we correct that? Unfortunately, hardware problems (especially in early computers) were inevitable. We couldn't build perfect machines (we still can't). The best we could hope for was to Detect an error when it occurred. How can we detect errors? It is pretty difficult to catch all errors, but there are some tactics which we can apply. Suppose that we come to an agreement that I will only send you transmissions that have an even number of 'on' switches, or '1' bits (or high bits). When you receive the transmission, you will count the number of '1' bits. If you end up with an even number of '1' bits, you will assume that the message you received is correct. If you receive a message with an odd number of '1' bits, you will know that it is incorrect. How can we send an 'even' number of 1 bits when the agreed-upon sequence calls for an 'odd' number of 1 bits?? The scheme will only work if we add one additional bit to our sequence of seven bits (which we have been using to represent our character set): The Parity Bit. By adding 1 additional bit to our seven bit sequence, we can normalize our sequence of bits; we can force the sequence of bits to contain an even (or odd) number of 1 bits. How do we do that?? Very simple. Suppose I have two 7-bit sequences, one containing an odd number of 1 bits and another containing an even number of 1-bits. By adding either a '1' or a '0' to the sequence, we can assure that both will contain an even number of '1' bits.
So all errors will be detected?? No. Consider the following sequence:
In the above example the message, the message sent contained 4 1-bits, but the message received contained 2 1-bits. Both contain an evel number of 1-bits, but they are obviously not the same message. So what good is it?? It may not catch ALL errors, but it is bound to catch most of them. Once an error is detected, we will know that there is a problem. Is parity always even?? No. It doesn't matter if we use even or odd parity, AS LONG AS WE AGREE HOW TO CONSTRUCT THE SEQUENCE TO BE SENT AND HOW TO ANALYZE THE MESSAGE SENT. Using Odd parity, the sequences used above could be constructed as:
Notice that transmission errors can still occur using odd parity as easily as they can occur using even parity:
Is parity still used?? Yes and no. Whenever
you boot-up the operating system, One of the diagnostic tests performed before
the OS is loaded is a parity check (If the test fails, the system will NOT load,
and you WILL cry). In some machines and networks, parity checking is still
performed each time a message is sent. In most telecommunications, however,
simple parity has been replaced with package switching (a technique in which a
stream of data is broken into standardised units called 'packets,' each of which
contains address, sequence, control, size and error checking information in
addition to the user data. Specialised packet switches operate on this added
information to move the packets to their destination in the proper sequence and
again present them in a contiguous stream:
http://www.probertencyclopaedia.com/SP.HTM), or other techniques. At this point in time, you should be able to Answer the following questions:
In this example, the message sent
is NOT the message received, but it would not be detected since the total
number of '1' bits received is odd. Yes and no. Whenever you boot-up the operating system, One of the diagnostic tests performed before the OS is loaded is a parity check (If the test fails, the system will NOT load). In some machines and networks, parity checking is still performed each time a message is sent. In most telecommunications, however, simple parity has been replaced with other techniques a. It alters a bit sequence in such a way as to make the total number of '1' bits even or odd b. It is still used but is not as common as it once was c. It has been replaced by other techniques such as package switching d. A and B e. A and C Answer: b a. It has been replaced by other techniques such as package switching b. It adds a bit to the existing bit sequence to make the total number of '1' bits even or odd c. It is still used but is not as common as it once was d. Transmission errors can still occur e. Even and odd parity work equally as well Answer: a a. 10011001 b. 00010001 c. 10100111 d. 01101100 e. 00100001 Answer: c a. 10010001 b. 00110001 c. 10111001 d. 01101100 e. 00110001 Answer: d
|