```ts
export function formatBits(value: number, width: number): string {
  if (!Number.isInteger(value) || value < 0) {
    throw new Error("Value must be a non-negative integer.");
  }
  if (width % 4 !== 0 || width > 32 || width <= 0) {
    throw new Error("Width must be a positive multiple of four and less than or equal to 32.");
  }

  const binary = value.toString(2).padStart(width, '0');
  let nibbleGroups: string[] = [];

  for (let i = 0; i < width; i += 4) {
    nibbleGroups.push(binary.substring(i, i + 4));
  }

  return nibbleGroups.join(' ');
}
```