bit_length is 1 more than needed: subtract 1 from XLEN first