All AI technology can be traced back to the hardware it came from. Powering that hardware are microscopic chips, often produced by one company: Taiwan Semiconductor (TSM 1.26%). Taiwan Semiconductor is the leading contract chip manufacturer in the world, which means it is collaborating with its clients to produce the product they want, but it's up to them to compete with others in the market.

With this crucial position, Taiwan Semiconductor makes for an intriguing investment. But does it make for a great buy right now? Let's find out.

Taiwan Semiconductor has new products on the horizon

Among Taiwan Semiconductor's client base is Apple, Nvidia, Advanced Micro Devices, and many other leading hardware companies. While each client has differing demands, they are often interested in the most powerful chips available.

Right now, that's the 5nm (nanometer) and 7nm variety. But a new technology on the horizon could be a game changer. Next-generation 3nm chips offer significant improvements over TSMC's already powerful 5nm products. The 3nm chip offers a 70% logic density gain and 15% speed improvement with the same power consumption as the 5nm chip. It can also be run at the same speed, but consumes less power than the 5nm variety.

If you're curious how smartphones are getting faster with longer battery lives, look no further than the improvements made by Taiwan Semiconductor in their chips.

Additionally, even though TSMC's 3nm product hasn't yet made its way into consumers' hands, it's already working on the next iteration: 2nm chips. This product is expected to launch in 2025 and offers a 30% improvement over the already impressive 3nm chip. Even though Taiwan Semiconductor already has a strong market position, it isn't resting on that fact and is working on continuously cementing its top position. 

However, being exposed to the consumer market cuts both ways, as TSMC is currently experiencing some fierce headwinds.

Economic uncertainty is dragging on TSMC

In the second quarter, TSMC's revenue fell by 14% year over year. Earnings per share also declined from $1.55 last year to just $1.14 this year.

Management blamed this decline on "global economic conditions, which dampened the end market demand, and led to customers' ongoing inventory adjustment." As consumers purchase fewer high-end products (like smartphones and laptops), it affects TSMC.

Still, TSMC is well positioned to grow rapidly once the demand for these products returns. Wall Street analysts think that will happen in force next year, as revenue is projected to rise 23% in 2024.

As a result of its weakness, investors need to consider multiple factors when assessing TSMC's stock valuation. First, forward earnings need to be examined because TSMC's trailing earnings include periods where earnings were still growing, not shrinking. However, if you're a long-term investor, you can still utilize trailing earnings, as it shows how the stock will be valued in another year because earnings are projected to grow substantially in 2024.

Even with both these factors in mind, Taiwan Semiconductor stock still doesn't look that expensive.

TSM P/E Ratio (Forward) Chart.

TSM P/E Ratio (Forward) data by YCharts.

Its forward earnings are trading at about the same level as its historical average, so it's reasonably priced. So with investors not having to worry about overpaying for one of the most crucial companies in AI infrastructure, it seems like Taiwan Semiconductor is one of the best buys. As long as investors have a long enough holding period to let the company emerge from the downturn, then Taiwan Semiconductor makes for an excellent buy right now.