-
Suppose you want to find all instances where value 3 is followed by
value 1 or 2.
-
Create two lookup tables.
-
One for first nibble [0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0]
-
second nibble [0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0]
-
Lookup first nibble in table, lookup second, compute bitwise AND.
-
If result is 1, you have a match.
-
Can do this in parallel over many values.