Login  Register

Bitwise negation

classic Classic list List threaded Threaded
3 messages Options Options
Embed post
Permalink
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Bitwise negation

Jason
19 posts
I'm working on the ALU worksheet from this forum and I have a question about bitwise negation.

if I have 1010 (-6) and I negate the bits, I get 0101 which is 5. Is this correct, or should the outcome be 0110 (6)?

If it should be 6, then what is the math process and how do I do this with the chips I've already made?

(Yes, I understand you will not be giving me full answers, I just want to know where to start looking)
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Bitwise negation

cadet1620
Administrator
2607 posts
Bitwise negation means all 16 bits get logical negation (not). Nothing to do with signed numeric values.

--Mark
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Bitwise negation

Jason
19 posts
Got it. So, yes, a bitwise negation of -6 does come out to 5, but it's got nothing to do with the numbers represented, just the bits. That's a rough one to wrap your head around.