There has been an endless discussion on Nvidia (NVDA -2.09%) in the last few years. The maker of advanced computer chips powering the artificial intelligence (AI) revolution now sports a market capitalization of $3.48 trillion. That's correct, trillion with a T. Nvidia is now the world's largest company and shows no signs of slowing down. Revenue is up a whopping 782% in the last five years alone.

But that doesn't make Nvidia an automatic buy for investors today. In fact, with the stock up so much and its forward price-to-earnings ratio (P/E) scraping 50, Nvidia stock looks like a risky buy today. Instead, investors looking to play the AI boom should consider Taiwan Semiconductor Manufacturing (TSM -0.70%) instead. Here's why.

Nvidia's key semiconductor supplier

Nvidia sells advanced computer chips for AI data centers. It doesn't actually manufacture these products itself, though. Instead, it designs the chips using computer software and outsources the production to other manufacturers. The No. 1 manufacturer of Nvidia chips -- along with other companies such as Apple -- is Taiwan Semiconductor Manufacturing, otherwise known as TSMC.

In fact, when it comes to the most advanced computer chips in the world, TSMC is now the only manufacturer capable of creating them at scale. No TSMC, no advanced Nvidia chips. It's that simple. Not even Intel or Samsung can replicate what TSMC is doing, at least for the time being. This is why the company's advanced semiconductor nodes -- 5 nanometers and 3 nanometers -- make up over 50% of its overall revenue.

TSMC is now a giant and recently surpassed a trillion-dollar market cap itself, although the stock has recently slipped back to a "measly" $816 billion valuation. Revenue was $83.9 billion over the past 12 months, with $36 billion in operating income. Both figures have steadily grown in the last 10 to 20 years due to TSMC's increasing advantage in the growing advanced semiconductor sector.

Extending its advantage, international diversification

Management at TSMC does not plan to rest on its laurels anytime soon. To further extend its advantage in advanced semiconductors, the company plans to have its 2-nanometer node ready to go by 2025. This means that if Nvidia wants to keep producing the most cutting-edge computer chips, it will have to go to TSMC for manufacturing. In other words, TSMC now has close to a monopoly in advanced semiconductors, which will give it untapped pricing power.

Investors are concerned about TSMC's concentration in Taiwan given the geopolitical tensions with China. However, TSMC is now trying to diversify its supply chain. It has invested in facilities in the United States, Mexico, Europe, and Japan. These factories will become operational within the next few years. Not only should it help TSMC grow revenue, but it will help alleviate the geopolitical risk with Taiwan by diversifying geographically, which should be a positive for shareholders.

Why the stock is a good AI bet

Unlike Nvidia, TSMC stock trades at a reasonable P/E of 30. This is actually almost exactly the S&P 500 index average at the moment, which is a P/E of 30.4. However, unlike the S&P 500 average, TSMC has huge growth prospects to go after over the next decade and beyond.

The world -- especially the big technology companies -- will not stop demanding advanced computer chips anytime soon. In fact, almost all of these companies are increasing their investments in computer chips and data centers, which leads to more demand for TSMC's products. Given its monopoly position, revenue should grow for the foreseeable future.

I expect TSMC to grow its earnings at a fast clip for the next decade and become one of the largest companies in the world by market cap. At a market cap below $1 trillion, the stock is a good bet for AI investors today.