well you need only d or bits. so drop bits and compute it from d (log2)