Bit problems .....

Moderator: Benj

User avatar
Osta
Posts: 159
Joined: Tue Jul 05, 2016 9:42 am
Been thanked: 13 times
Contact:

Bit problems .....

Postby Osta » Thu Feb 21, 2019 8:20 pm

Can't compare the bits of the variable...
What am I doing wrong?
Attachments
UUUUU.jpg
UU
UUUUU.jpg (22.27 KiB) Viewed 1582 times
BOOL.jpg
BB
BOOL.jpg (23.53 KiB) Viewed 1582 times

Lagoda
Posts: 153
Joined: Fri Jul 15, 2016 9:51 pm
Has thanked: 66 times
Been thanked: 60 times
Contact:

Re: Bit problems .....

Postby Lagoda » Thu Feb 21, 2019 8:42 pm

Hi Osta,

I think that's a good result.

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

Regards,

Lagoda

User avatar
Osta
Posts: 159
Joined: Tue Jul 05, 2016 9:42 am
Been thanked: 13 times
Contact:

Re: Bit problems .....

Postby Osta » Thu Feb 21, 2019 9:41 pm

Hi Lagoda!!!
No difference.....
Attachments
Ha.jpg
Ha
Ha.jpg (16.98 KiB) Viewed 1573 times
OO.jpg
oo
OO.jpg (31.92 KiB) Viewed 1573 times

User avatar
Osta
Posts: 159
Joined: Tue Jul 05, 2016 9:42 am
Been thanked: 13 times
Contact:

Re: Bit problems .....

Postby Osta » Thu Feb 21, 2019 9:48 pm

No difference...
Attachments
Rez.jpg
rez
Rez.jpg (19.53 KiB) Viewed 1572 times
N5.jpg
5
N5.jpg (31.43 KiB) Viewed 1572 times

User avatar
Osta
Posts: 159
Joined: Tue Jul 05, 2016 9:42 am
Been thanked: 13 times
Contact:

Re: Bit problems .....

Postby Osta » Thu Feb 21, 2019 9:59 pm

Need to do two or
Attachments
OR.jpg
or
OR.jpg (12.9 KiB) Viewed 1570 times

Lagoda
Posts: 153
Joined: Fri Jul 15, 2016 9:51 pm
Has thanked: 66 times
Been thanked: 60 times
Contact:

Re: Bit problems .....

Postby Lagoda » Thu Feb 21, 2019 10:10 pm

Hi Osta,

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

Lagoda

User avatar
Osta
Posts: 159
Joined: Tue Jul 05, 2016 9:42 am
Been thanked: 13 times
Contact:

Re: Bit problems .....

Postby Osta » Thu Feb 21, 2019 10:15 pm

Рш Lagoda!
Yes, I agree!!!
I have kontralirovat selectively a few bits of one variable.

Lagoda
Posts: 153
Joined: Fri Jul 15, 2016 9:51 pm
Has thanked: 66 times
Been thanked: 60 times
Contact:

Re: Bit problems .....

Postby Lagoda » Thu Feb 21, 2019 10:16 pm

Hi Osta,

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

Lagoda

User avatar
Osta
Posts: 159
Joined: Tue Jul 05, 2016 9:42 am
Been thanked: 13 times
Contact:

Re: Bit problems .....

Postby Osta » Thu Feb 21, 2019 10:25 pm

Hi Lagoda!
Variable check on several masks xor , or.

Lagoda
Posts: 153
Joined: Fri Jul 15, 2016 9:51 pm
Has thanked: 66 times
Been thanked: 60 times
Contact:

Re: Bit problems .....

Postby Lagoda » Thu Feb 21, 2019 10:35 pm

Hi Osta,

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

Lagoda

User avatar
Osta
Posts: 159
Joined: Tue Jul 05, 2016 9:42 am
Been thanked: 13 times
Contact:

Re: Bit problems .....

Postby Osta » Thu Feb 21, 2019 10:41 pm

Example
Attachments
XOR.jpg
xor
XOR.jpg (118.4 KiB) Viewed 1555 times

User avatar
Osta
Posts: 159
Joined: Tue Jul 05, 2016 9:42 am
Been thanked: 13 times
Contact:

Re: Bit problems .....

Postby Osta » Thu Feb 21, 2019 11:09 pm

Thank You, Lagoda!!
I realized my mistake...

Lagoda
Posts: 153
Joined: Fri Jul 15, 2016 9:51 pm
Has thanked: 66 times
Been thanked: 60 times
Contact:

Re: Bit problems .....

Postby Lagoda » Thu Feb 21, 2019 11:11 pm

:)