this post was submitted on 17 Oct 2024
683 points (99.1% liked)

Science Memes

10726 readers
3191 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
[–] yardy_sardley@lemmy.ca 90 points 3 days ago (3 children)
[–] Dabundis@lemmy.world 43 points 3 days ago
[–] swag_money@lemmy.world 2 points 2 days 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 4 points 1 day 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 day 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 day ago* (last edited 1 day 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 ~

Mmm yes. 5 bit two's complement.

I shouldn't make fun of it we've definitly made some ISA that weird.