Professional Documents
Culture Documents
230221-Lecture-16-Unit-4-Programming in C
230221-Lecture-16-Unit-4-Programming in C
• The conversion is done using a two's complement binary, which requires the
programmer to instruct the computer to interpret any binary number starting with 1
as negative.
• The program then constructs the corresponding positive number in binary, takes its
complement and adds one.
• Note that the computer has "signed" these numbers to treat a leading 1 as negative
and process the results differently than simply adding up the powers of 2 occupied
by the symbol 1.