terryds Posted October 31, 2013 Share Posted October 31, 2013 (edited) I have a question on bitwise operators Are there any differences between $a ^ $b and $a & ~$b ? Edited October 31, 2013 by terryds Link to comment Share on other sites More sharing options...
Ingolme Posted October 31, 2013 Share Posted October 31, 2013 Map out their truth tables: For the first one $a ^ $b A B Ouput0 0 00 1 11 0 11 1 0 For the second one: $a & ~$b A B Output0 0 00 1 01 0 11 1 0 The XOR operation is actually equivalent to $a & ~$b | ~$a & $b 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now