Prove that the next multiple of 4 is obtained using the next formula
Suppose that $s = 4a+b$, where $0 \leq b &lt; 4$; by assumption, $b \neq 0$. If the numbers are $n$ bit long, then $\lnot s = 2^n - s = 4(2^{n-2}-a) + (4-b)$. Since $b \neq 0$, the last two bits of $\lnot s$ will be $4-b \in \{1,2,3\}$. Therefore $(\lnot s) \land (11)_2 = 4-b$. Adding this to $s$, we get $4a+b+4-b = 4(a+1)$.