lukkascerutti 0 Posted February 10 Report Share Posted February 10 def parity(x): result = 0 while x: result ^= x & 1 x >>= 1 return result if _name_ == "_main_": print(parity(9)) Este código está correto? para a tecnica de bit de paridade - com uma cadeia de 8bits informada pelo usuário? Quote Link to post Share on other sites
Question
lukkascerutti 0
def parity(x):
result = 0
while x:
result ^= x & 1
x >>= 1
return result
if _name_ == "_main_":
print(parity(9))
Este código está correto? para a tecnica de bit de paridade - com uma cadeia de 8bits informada pelo usuário?
Link to post
Share on other sites
0 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.