How do I flip the most significant bit in MIPS?

quantumbutterfly

I am trying to convert a number in 2's complement in MIPS to sign magnitude. To do this, I think I would:

  1. subtract 1
  2. 'Not' the word
  3. Flip the most significant bit

For example, 11111111111111111111111111111001 (0xfffffff9) would become 00000000000000000000000000000111 (0x00000007).

I figured out how to do step 1 & 2, but can't figure out step 3. Does anyone know how I would do this?

Also, is there a better way to convert from 2's complement to sign magnitude format in MIPS?

Aasmund Eldhuset

If you XOR the value with 0x80000000, the most significant bit will flip. You can do the last two steps (retaining the most significant bit and flipping the others) by XOR'ing with 0x7fffffff.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Least significant bit mips

From Dev

How to clear most significant bit in byte?

From Dev

how is the most significant bit radix sort more efficient than the least significant bit radix sort?

From Dev

set most significant bit in C

From Dev

Bitwise operators: How do I clear the most significat bit?

From Dev

Find most significant set bit in a long

From Dev

Comparing the Most Significant Bit of two numbers: ==, <, <=

From Dev

How can I get the value of the least significant bit in a number?

From Dev

How to write a constant time function to copy the most significant bit to all bits

From Dev

How to change the most significant bit to a 1 after shifting an int to the right using '>>'?

From Dev

How to interpret using Most Significant Bit of single byte - Pcapng time format "if_tsresol"

From Dev

Get the most significant bit from an 8-bit value

From Dev

Get the most significant bit from an 8-bit value

From Dev

How do I flip an image vertically in Java?

From Dev

How do I flip the values of my array?

From Dev

How do I flip an image in memory?

From Dev

How do I flip a progressbar vertically?

From Dev

How do I flip rows and columns in R

From Dev

The MSB (most significant bit ) in pyserial python sent to arduino uno in damged

From Dev

How do I determine the number of significant figures in data in R?

From Dev

How to write least significant bit into the buffer?

From Dev

How to Delete Least Significant Bit in Java?

From Dev

Writing a bit reader in JAVA (32-bit little-endian most-to-least-significant bit packing)

From Dev

Fast way of finding most and least significant bit set in a 64-bit integer

From Dev

What most significant changes can user do in the Windows 7 and 2008?

From Dev

How do I flip a Three.js texture vertically?

From Dev

JavaScript: how do I make a tooltip follow the cursor *and* flip on collision?

From Dev

How do I flip a Three.js texture vertically?

From Dev

How do I change this flipping card to flip vertically?

Related Related

  1. 1

    Least significant bit mips

  2. 2

    How to clear most significant bit in byte?

  3. 3

    how is the most significant bit radix sort more efficient than the least significant bit radix sort?

  4. 4

    set most significant bit in C

  5. 5

    Bitwise operators: How do I clear the most significat bit?

  6. 6

    Find most significant set bit in a long

  7. 7

    Comparing the Most Significant Bit of two numbers: ==, <, <=

  8. 8

    How can I get the value of the least significant bit in a number?

  9. 9

    How to write a constant time function to copy the most significant bit to all bits

  10. 10

    How to change the most significant bit to a 1 after shifting an int to the right using '>>'?

  11. 11

    How to interpret using Most Significant Bit of single byte - Pcapng time format "if_tsresol"

  12. 12

    Get the most significant bit from an 8-bit value

  13. 13

    Get the most significant bit from an 8-bit value

  14. 14

    How do I flip an image vertically in Java?

  15. 15

    How do I flip the values of my array?

  16. 16

    How do I flip an image in memory?

  17. 17

    How do I flip a progressbar vertically?

  18. 18

    How do I flip rows and columns in R

  19. 19

    The MSB (most significant bit ) in pyserial python sent to arduino uno in damged

  20. 20

    How do I determine the number of significant figures in data in R?

  21. 21

    How to write least significant bit into the buffer?

  22. 22

    How to Delete Least Significant Bit in Java?

  23. 23

    Writing a bit reader in JAVA (32-bit little-endian most-to-least-significant bit packing)

  24. 24

    Fast way of finding most and least significant bit set in a 64-bit integer

  25. 25

    What most significant changes can user do in the Windows 7 and 2008?

  26. 26

    How do I flip a Three.js texture vertically?

  27. 27

    JavaScript: how do I make a tooltip follow the cursor *and* flip on collision?

  28. 28

    How do I flip a Three.js texture vertically?

  29. 29

    How do I change this flipping card to flip vertically?

HotTag

Archive