Question #6091   Submitted by Answiki on 04/19/2022 at 08:09:22 PM UTC

How to convert negative decimal numbers to the binary base?

Answer   Submitted by Answiki on 04/19/2022 at 08:11:28 PM UTC

The conversion of a negative number into binary is done in 3 steps:


1. Convert the absolute value of the number into binary.

2. Invert all the bits (complement to one).

3. Add one to the previous result.


For example, assume you want to convert -84 from decimal to 8-bit signed binary:


1. Conversion: 


2. Invert:: 


3. Addition of 1:  


In conclusion:  

2 events in history
Answer by Answiki on 04/19/2022 at 08:11:28 PM

The conversion of a negative number into binary is done in 3 steps:


1. Convert the absolute value of the number into binary.

2. Invert all the bits (complement to one).

3. Add one to the previous result.


For example, assume you want to convert -84 from decimal to 8-bit signed binary:


1. Conversion: 


2. Invert:: 


3. Addition of 1:  


In conclusion:  

Question by Answiki 04/19/2022 at 08:09:22 PM
How to convert negative decimal numbers to the binary base?

Icons proudly provided by Friconix.