In reply to dave_59:
Sorry I overlooked that while mapping my problem to this example (my problem would require only 2 of the differences to be <=1 which I should have articulated in this example). But your solution answers my question - Thanks a lot for the prompt response!
However I do get compile errors: Is there any switch I need to enable to support this code? I also tried with changing `default_nettype (to make sure it was not none)
Error-[IND] Identifier not declared
test.sv, 232
Identifier ‘D2’ has not been declared yet. If this error is not expected,
please check if you have set `default_nettype to none.
Error-[XMRE] Cross-module reference resolution error
test.sv, 233
Error found while trying to resolve cross-module reference.
token ‘sum’. Originating program ‘test’.
Source info: D1.sum(D2) with (byte’((D2 == BLUE)))