From this code:
li $v0,5 #reads in an integer
syscall
#move $a0,$v0
From looking at the web it looks like result ($v0) is already an integer.
If it is an integer, then you already have the binary.
To get the individual bits out, it is just a matter of using "and"s and bit shifting calls.
You don't really need to extract the bits and put them in an array and then compare them, you could just extract them and compare them as you go.
Caveat: I've never done any MIPS assembly, so this is all an educated guess.