pretty simple actually.... divide the current share price by the earnings per share for the period you wish to examine.
Let's make up some numbers to show you. Say AMD shares closed today at $15. Last fiscal year, AMD's earnings were $1.50 per share. Divide 15 by 1.50, and you arive at 10. That figure of 10 would be the PE ratio for AMD. The time period being examined is important too... you can look at a company's trailing PE ratio, which uses the last FULL year's earnings (this is the one generally given and talked about), a company's Forward PE ratio, which uses estimates for the coming year, or Current PE ratio, which takes the earnings year-to-date, and an estimate for the remainder of the year.