It must go on the cable with the CD-RW. The burner on the last
connector on the cable will be set to Master. Normally by putting the
jumper on the back of the drive to the pins marked "M". The drive on
the center connector of the IDE cable should be set to Slave. By
putting the jumper to the pins marked "S", in most cases.
You never put an optical drive on a cable with a HDD. The IDE
controller defaults all drives on the cable to the speed of the
slowest drive. There aren't many cases where you want a HDD to run at
the snails speed of a CD/DVD drive.