When calculating the value of a binary number for example 10010111 I need to do the following.

But what if I am given the number 456 and I need to convert this value into a binary number. How would I do this this?(1*2^7) + (0*2^6) + (0*2^5) + (1*2^4) + (0*2^3) + (1*2^2) + (1*2^1) + (1*2^0) = 128 + 0 + 0 + 16 + 0 + 4 + 2 + 1 = 151