Generally when you have a noun+noun compound one of the nouns is the "head", i.e. the most important part of the compound that tells you what sort of thing the compound refers to, and the other noun qualifies the head, in a similar way to an adjective. So in your examples: penblwydd m. = PEN m. (head, end) + blwydd f. (year) = "year end", the END of the year (as measured from your date of birth); tŷ bwyta m. = TŶ m. (house) + bwyta v.n. (eat) = "eating house", a HOUSE where you eat; cerdyn mynegai m. = CERDYN m. (card) + mynegai m. (index) = "index card", a CARD used in an index. The word in CAPITALS is the head of the compound. As you can see, the gender of the compound is the same as the gender of the head of the compound, since this is the defining word in the compound. As you know, in Welsh qualifying words generally come after the word qualified, so as a rule of thumb the head of a compound will be the first word, in other words the compound generally takes the gender of its first element.