How to identify if the binary number given is a negative integer or a positive integer

Let’s say we have 1101 for example. We were told two things.

First being that 1101 is actually 2^3+2^2+0+2^0=13

Second case is where it is a negative number. In that case, we were told that the first digit of the binary determines the sign of the number and the rest of the digits determine the magnitude. For example 1101 is a 4 bit binary where the 1st ‘1’ denotes it being negative and the rest 101 denotes the magnitude = 2^2+0+2^0=5

Second part of the doubt is that here again we were told that we find the magnitude by using 2’s compliment notation.

So how is the right way to go about it?

Hey @crunchybanana
First check this : Storing negative integers in memory
We always have 32 bit or 64 bit or so on
So now assume that we only have 4 bit number
and in it we are taking 1101 as example
so 1st bit i.e leftmost is 1 which means its negative
Next to measure magnitude
take 2’s complemt of 1101 == 0010 and add 1== 0011 now measure magnitude =2^0+2 =3
So number is -3

If it was 0101 then here leftmost is 0 that means positive so num is 2^0+2^2=+5

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.