Binary arithmetic

EasyMedium
1234567891011121314151617
Question 15
Medium

An embedded systems programmer needs to optimize a division routine. Instead of using a standard division instruction, they perform a logical shift right by k k\,k places on an NNN-bit register holding an unsigned binary integer XXX (where k<Nk < Nk<N). Which of the following expressions mathematically represents the value of the register after this operation?

⌈X×2−k⌉\lceil X \times 2^{-k} \rceil⌈X×2−k⌉

X×2kX \times 2^kX×2k

⌊X×2−k⌋\lfloor X \times 2^{-k} \rfloor⌊X×2−k⌋

⌊X÷2k⌋\lfloor X \div 2k \rfloor⌊X÷2k⌋

Binary arithmetic Questions

  1. GCSE
  2. /Computer Science
  3. /Binary arithmetic