read your manual, it's the only way you can be sure. I've had boards where slot1 of channel A and slot1 of channel B had one color, and the slot2's had a second. I've had boards where both slots of channel A had one color, and both slots of channel 2 the second. I've had boards where the ordering was CA-S1 CB-S1 CA-S2 CB-S2, and boards that were CA-S1 CA-S2 CB-S1 CB-S2. The color coding is useless across brands. That said, assuming your machine was originally put together correctly the 512's are in the first slot of each channel and you can just stick the 1G's into the two open slots.
-- If you view money as inherently evil, I view it as my duty to assist in making you more virtuous.