<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://en.zaoniao.it/index.php?action=history&amp;feed=atom&amp;title=Parity_bit</id>
	<title>Parity bit - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://en.zaoniao.it/index.php?action=history&amp;feed=atom&amp;title=Parity_bit"/>
	<link rel="alternate" type="text/html" href="http://en.zaoniao.it/index.php?title=Parity_bit&amp;action=history"/>
	<updated>2026-05-15T12:29:36Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.32.0</generator>
	<entry>
		<id>http://en.zaoniao.it/index.php?title=Parity_bit&amp;diff=6268&amp;oldid=prev</id>
		<title>Admin: Created page with &quot;{| class=&quot;wikitable&quot; style=&quot;float: right; text-align: center; margin: 1em;&quot; |- ! rowspan=&quot;2&quot; | 7 bits of data&amp;lt;br/&amp;gt; ! rowspan=&quot;2&quot; | (count of 1-bits) ! colspan=&quot;2&quot; | 8 bi...&quot;</title>
		<link rel="alternate" type="text/html" href="http://en.zaoniao.it/index.php?title=Parity_bit&amp;diff=6268&amp;oldid=prev"/>
		<updated>2019-06-25T08:51:46Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float: right; text-align: center; margin: 1em;&amp;quot; |- ! rowspan=&amp;quot;2&amp;quot; | 7 bits of data&amp;lt;br/&amp;gt; ! rowspan=&amp;quot;2&amp;quot; | (count of 1-bits) ! colspan=&amp;quot;2&amp;quot; | 8 bi...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;float: right; text-align: center; margin: 1em;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | 7 bits of data&amp;amp;lt;br/&amp;amp;gt;&lt;br /&gt;
! rowspan=&amp;quot;2&amp;quot; | (count of 1-bits)&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | 8 bits including parity&lt;br /&gt;
|- &lt;br /&gt;
! even&lt;br /&gt;
! odd&lt;br /&gt;
|-&lt;br /&gt;
| 0000000 &lt;br /&gt;
|0&lt;br /&gt;
| 0000000'''0'''&lt;br /&gt;
| 0000000'''1'''&lt;br /&gt;
|- &lt;br /&gt;
| 1010001&lt;br /&gt;
| 3&lt;br /&gt;
| 1010001'''1'''&lt;br /&gt;
| 1010001'''0'''&lt;br /&gt;
|- &lt;br /&gt;
| 1101001&lt;br /&gt;
|4&lt;br /&gt;
| 1101001'''0'''&lt;br /&gt;
| 1101001'''1'''&lt;br /&gt;
|-&lt;br /&gt;
| 1111111 &lt;br /&gt;
|7&lt;br /&gt;
| 1111111'''1'''&lt;br /&gt;
| 1111111'''0'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A '''parity bit''', or '''check bit''', is a [[bit]] added to a string of [[binary code]] to ensure that the total number of 1-bits in the string is [[even number|even]] or [[odd number|odd]]. Parity bits are used as the simplest form of [[Error detection and correction|error detecting code]].&lt;br /&gt;
&lt;br /&gt;
There are two variants of parity bits: '''even parity bit''' and '''odd parity bit'''. &lt;br /&gt;
&lt;br /&gt;
In the case of even parity, for a given set of bits, the occurrences of bits whose value is 1 is counted. If that count is odd, the parity bit value is set to 1, making the total count of occurrences of 1s in the whole set (including the parity bit) an even number. If the count of 1s in a given set of bits is already even, the parity bit's value is 0. &lt;br /&gt;
&lt;br /&gt;
In the case of odd parity, the coding is reversed. For a given set of bits, if the count of bits with a value of 1 is even, the parity bit value is set to 1 making the total count of 1s in the whole set (including the parity bit) an odd number. If the count of bits with a value of 1 is odd, the count is already odd so the parity bit's value is 0.&lt;br /&gt;
&lt;br /&gt;
Even parity is a special case of a [[cyclic redundancy check]] (CRC), where the 1-bit CRC is generated by the [[polynomial]] ''x''+1.&lt;br /&gt;
&lt;br /&gt;
If a bit is present at a point otherwise dedicated to a parity bit, but is not used for parity, it may be referred to as a '''mark parity bit''' if the parity bit is always 1, or a '''space parity bit''' if the bit is always 0. In such cases where the value of the bit is constant, it may be called a '''stick parity bit''' even though its function has nothing to do with parity. The function of such bits varies with the system design, but examples of functions for such bits include timing management, or identification of a packet as being of data or address significance. If its actual bit value is irrelevant to its function, the bit amounts to a [[Don't-care term]].&lt;br /&gt;
&lt;br /&gt;
Parity bits are generally applied to the smallest units of a communication protocol, typically 8-bit [[octet (computing)|octets]] (bytes), although they can also be applied separately to an entire message string of bits. &lt;br /&gt;
&lt;br /&gt;
The decimal math equivalent to the parity bit is the [[Check digit]].&lt;br /&gt;
&lt;br /&gt;
==Parity==&lt;br /&gt;
In mathematics, [[parity (mathematics)|parity]] refers to the evenness or oddness of an integer, which for a [[binary numeral system|binary number]] is determined only by the [[least significant bit]]. In telecommunications and computing, parity refers to the evenness or oddness of the number of bits with value one within a given set of bits, and is thus determined by the value of all the bits. It can be calculated via an [[XOR]] sum of the bits, yielding 0 for even parity and 1 for odd parity. This property of being dependent upon all the bits and changing value if any one bit changes allows for its use in [[Error detection and correction#Parity bits|error detection]] schemes.&lt;br /&gt;
&lt;br /&gt;
==Error detection==&lt;br /&gt;
If an odd number of bits (including the parity bit) are [[Transmission (telecommunications)|transmitted]] incorrectly, the parity bit will be incorrect, thus indicating that a '''parity error''' occurred in the transmission. The parity bit is only suitable for detecting errors; it cannot [[error detection and correction|correct]] any errors, as there is no way to determine which particular bit is corrupted. The data must be discarded entirely, and [[automatic repeat-request|re-transmitted from scratch]]. On a noisy transmission medium, successful transmission can therefore take a long time, or even never occur. However, parity has the advantage that it uses only a single bit and requires only a number of [[XOR gate]]s to generate. See [[Hamming code]] for an example of an error-correcting code.&lt;br /&gt;
&lt;br /&gt;
Parity bit checking is used occasionally for transmitting [[ASCII]] characters, which have 7 bits, leaving the 8th bit as a parity bit.&lt;br /&gt;
&lt;br /&gt;
For example, the parity bit can be computed as follows, assuming we are sending simple 4-bit values 1001.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type of bit parity !! Successful transmission scenario&lt;br /&gt;
|-&lt;br /&gt;
| Even parity || &lt;br /&gt;
A wants to transmit: 1001&lt;br /&gt;
&lt;br /&gt;
A computes parity bit value: 1+0+0+1 (mod 2) = 0 &lt;br /&gt;
&lt;br /&gt;
A adds parity bit and sends: 10010&lt;br /&gt;
&lt;br /&gt;
B receives: 10010&lt;br /&gt;
&lt;br /&gt;
B computes parity: 1+0+0+1+0 (mod 2) = 0&lt;br /&gt;
&lt;br /&gt;
B reports correct transmission after observing expected even result.&lt;br /&gt;
|-&lt;br /&gt;
| Odd parity ||&lt;br /&gt;
A wants to transmit: 1001&lt;br /&gt;
&lt;br /&gt;
A computes parity bit value: 1+0+0+1 + '''1''' (mod 2) = 1&lt;br /&gt;
&lt;br /&gt;
A adds parity bit and sends: 10011&lt;br /&gt;
&lt;br /&gt;
B receives: 10011&lt;br /&gt;
&lt;br /&gt;
B computes overall parity: 1+0+0+1+1 (mod 2) = 1&lt;br /&gt;
&lt;br /&gt;
B reports correct transmission after observing expected odd result.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This mechanism enables the detection of single bit errors, because if one bit gets flipped due to line noise, there will be an incorrect number of ones in the received data. In the two examples above, B's calculated parity value matches the parity bit in its received value, indicating there are no single bit errors. Consider the following example with a transmission error in the second bit using XOR:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type of bit parity error !! Failed transmission scenario&lt;br /&gt;
|-&lt;br /&gt;
| Even parity&lt;br /&gt;
Error in the second bit &lt;br /&gt;
|| A wants to transmit: 1001&lt;br /&gt;
&lt;br /&gt;
A computes parity bit value: 1^0^0^1 = 0&lt;br /&gt;
&lt;br /&gt;
A adds parity bit and sends: 10010&lt;br /&gt;
&lt;br /&gt;
'''...TRANSMISSION ERROR...'''&lt;br /&gt;
&lt;br /&gt;
B receives: 1'''1'''010&lt;br /&gt;
&lt;br /&gt;
B computes overall parity: 1^1^0^1^0 = 1&lt;br /&gt;
&lt;br /&gt;
B reports incorrect transmission after observing unexpected odd result.&lt;br /&gt;
|-&lt;br /&gt;
| Even parity&lt;br /&gt;
Error in the parity bit &lt;br /&gt;
||A wants to transmit: 1001&lt;br /&gt;
&lt;br /&gt;
A computes even parity value: 1^0^0^1 = 0&lt;br /&gt;
&lt;br /&gt;
A sends: 10010&lt;br /&gt;
&lt;br /&gt;
'''...TRANSMISSION ERROR...'''&lt;br /&gt;
&lt;br /&gt;
B receives: 1001'''1'''&lt;br /&gt;
&lt;br /&gt;
B computes overall parity: 1^0^0^1^1 = 1&lt;br /&gt;
&lt;br /&gt;
B reports incorrect transmission after observing unexpected odd result.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
There is a limitation to parity schemes. A parity bit is only guaranteed to detect an odd number of bit errors. If an even number of bits have errors, the parity bit records the correct number of ones, even though the data is corrupt. (See also [[error detection and correction]].) Consider the same example as before with an even number of corrupted bits:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Type of bit parity error !! Failed transmission scenario&lt;br /&gt;
|-&lt;br /&gt;
| Even parity&lt;br /&gt;
Two corrupted bits &lt;br /&gt;
|| A wants to transmit: 1001&lt;br /&gt;
&lt;br /&gt;
A computes even parity value: 1^0^0^1 = 0&lt;br /&gt;
&lt;br /&gt;
A sends: 10010&lt;br /&gt;
&lt;br /&gt;
'''...TRANSMISSION ERROR...'''&lt;br /&gt;
&lt;br /&gt;
B receives: 1'''1'''01'''1'''&lt;br /&gt;
&lt;br /&gt;
B computes overall parity: 1^1^0^1^1 = 0&lt;br /&gt;
&lt;br /&gt;
B reports correct transmission though actually incorrect.&lt;br /&gt;
|}&lt;br /&gt;
B observes even parity, as expected, thereby failing to catch the two bit errors.&lt;br /&gt;
&lt;br /&gt;
==Usage==&lt;br /&gt;
Because of its simplicity, parity is used in many [[computer hardware|hardware]] applications where an operation can be repeated in case of difficulty, or where simply detecting the error is helpful. For example, the [[SCSI]] and [[PCI bus]]es use parity to detect transmission errors, and many [[microprocessor]] instruction [[CPU cache|caches]] include parity protection. Because the [[Instruction cache|I-cache]] data is just a copy of [[main memory]], it can be disregarded and re-fetched if it is found to be corrupted.&lt;br /&gt;
&lt;br /&gt;
In [[serial communications|serial]] [[data transmission]], a common format is 7 data bits, an even parity bit, and one or two [[stop bit]]s. This format neatly accommodates all the 7-bit [[ASCII]] characters in a convenient 8-bit byte. Other formats are possible; 8 bits of data plus a parity bit can convey all 8-bit byte values. &lt;br /&gt;
&lt;br /&gt;
In serial communication contexts, parity is usually generated and checked by interface hardware (e.g., a [[UART]]) and, on reception, the result made available to the CPU (and so to, for instance, the [[operating system]]) via a status bit in a [[hardware register]] in the interface hardware. Recovery from the error is usually done by retransmitting the data, the details of which are usually handled by software (e.g., the operating system I/O routines).&lt;br /&gt;
&lt;br /&gt;
When the total number of transmitted bits, including the parity bit, is even, odd parity has the advantage that the all-zeros and all-ones patterns are both detected as errors. If the total number of bits is odd, only one of the patterns is detected as an error, and the choice can be made based on which is expected to be the more common error.&lt;br /&gt;
&lt;br /&gt;
===Redundant array of independent disks===&lt;br /&gt;
Parity data is used by some [[RAID]] (redundant array of independent disks) levels to achieve redundancy. If a drive in the array fails, remaining data on the other drives can be combined with the parity data (using the Boolean [[XOR]] function) to reconstruct the missing data.&lt;br /&gt;
&lt;br /&gt;
For example, suppose two drives in a three-drive [[RAID 5]] array contained the following data:&lt;br /&gt;
&lt;br /&gt;
Drive 1: '''01101101'''&amp;amp;lt;br /&amp;amp;gt;&lt;br /&gt;
Drive 2: '''11010100'''&lt;br /&gt;
&lt;br /&gt;
To calculate parity data for the two drives, an XOR is performed on their data:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp;'''01101101'''&amp;amp;lt;br /&amp;amp;gt;&lt;br /&gt;
XOR '''11010100'''&amp;amp;lt;br /&amp;amp;gt;&lt;br /&gt;
_____________&amp;amp;lt;br /&amp;amp;gt;&lt;br /&gt;
&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; '''10111001'''&lt;br /&gt;
&lt;br /&gt;
The resulting parity data, '''10111001''', is then stored on Drive 3.&lt;br /&gt;
&lt;br /&gt;
Should any of the three drives fail, the contents of the failed drive can be reconstructed on a replacement drive by subjecting the data from the remaining drives to the same XOR operation. If Drive 2 were to fail, its data could be rebuilt using the XOR results of the contents of the two remaining drives, Drive 1 and Drive 3:&lt;br /&gt;
&lt;br /&gt;
Drive 1: '''01101101'''&amp;amp;lt;br /&amp;amp;gt;&lt;br /&gt;
Drive 3: '''10111001'''&lt;br /&gt;
&lt;br /&gt;
as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp;'''10111001'''&amp;amp;lt;br /&amp;amp;gt;&lt;br /&gt;
XOR '''01101101'''&amp;amp;lt;br /&amp;amp;gt;&lt;br /&gt;
_____________&amp;amp;lt;br /&amp;amp;gt;&lt;br /&gt;
&amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; &amp;amp;nbsp; '''11010100'''&lt;br /&gt;
&lt;br /&gt;
The result of that XOR calculation yields Drive 2's contents. '''11010100''' is then stored on Drive 2, fully repairing the array.&lt;br /&gt;
This same XOR concept applies similarly to larger arrays, using any number of disks. In the case of a RAID 3 array of 12 drives, 11 drives participate in the XOR calculation shown above and yield a value that is then stored on the dedicated parity drive.&lt;br /&gt;
&lt;br /&gt;
== History ==&lt;br /&gt;
A &amp;quot;parity track&amp;quot; was present on the first [[magnetic tape data storage]] in 1951. Parity in this form, applied across multiple parallel signals, is known as a [[transverse redundancy check]]. This can be combined with parity computed over multiple bits sent on a single signal, a [[longitudinal redundancy check]]. In a parallel bus, there is one longitudinal redundancy check bit per parallel signal.&lt;br /&gt;
&lt;br /&gt;
Parity was also used on at least some paper-tape ([[punched tape]]) data entry systems (which preceded magnetic tape systems). On the systems sold by British company ICL (formerly ICT) the paper tape had 8 hole positions running across it, with the 8th being for parity. 7 positions were used for the data, e.g., 7-bit ASCII. The 8th position had a hole punched in it depending on the number of data holes punched.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[BIP-8]]&lt;br /&gt;
* [[Parity function]]&lt;br /&gt;
* [[Single event upset]]&lt;br /&gt;
* [[8-N-1]]&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
&lt;br /&gt;
[http://wikipedia.org/ http://wikipedia.org/]&lt;br /&gt;
[[Category:EWallets]]&lt;br /&gt;
[[Category:Cryptocurrency wallet]]&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
		
	</entry>
</feed>