Among chipmaker stocks, two of the most popular are Advanced Micro Devices (AMD 1.33%) and Nvidia (NVDA 3.71%). Over the past few years, these stocks have been excellent investments, with each significantly outpacing the broader market.

Unfortunately, the strong performance seen in these two stocks has fallen off a cliff in 2022. Both are trading down 60% for the year. Some investors wonder if they should sell. Other investors might wonder if now is the time to establish a position in these stocks.

Let's dive into what made these two stocks drop, and see if either is worthy of buying and which might be the better buy if both qualify.

Data centers continue to drive the business

AMD and Nvidia are often seen as competitors because their businesses tend to overlap. But each has a few business segments where they don't compete head-to-head.

Nvidia's biggest segment is its GPUs (graphics processing units), although it has some CPUs (central processing units) and software products as well. AMD is a bit more balanced between its GPU and CPU lines, but it also has an embedded-semiconductor segment, thanks to its Xilinx acquisition earlier this year.

Both companies see massive opportunities in the growing use of data centers, and as long as this economic tailwind is blowing, each should benefit. In the second quarter (Nvidia's Q2 ended July 31 and AMD's ended June 30), Nvidia and AMD experienced data center growth of 61% and 83%, respectively.

GPUs are also used to mine cryptocurrencies, and with the crashes of several major currencies, mining these tokens has become unprofitable. That caused the demand for GPUs to plunge, and Nvidia cut the cost of several of its units to ensure inventory didn't pile up as it did during the 2018 cryptocurrency crash.

Both businesses are also involved with the highly cyclical gaming industry, which got Nvidia in trouble in the second quarter. Nvidia posted a 33% drop in gaming sales over last year's total, whereas AMD's gaming sales rose 32% year over year. When I first saw this discrepancy, I thought, "How long can AMD outlast Nvidia in terms of growing its gaming segment?" As it turns out, at least another quarter.

Faster growth and a cheaper valuation

On Oct. 6, AMD previewed its third-quarter earnings to get ahead of what it knew would be a considerable revenue miss. Nvidia did the same thing when it experienced a massive revenue miss in the second quarter; however, the reasons for its miss are different.

AMD expects 45% and 14% growth in data center and gaming, respectively. So AMD doesn't see the same gaming weakness as Nvidia. But where it is seeing pressure is in its client segment. AMD's client products consist of consumer PC processors and GPUs that you'd find at the store, and CEO Lisa Su said in the press release with the announcement, "The PC market weakened significantly in the quarter." 

The client segment will post a 40% year-over-year revenue decline in the third quarter, which will significantly affect overall revenue, since the segment accounts for about 18% of AMD's total sales. But overall sales are still expected to rise 29% year over year, despite a $1.1 billion miss. So while AMD had a big miss, it is still solidly growing.

Nvidia is still in its third quarter, so investors must stay on the lookout for a similar preview. But if management makes such an announcement, it likely isn't because it had a blowout quarter. Management expects about $5.9 billion in revenue in the third quarter, which is down 17% year over year. However, analysts believe it will come in lower than this, with the average projection at $5.82 billion in sales.

If you were presented with two companies, one growing at a 30% rate and the other shrinking at a projected 17% rate, which would you choose? I'd expect many investors to choose AMD on this point alone. AMD is also a cheaper stock than Nvidia by a significant margin when it comes to price-to-earnings and price-to-sales ratios.

AMD PS Ratio Chart

AMD P/S ratio. Data by YCharts.

While a direct comparison has some caveats (Nvidia's gross margins are 10% to 15% higher than AMD's on average), Nvidia doesn't seem like it should trade at more than double the valuation of AMD (on a price-to-sales ratio).

While I'm usually an Nvidia bull, the stock doesn't reflect enough of the potential bad news, whereas AMD is pretty cheap.

I think AMD is a great buy and has a significant long-term opportunity. I also believe in Nvidia's opportunity, but the stock doesn't have enough pessimism baked in yet.