10-06-2014, 12:18 AM
(10-05-2014, 10:07 PM)TSO Wrote: Also, you could already have a 1 bit even/odd register already setup that automatically fills with the lowest digit, which you just call for in the program. That knocks out running a conditional check and is faster than the shift technique.
I guess I'll clarify, it's not like a true register, the last line just has a duplicate that goes to it's own read address.
You can also call a bit mask of 00000001 (assuming 8 bit) and if you get a zero, you have an even number.
I was trying to accomplish any easy way of branching if it was odd. I didnt want to add any extra hardware like you first said, and the bit mask would then take another cycle to jump.
I have an OP code call BSU(Branch if Shift Underflow), which will allow me to branch when i get a SU.