can you help me create a CODE Convert Negative numbers into binary using the One's and Two's Compliment Method Steps:
- Convert the Negative number into a positive binary first
- Convert the new value into binary (Continue dividing by 2, then reverse the remainders)
- Perform the one's complement by inverting every binary digit
- Perform the two's complement by adding 1 to the new binary value Note: Do not forget the magnitude bit, use 1 magnitude bit Example: -16 is 16 as positive, 10000 as binary, 010000 as a binary with 1 magnitude bit
Aucun commentaire:
Enregistrer un commentaire