I\'m currently working on a simulation of the MIPS processor in C++ for a comp architecture class and having some problems converting from decimal numbers to binary (signed
Replace:
if((mask&a) >= 1)
with either:
if ((mask & a) != 0)
or:
if (mask & a)
Your problem is that the last bit gives you a negative number, not a positive one.