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
0 answers

Program that extracts a vector of numbers with even sum of digits and other with uneven sum of digits from the initial vector

This is the text of the program that I need to write: Write a function "ExtractElements" with two parameters, the first of which is a vector of integers (type "int"), and the second a logical value "true" or "false". As a result, the function should…
ginasi
  • 1
  • 2
0
votes
0 answers

Confuse with parity bit finding in Assembly x86-64 question

I have been trying to figure out the whole shifting process and it just doesn't make sense to me. How does it count the number of bits there were set and the right shift just throws away whatever calculation you had earlier? A function loop_while…
tomatto
  • 149
  • 10
0
votes
1 answer

A Prolog program for permutation parity

I wrote this small program in Prolog. odd_even_flip(odd, even). odd_even_flip(even, odd). % flip_one, for A = a, B = b, P = [a, .., b, ..], gives M = [b, .., a, ..] flip_one(A, B, P, M) :- append([A|As], [B|Bs], P), append([B], As, L), …
bibiki
  • 13
  • 7
0
votes
3 answers

How to use correctly the parity bit in ASCII?

It's my first time in this forum and I wanted to start with this question. For what I know, in C, a char data type is 8 bits long, but when you are using this data type in order to transmit ASCII information, is still 8 bits long but 1 bit is a…
Cblue X
  • 143
  • 6
0
votes
0 answers

Method for GNU Radio signal error rate (USRP B200 DVB-S2)

I'm using two USRP B200 boards to make RF communication between them with SMA cable wired. And I'm using GNU Radio Companion with DVB-S2 flowgraphs to send&receive some test videos. Thankfully, these flowgraphs did…
Seth
  • 21
  • 4
0
votes
0 answers

Min operations required for all items in an array to have different parity from the next item in array

I'm trying to figure out how to find the min operations required to fulfill the requirement that for a List of length n, for each index i < n, list[i] has a different parity than list[i+1] This is my code thus far: public static int…
Melanie
  • 313
  • 2
  • 6
  • 17
0
votes
1 answer

Leetcode - 922 Sorting By Parity 2

Given an array of integers nums, half of the integers in nums are odd, and the other half are even. Sort the array so that whenever nums[i] is odd, i is odd, and whenever nums[i] is even, i is even. Return any answer array that satisfies this…
0
votes
0 answers

RFID reader port settings

I'm using an RFID reader connected to my computer over RS232 to usb port. It is using COM3 port with default settings (9600, 1 stopbit, no parity etc). After scanning a test card it gives me a nonesensical response, something like ··½w»··{íë I think…
Mrky
  • 3
  • 4
0
votes
2 answers

Parity bit check, within an array

I am writing a program in the C language which is supposed to check the even-horizontal-bit parity of an Binary data array. The array is created by a different program part. The important point is that it generates an 8x8 array. This array then gets…
Mark
  • 131
  • 9
0
votes
3 answers

How to display even Fibonacci numbers by specifying their number?

I have a function that checks Fibonacci numbers for even. def fibonacci(num=4): fib1 = fib2 = 1 print(0, end=' ') for i in range(1, num): fib1, fib2 = fib2, fib1 + fib2 if (fib2 % 2) == 0: print(fib2, end='…
0
votes
0 answers

How to count bits using Marie assembly language?

I'm currently working a project where I use MARIE Assembly Language to create a version of Hamming code. My initial work has been to first have the user input the 8 bits for the data bits, and to then have the program output the correct 12-bit code…
giotto1
  • 49
  • 5
0
votes
1 answer

how to calculate longitudinal redundancy check (LRC) for Modbus ASCII in java?

how to calculate longitudinal redundancy check (LRC) for Modbus ASCII in java? I want to calculate LRC for Modbus ascii protocol using java. I have searched for the solutions online but haven't found any. I used this online lrc calculator to…
0
votes
1 answer

Convert storage macro from frame v1 to frame v2

The title is very descriptive. I would like to convert this: decl_storage! { trait Store for Module as SimpleTreasury { // No storage items of our own, but we still need decl_storage to initialize the pot } …
P.E
  • 101
  • 2
  • 8
0
votes
0 answers

UART communication between STM32 et monitor goes well even in case of parity mismatch

When I configure the stm32 uart in even parity mode and the monitor on PC side (using here realterm software) in odd parity, the communication goes well. It goes well when realterm is also configured in even parity of course. But in the same way,…
NinjaGreg
  • 11
  • 1
  • 3
0
votes
0 answers

no complete word after decoding

as an expirement i am trying to work with file handeling and adidas. but for some reason my decode doesn't work completely. what the problem is: when i use the word ferret as input, encode this, channel and decode it outputs the word ferret. as soon…