Efficient pattern mapping for deterministic logic BIST