I need to convert signed/unsigned decimals to their equivalent signed binary values in Matlab.I had used 2 functions but they work for positive integers only i.e de2bi() and dec2bin().Is there any function that help me or I had to write my own routine for conversion.
Hi;
If you know your number of bits in binary, you can do smthng like this, (for decimal numbers smaller than zero);
Let say 4 bit binary represantation;
Then ie -3 complementary number is 2^4+(-3)=13
13 in binary form (here use dec2bin or de2bi) [1101]. If you consider this number in signed manner it corresponds to -3 (take 1's complement and add 1 **broken link removed**).