Page 497 - AP Computer Science A, 7th edition
P. 497

Pull out the highest power of 2 less than or equal to 25, which is 16. Thus,
25 = 16 + 9
Now pull out the highest power of 2 less than or equal to 9, which is 8. Thus,
25 = 16 + 8 + 1
Now write 25 as a sum of powers of 2, making sure to include the missing powers that are less than the highest power in the first step of the solution:
25 =16+8+1
= (1)(24) + (1)(23) + (0)(22) + (0)(21) + (1) (20)
= 11001bin
Note: you must be careful to use 0’s as place holders for the missing powers of 2.


























































































   495   496   497   498   499