Questions tagged [parity]

A parity bit, or check bit, is a bit that is added to ensure that the number of bits with the value one in a set of bits is even or odd. Parity bits are used as the simplest form of error detecting code.

A parity bit, or check bit, is a bit that is added to ensure that the number of bits with the value one in a set of bits is even or odd. Parity bits are used as the simplest form of error detecting code.

There are two variants of parity bits: even parity bit and odd parity bit. In case of even parity, the parity bit is set to 1, if the number of ones in a given set of bits (not including the parity bit) is odd, making the number of ones in the entire set of bits (including the parity bit) even. If the number of ones in a given set of bits is already even, it is set to a 0. When using odd parity, the parity bit is set to 1 if the number of ones in a given set of bits (not including the parity bit) is even, keeping the number of ones in the entire set of bits (including the parity bit) odd. when the number of set bits is odd, then the odd parity bit is set to 0.[1]

236 questions
0
votes
1 answer

Shred a file in X fragments with Y parity fragments for redundancy

The theory says that we can split a file in N fragments and after that, we can recover the file with only P of those fragments. Where P < N. I'm trying to build something like Symform, just a subset of that actually. Each block is shred into 64…
Cacho Santa
  • 6,846
  • 6
  • 41
  • 73
0
votes
2 answers

bit parity code needs explanation as to how it works?

Here is the code that reports the bit parity of a given integer: 01: bool parity(unsigned int x) 02: { 03: x ^= x >> 16; 04: x ^= x >> 8; 05: x ^= x >> 4; 06: x &= 0x0F; 07: return ((0x6996 >> x) & 1) != 0; 08: } I found this here..…
eagertoLearn
  • 9,772
  • 23
  • 80
  • 122
0
votes
1 answer

Hamming SEC/DED extra parity bit

I'm having some troubles with the SEC/DED error correction code. It seems I've found some cases in which the decoder thinks a double bit flip occured but only one really occured. I suppose I did somthing wrong, but I was not able to understand…
Marco Giglio
  • 11
  • 1
  • 3
0
votes
2 answers

assembly lang 8085 .. how to find even/odd parity

I have the following code to count the number of 1s and save it to reg B. I need to modify it to find if the parity is even or odd... LXI H, var1 MVI B, 00H MVI D, 00H MVI C, 08H MOV A, M LOOP: RAR JNC SKIP INR B SKIP: DCR C JNZ LOOP HLT var1:…
user2171979
  • 3
  • 1
  • 1
  • 2
0
votes
1 answer

Does the ASCII code with the parity bit allow us to correct a one-bit error and recover the original data?

Does the ASCII code with the parity bit allow us to correct a one-bit error and does the ASCII code recover the original data?
0
votes
1 answer

Parity error detection, 4-bit example of how a particular scheme doesn't work

Hey so I'm doing a bit of revising for a midterm next week, and I have this question that I'm not being able to find the material or understand how to answer. I can see how a single error, double or triple error happens, but I am not sure how a…
pneumatics
  • 2,836
  • 1
  • 27
  • 27
0
votes
1 answer

(ask) XOR calculation issue on file in java

I would like to execute XOR operation in my code. However I have strange behavior on the output. Sometimes the result is right but sometime it's not. Here's the situation: I have file which I already split into two parts and then I created one…
david
  • 244
  • 2
  • 4
  • 11
-1
votes
1 answer

How does this code check for parity of a number? (even or odd)

I came across this piece of code on reddit 1 - ((num & 1) << 1) as i32 This code returns 1 for even numbers and -1 for odd numbers. It takes less instructions than other ways of calculating the same thing, and is presumably, quite fast. So, how…
Naitik Mundra
  • 418
  • 3
  • 14
-1
votes
2 answers

Flimsy error detection methods (computer networks)

I was studying error detection in computer networks and I came to know about the following methods - Single Bit parity Check 2d parity Check Checksum Cyclic Redundancy Check But after studying only a bit (lmao pun), I came across cases where they…
-1
votes
1 answer

How can I fix my code to work for all of the tests?

Decide whether the items in the list all give the same remainder divided by two. My code is working when the mod is 1, but it is not working when the mod is 0. What do I have to add to work? An if - else statement or something else? sameParity ::…
mano19
  • 55
  • 6
-1
votes
1 answer

Parity of integer with arbitrary bits in python

Lot of solutions suggest using xor with right shift, as described here https://www.geeksforgeeks.org/finding-the-parity-of-a-number-efficiently/ def findParity(x): x = x ^ (x >> 16); x = x ^ (x >> 8); x = x ^ (x >> 4); x = x ^ (x…
-1
votes
1 answer

How authority in Parity Proof of Authority chain choose to mine

I implemented a Parity Proof of Authority private chain, running 2 authority nodes and 3 users nodes. I managed to credit ether in the users nodes, and with one of the user node, i made a transaction.. and it worked ! The thing is, I don't…
-1
votes
4 answers

Checking for alternating parity

I am struggling to find a way to check if every other number in my list is of an alternating parity (i.e. even, odd, even, odd, etc.) [1,2,3,4] # odd, even, odd, even (True, because they alternate) [1,3,2,4] # odd, odd, even, even (False, because…
djennacs
  • 107
  • 1
  • 7
-1
votes
1 answer

Verilog: Even parity for input A

The following code obtains the even parity for the input A. (i.e. parity = 1 if A contains 0 1’s or an even number of 1’s) reg [7:0] A; wire parity; assign parity = ~^A; How will I use a for loop in a procedural block to obtain the same function
Coder
  • 43
  • 1
  • 8
-1
votes
1 answer

UART programming in C on Linux plateform and parity bit

I am quite new to UART programming and trying to understand the concept of parity bit which is still not totally clear for me. From what I understand so far : Let's say I have 8 bits to transmit from UART deviceA to UART deviceB. Each time I want to…
Fryz
  • 2,119
  • 2
  • 25
  • 45
1 2 3
15
16