Bit problems .....

Moderator: Benj

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

Bit problems .....

Post by Osta »

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

Lagoda
Posts: 170
Joined: Fri Jul 15, 2016 9:51 pm
Has thanked: 69 times
Been thanked: 61 times
Contact:

Re: Bit problems .....

Post 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

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

Re: Bit problems .....

Post by Osta »

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

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

Re: Bit problems .....

Post by Osta »

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

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

Re: Bit problems .....

Post by Osta »

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

Lagoda
Posts: 170
Joined: Fri Jul 15, 2016 9:51 pm
Has thanked: 69 times
Been thanked: 61 times
Contact:

Re: Bit problems .....

Post 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

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

Re: Bit problems .....

Post by Osta »

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

Lagoda
Posts: 170
Joined: Fri Jul 15, 2016 9:51 pm
Has thanked: 69 times
Been thanked: 61 times
Contact:

Re: Bit problems .....

Post 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

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

Re: Bit problems .....

Post by Osta »

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

Lagoda
Posts: 170
Joined: Fri Jul 15, 2016 9:51 pm
Has thanked: 69 times
Been thanked: 61 times
Contact:

Re: Bit problems .....

Post by Lagoda »

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 .....

Post by Osta »

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

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

Re: Bit problems .....

Post by Osta »

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

Lagoda
Posts: 170
Joined: Fri Jul 15, 2016 9:51 pm
Has thanked: 69 times
Been thanked: 61 times
Contact:

Re: Bit problems .....

Post by Lagoda »

:)

Post Reply