Example of conversion to decimal of a signed binary number in two's
complement representation

Let's convert to decimal the following signed binary number: 10110010
10110010 = -1×27 + 0×26 + 1×25 + 1×24 + 0×23 + 0×22 + 1×21 + 0×20 = -128 +
32 + 16 + 2 = -78.

that operation ilvoves base 2 raised to the 7th, 6th, 5th, .... and 0th
power. Only the first one has a minus one multiplying. The  first one is
multiplied by a 2 raised to the seventh power because powers goe from right
to left, starting from zero, all the way to the leftmost integer.

Thank you so much for your valuable help,

Cheers,

Paul

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to