JOIN
Get Time
forums   
Search | Watch Thread  |  My Post History  |  My Watches  |  User Settings
View: Flat (oldest first)  | Threaded  | Tree
Previous Thread  |  Next Thread
Re: How is ~1010 = 11110101? (response to post by akshaynagpal) | Reply
Oh I got my answer, 1010 is actually 00001010 as it is 8 bit.
How is ~1010 = 11110101? | Reply
The article was great but I could not understand if A = 1010, how is ~A = 11110101?
Quoting the paragraph from https://www.topcoder.com/community/data-science/data-science-tutorials/a-bit-of-fun-fun-with-bits/ below:
"
Thus, if A is 1010 and B is 1100, then

A & B = 1000
A | B = 1110
A ^ B = 0110
~A = 11110101 (the number of 1's depends on the type of A).
"
RSS