Build a bit mask from an input DQ array and a bitvalue flag
In the returned bit mask, 1 is good, 0 is bad