Hi, you could try a Karnaugh map to create an optimized combinatorial circuit:
b3 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1
b2 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0
b1 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0
b0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0
-------------------------------------
aaaa
3210
0000 1
0001 1
0011 1
0010 1
0110 1
0111 1
0101 1
0100 1
1100 1
1101 1
1111 1
1110 1
1010 1
1011 1
1001 1
1000 1
NOTE: the 1s should be on the diagonal of the map; they did not paste property
x = (a3bara2bara1bara0barb3barb2barb1barb0bar) + ....
As you can see, this gets ugly very fast.
How about comparing individual bits?
b 0 1
a
0 1 0
1 0 1
From the map we have: bCompare = abar*bbar + ab
This is an exclusive NOR function
Since we need to compare four pairs of bits:
nibbleCompare = b0Compare & b1Compare & b2Compare & b3Compare
This is the circuit in your picture.