The semiconductor industry has received a big boost from the growing demand for artificial intelligence (AI) applications. That's not surprising, as training AI models in data centers wouldn't be possible without the processing power of semiconductors, which explains why companies in this sector have soared impressively over the past year or so.

Nvidia, for instance, has more than tripled in the past year, driven by stellar growth in its revenue and earnings on the back of the booming demand for the company's graphics cards. However, Nvidia's rapid surge wouldn't have been possible without its foundry partner Taiwan Semiconductor Manufacturing (TSM 2.39%), popularly known as TSMC.

While Nvidia designs the chips, it outsources the manufacturing to TSMC, so it wasn't surprising to see TSMC deliver solid results on April 18 for the first quarter. Let's take a closer look at TSMC's numbers before understanding why this semiconductor stock is an attractive buy right now.

TSMC's latest results tell us that AI is set to drive stronger growth

TSMC's Q1 revenue increased 13% year over year to $18.9 billion, while earnings increased 5% to $1.38 per share. The numbers exceeded analysts' expectations, and revenue topped the company's previous guidance.

Management's Q2 outlook was the icing on the cake as TSMC is forecasting $20 billion of revenue at the midpoint of its guidance range, good for year-over-year growth of about 28%. That's a a nice acceleration from the previous quarter, and the outlook came in higher than the $19.1 billion consensus estimate too.

More importantly, TSMC's revenue was down 14% year over year in Q2 2023 when the semiconductor market was in a downturn due to excess supply. However, the advent of AI has changed the game for TSMC as the demand for the chips made using the company's advanced process nodes has increased remarkably.

TSMC got 37% of its revenue last quarter from selling chips made on a 5-nanometer (nm) manufacturing process, up from 31% in the same period last year. Additionally, chips made on a 3nm node contributed 9% to its top line last quarter, compared to nothing a year ago. These advanced process nodes offer more computing power and greater power efficiency for AI chips produced by the likes of Nvidia, AMD, and Intel. As a result, they should continue to make up a bigger share of the company's top line.

Intel, for example, recently unveiled the Gaudi 3 accelerator, which is manufactured on the 5nm process node from TSMC. Meanwhile, Nvidia's next-generation Blackwell AI chips are set to be made using a 4nm process node from the company. TSMC is witnessing robust demand for its 3nm chips as well thanks to Apple. This is the backdrop for the ""insatiable AI-related demand" TSMC mentioned in its latest earnings call.

Buying the stock right now could be a smart move

The demand for AI chips is here to stay with the AI semiconductor market forecasted to increase at an impressive annual rate of 38% through 2030. TSMC is in a solid position to capitalize on this terrific growth opportunity given its 61% share of the global foundry market.

That's why investors would do well to buy this AI stock while it's trading at just 26 times earnings -- a discount to the broader semiconductor industry's average earnings multiple of 32. If TSMC can build on the accelerating growth it expects in the current quarter, its stock price is likely to surge higher.