I was thinking not to worry about comparing to a DEC. Convert the BCD and compare to the conversion.

If you can not get a solution I will work something up when I get back to the shop tonight.