Page 1 of 1

Bit problems .....

Posted: Thu Feb 21, 2019 8:20 pm
by Osta
Can't compare the bits of the variable...
What am I doing wrong?

Re: Bit problems .....

Posted: Thu Feb 21, 2019 8:42 pm
by Lagoda
Hi Osta,

I think that's a good result.

0b00000001 and 0b00110010 =0b00000000,
0b00000001 and 0b00011001=0b00000001,
0b00000000 or 0b00000001=0b00000001.

Regards,

Lagoda

Re: Bit problems .....

Posted: Thu Feb 21, 2019 9:41 pm
by Osta
Hi Lagoda!!!
No difference.....

Re: Bit problems .....

Posted: Thu Feb 21, 2019 9:48 pm
by Osta
No difference...

Re: Bit problems .....

Posted: Thu Feb 21, 2019 9:59 pm
by Osta
Need to do two or

Re: Bit problems .....

Posted: Thu Feb 21, 2019 10:10 pm
by Lagoda
Hi Osta,

What value do you want to get as a result?
Do you agree with the way I described the calculation?

Lagoda

Re: Bit problems .....

Posted: Thu Feb 21, 2019 10:15 pm
by Osta
Рш Lagoda!
Yes, I agree!!!
I have kontralirovat selectively a few bits of one variable.

Re: Bit problems .....

Posted: Thu Feb 21, 2019 10:16 pm
by Lagoda
Hi Osta,

What value do you want to get as a result?
Do you agree with the calculation method that I described?

Lagoda

Re: Bit problems .....

Posted: Thu Feb 21, 2019 10:25 pm
by Osta
Hi Lagoda!
Variable check on several masks xor , or.

Re: Bit problems .....

Posted: Thu Feb 21, 2019 10:35 pm
by Lagoda
Hi Osta,

I think the operator of XOR is "^". The operator of OR is "|".

Lagoda

Re: Bit problems .....

Posted: Thu Feb 21, 2019 10:41 pm
by Osta
Example

Re: Bit problems .....

Posted: Thu Feb 21, 2019 11:09 pm
by Osta
Thank You, Lagoda!!
I realized my mistake...

Re: Bit problems .....

Posted: Thu Feb 21, 2019 11:11 pm
by Lagoda
:)