What is the parity of a bit pattern?

jotun

Veteran XV
I'm supposed to put the parity of register A into register B

But I don't know wtf that's asking me to do

if A is 11000101, what is its parity?
 
WeNdeL said:
is it even or odd parity?
11. Write a fastest program segment to put the following property, of a number in Accumulator A, into accumulator B (do not use branch instructions). For part (c), assume that location $822 is a scratch byte.

(a) the count of the number of 1's (b) the parity (c) the number of leading zeros


as far as I know the book doesn't even mention what parity is. it's not listed in the index...
 
ugh

i can't think of any elegant way to do any of these

i could do them.. it would just be long and ugly
 
It sounds like you'd just need 8 repeating instruction blocks since you can't use branch instructions, and need to check every bit?
 
ok..

i got the first two with shifting and carry addition...

but this leading zeros thing has me stuck
 
Increment a counter every time you hit a zero, and reset it when you hit a one (while shifting the variable down)?
 
01011001011011110111010100100000011100110111010101100011011010110010000001100001011101000010000001110100011010000110010100100000011000100110100101101110011000010111001001111001001011100000110100001010
 
Back
Top