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

output not the same as input c

so i have been trying some things with c parity bits. but for some reason the output is not the same as the input. the input is: 0000000 0061 0000001 and the output is: 0000000 7f7f 0000002 for some reason the output is one higher then the input, i…
0
votes
1 answer

Polkadot error: could not compile `zeroize` OR file too small to be an archive, could not compile `ring`

I'm going through the "Hacking on Polkadot" section of the read me of Polkadot repo, I try to cargo build --release which didn't work so i tried cargo build here are the respective errors i got: After cargo build --release i get this error: error:…
0
votes
2 answers

Match by call name and parameters, for a call from other pallets

I have a module method that associates fixed fees to Calls from various pallets. So I'm trying to match a Call passed to my method as a parameter by pallet, Call name, and Call parameters. Something similar to this: impl Module { …
Nicolas Marshall
  • 4,186
  • 9
  • 36
  • 54
0
votes
1 answer

Is substrate based blockchain compatible with solana?

Recently someone told me about Solana. I went throgh their website https://solana.com/. I just wanted to know whether substrate pallet is compatible with solana. If yes, how?
Ayush Mishra
  • 567
  • 1
  • 7
  • 19
0
votes
1 answer

How to restart a substrate node

I'm confused, how do I restart a substrate node? I use ctrl c in the terminal window where the node is running to stop it and then I write the commands which I used to run the node in the first place, is that the way to restart the nodes?
beqaabu
  • 74
  • 1
  • 8
0
votes
1 answer

Accessing CLI values in the runtime

I have an offchain worker that reads something via http and i would like users to be able to use different urls for it. I have a custom flag in the CLI which takes this URL (something like ./target/release/substrate --custom-url http://google.com)…
Nahu
  • 143
  • 10
0
votes
1 answer

Should I check for parity of a number in a different way?

In Java, as well as other languages, I always use the N % 2 == 0 trick to obtain the parity of a number, but I'm pretty sure that in terms of time complexity there is some better solution. It's probably better already by using N & 1 == 0, but does…
J. Schmidt
  • 419
  • 1
  • 6
  • 17
0
votes
1 answer

Getting finalised block data

I am trying to get block data (extrinsics) for finalised blocks only in the client (not runtime). I can see that there is an RPC endpoint called chain_getBlock. Am i correct in thinking that this endpoint does not filter on finalised blocks…
Nahu
  • 143
  • 10
0
votes
0 answers

What could make a parity bit always high or always low?

I am writing a UART communication protocol using an STM32F429-ZI Nucleo Board. I connected my board to my computer using a USB and also hooked up a logic analyzer to check what data is being sent. Looking a the logic analyzer results, the parity…
0
votes
1 answer

simple parity bit scheme

I am trying to make a simple paritybit method in PyCharm, and I've written this code: import bitarray as ba # Library with bit strings data = ba.bitarray(endian = 'little') # String for data data.frombytes('Secret message!'.encode()) …
Mampenda
  • 661
  • 4
  • 21
0
votes
2 answers

How to work on array of bitmaps without '['

I wrote a program which checks parity of 32-bit integer without bitwise operators. I can't also use ] sign apart from declaration. My program is already good, but I don't know how can I make it work without [ sign. I tried many ways but my program…
0
votes
1 answer

How check SerialPort parity errors with .NET

.NET SerialPort class has Parity property. But this class doesn't contains methods to detect parity errors. Is there some way to check parity errors and handle it? Or this checking and fixing is at the hardware level and developer shouldn't worry…
Aave
  • 548
  • 1
  • 5
  • 15
0
votes
1 answer

Parity check problem in 8051 microcontroller (ASSEMBLY)

I am trying to solve this problem with 8051 in Assembly language. So, here is the question: There is 8-bit data comes from the Computer with 9600 baudrate. Each data gets parity check with 8051 microcontroller. If data parity is 1, R0 increases. If…
0
votes
1 answer

How to check if two numbers on a 2D array are of different parity

In my real case I have an array of shape (8,2) and I need to check if two integers are of different parity. For example here I want that the line 0 return False (8 and 2 are even, so same parity) line 1 return True (10 is an even number and 3 an odd…
user13091462
0
votes
2 answers

Fees for re-dispatched functions

Substrate allows you to "re-dispatch" an extrinsic, for example when calling the sudo function in the sudo module we have: let res = match proposal.dispatch(system::RawOrigin::Root.into()) { Ok(_) => true, …
Adam Dossa
  • 228
  • 1
  • 8