Binary parity is a concept in computer science that involves checking and maintaining the evenness or oddness of the number of set bits in a binary sequence.
Answer
Learn about Binary Parity
The parity of a binary number is based on whether it contains an even or odd number of 1 (or set) bits. This means a number has odd parity if the number of 1 bits in the binary number is an odd number. Similarly, a number has even parity if the number of 1 bits in the binary number is an even number. Parity is used to ensure that data is transmitted without error, and other tasks regarding error detection and correction. This calculator is meant to make calculating parity a lot easier!
The steps for ensuring even or odd parity on a binary number is as follows. Count the number of ones in the string. The next step depends on the parity of the string.
If the parity is even:
- If the number of ones is even, append a 0 to the end of the binary string.
- If the number of ones is odd, append a 1 to the end of the binary string to make it even.
If the parity is odd:
- If the number of ones is odd, append a 0 to the end of the binary string.
- If the number of ones is even, append a 1 to the end of the binary string to make it odd.
Since there are 7 set bits (ones) in the string, and the parity is even, we want have to add another set bit to make the number of ones even. Append a set bit (1) to the end.Since there are 2 set bits (ones) in the string, and the parity is odd, we want have to add another set bit to make the number of ones odd. Append a set bit (1) to the end.There are 4 set bits (ones) in the string, and the parity is even, so we don't have to add another 1. We can add a 0 instead. Append a 0 to the end.Since there are 5 set bits (ones) in the string, and the parity is odd, we don't have to add another 1. We can add a 0 instead.Since there are 5 set bits (ones) in the string, and the parity is odd, we don't have to add another 1. We can add a 0 instead. Append a 0 to the end.Since there are 5 set bits (ones) in the string, and the parity is even, we want have to add another set bit to make the number of ones even. Append a set bit (1) to the end.
Watch detailed video tutorials about Binary Parity !
What is Parity?
9 minutes
Error Detecting Code: Parity Explained
9 minutes
On Demand Computer Science Theory Education for Students.