Imagine you load this data as a 4-byte word into a register R. What is the value in R on a big endian machine and what is it on a little endian machine if you interpret the bits as a signed integer encoded in 2s complement On a big endian machine the register R would be something like thisnot considering the last sentence, interpret the bits as a signed integer encoded in 2s complement, which I don't understand completely. Should I convert all bits, 0s to 1s and 1s to 0s and then sum 1 to all the string or to sum 1 to each byte in the string?Thanks.
Interpret bits as a signed integer in 2s complement
computer architecture
To convert a 4-byte = 32-bit word to its negative you apply the two's complement operator.  The operator is, as you said, invert all the bits, then add 1 to the word.You can tell a 4-byte = 32-bit word represents a positive value if its most significant bit (the one all the way on the left) is 0.  If the most significant bit is a 1 then the 32-bit word represents a negative value.  Thus your example big-endian register, 01001101101101101111001111010111 must represent a positive number.I assume you know how to convert a positive binary number to its decimal or hexadecimal equivalent.  The hexadecimal equivalent of 01001101101101101111001111010111, for example, is 0x4db6f3d7.If, on the other hand the leading bit had been a 1, as in, (just making a number up): 11001101101101101111001111010111 that represents a negative number.  The negative of what positive number?  The positive number that you will get if you apply the two's complement operator.  Flip the bits and add 1.  So the negative of11001101101101101111001111010111must be00110010010010010000110000101000+                              1 =00110010010010010000110000101001,which is hexadecimal 0x32490c29so 11001101101101101111001111010111 must be -0x32490c29.