Total no. of levels with 1024 elements is 11.Its better if you try drawing the heap.
For 512 to be at level 2 (on left subtree) the heap will be like, 0,512,1,513,514,2,3,515,516,517,518,4,5,6,7…
Since from 0 to 1023 there are 1024 elements so the heap will have just one element at the last level. We try to make this element as 512.
I take a small example. For 16 elements 0 to 15, I need to make 8 come at the last level. This is how I can do that: 0,1,2,3,4,5,6,7,9,10,11,12,13,14,15,8.
Similarly in the heap with 1024 elements, the 2nd last level will contain 512 elements (29) and those will be 511,513,514…1023 and at the last level, the left child of 511 will be 512.