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

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.