How integers are stored in memory
Write a blog post on how integers are stored in memory using two’s complement, now returning to the binaries, a binary number is a number made up of 1 or 0 and these are the ones that will always define what number each is, as we can see in the following table along with a sample of the extra conversion between decimals and binaries.
Now the question that needs to be resolved is how is this conversion done with negative numbers?
the form of representation is to use 1’s complement to represent negative numbers. The first bit is also reserved to represent the sign and the rest of the bits are used to represent:
This is how it works since a sum is made between the number and its negative complement, making it represent itself in binary.
In conclusion, it can be said that the numbers are stored in binary depending on whether the result of the same by a division by two or in other words by a conversion to binary and the negatives will be stored in the same way by exchanging 1 and in one this