MIPS...checking least significant bit. - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

MIPS...checking least significant bit.

I'm working on an assignment and have reached a road block. If I have a 16 bit integer like:

0000 0000 0000 0100

how would I check to see what the value in the LEAST significant bit is? Basically, how would I check to see if the least significant bit is 0 or 1? How would I code it? I am a beginner at MIPS...is there a simple instruction that detects this? Please help.

Comments

  • BitByBit_ThorBitByBit_Thor Posts: 2,444Member
    : I'm working on an assignment and have reached a road block. If I
    : have a 16 bit integer like:
    :
    : 0000 0000 0000 0100
    :
    : how would I check to see what the value in the LEAST significant bit
    : is? Basically, how would I check to see if the least significant bit
    : is 0 or 1? How would I code it? I am a beginner at MIPS...is there a
    : simple instruction that detects this? Please help.
    :

    Don't know MIPS myself, but you could use binary and to check.
    LSB will be checking "if (number & 1)", only then in assembly code.

    Best Regards,
    Richard

    The way I see it... Well, it's all pretty blurry
Sign In or Register to comment.