CD drive both on the same IDE ribbon cable.
Let's explain the IDE ribbon cables. Each cable has 3 connectors[thingies???] One connects to the mobo. The other end connects to a Drive, the middle one also can be connected to a drive. [drives can be called IDE, ATA, ATAPI, don't get too confused. ATAPI is basically anything other than a Hard Disk Drive HDD].
The newer cables have been standardized and color coded. They are mostly the new 80 conductor cables same 40 pin connectors, just more wires of smaller diameter. The one that attaches to the mobo has more space between it and the middle connector, than from the middle to the other end.
They are designed to use CL [Cable Select jumpering on the drive, rather than having to set Master and slave. The end connector is always the Master and the middle is alwys the slave [when using CS jumper setting on the drives] Some of this is in preparation for when you build a new computer some day.
It turns out that the design stinks in a way, since the Master is usually a hard drive and the Slave could be a CD, but hard drives are usually mounted below the CD and thus the middle connector won't reach the CD [stupid]. I ususally mount the hard drive above the CD and then it works out, but must get an adapter to put the 3 1/2 inchhard drive in the 5 1/4 space.
In your case, if you only have two drives and don't mind the clutter of two ribbon cables, simply set the jumpers on the hard drive as Master and hook it up to the end of the Primary IDE ribbon. Then change the jumper on the CD to Master and hook it up to the end of the other IDE Ribbon cable. Then both drives are set up as Master. Check back if you decide to add more drives.
If you can use the Primary IDE ribbon cable to connect to both the hard drive and the CD then you can get rid of the second cable until later.
If the only way you can do that is to put the hard drive on the middle connector and the CD on the end, that'll be fine EXCEPT that you then CANNOT use cable select. Just set the Hard drive jumpers to Master and leave the CD as slave as it is now.
Probably confusing you with too much info.
Tell me what you want to do re the number of ribbon cables and I'll address that alone.
BTW Give Bill credit for pointing out that the cables were reversed a number of posts earlier.
Just rack it all up to learning.