this post was submitted on 17 Oct 2024
694 points (99.0% liked)

Science Memes

10827 readers
2381 users here now

Welcome to c/science_memes @ Mander.xyz!

A place for majestic STEMLORD peacocking, as well as memes about the realities of working in a lab.



Rules

  1. Don't throw mud. Behave like an intellectual and remember the human.
  2. Keep it rooted (on topic).
  3. No spam.
  4. Infographics welcome, get schooled.


Research Committee

Other Mander Communities

Science and Research

Biology and Life Sciences

Physical Sciences

Humanities and Social Sciences

Practical and Applied Sciences

Memes

Miscellaneous

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 2 points 1 week ago (1 children)

what's the general rule for translating negatives from binary? did you just do like 17 - 2 • (-1) or something?

[–] [email protected] 4 points 1 week ago (1 children)

I used what known as 2's compliment. Take the complement (flip all the bits - here that would give you 01110 which is 14) then add 1.

[–] [email protected] 1 points 1 week ago (1 children)

thanks for the explanation! could you express it as a NOT operation plus one? like is that how it would be processed at a low level?

[–] [email protected] 2 points 1 week ago* (last edited 1 week ago)

My low level is a tad rusty from when I learned the C side in school, but if I recall the not operator resolves as a single Boolean (0 or 1 in true C), whereas compliment comes back as however many bits you put in - a not operation per bit.

In C, the not operator is ! and the compliment operator is ~