def to_bits_string(value: int) -> str:
  """Converts unsigned value to a bit string with _ separators every nibble."""
  if value < 0:
    raise ValueError(f'Value is not unsigned: {value!r}')
  bits = bin(value)[2:]
  rev = bits[::-1]
  pieces = []
  i = 0
  while i < len(rev):
    pieces.append(rev[i:i + 4])
    i += 4
  return '0b' + '_'.join(pieces)[::-1]