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

Science Memes

11130 readers
2808 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.

This is a science community. We use the Dawkins definition of meme.



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
[–] swag_money@lemmy.world 2 points 1 month ago (1 children)

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

[–] yardy_sardley@lemmy.ca 5 points 1 month 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.

[–] swag_money@lemmy.world 1 points 1 month 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?

[–] computergeek125@lemmy.world 2 points 1 month ago* (last edited 1 month 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 ~