The S&P 500 index hit several new highs in January, pushing the index into bull market territory. Every bull market is defined by a theme. The 1990s was the decade to own internet stocks; the 2000s were the decade of e-commerce; the 2010s were the decade of cloud computing, and the 2020s are rapidly shaping up to be the decade of artificial intelligence (AI).

Companies feel a sense of urgency to invest in this revolutionary technology for fear of being left behind by competitors. Market intelligence specialist IDC forecasts spending on AI solutions will reach over $500 billion annually by 2027.

Two top stocks to buy right now that can take advantage of that projected spending growth are Super Micro Computer (SMCI 8.89%) and Nvidia (NVDA 6.18%). These companies are certainly growing like there's no tomorrow, and yet their stock prices still trade at relatively reasonable valuations that point to more gains in 2024 and beyond.

1. Super Micro Computer

Share prices of Super Micro Computer soared 246% in 2023 and have already doubled year to date in 2024. The latest quarterly update from the provider of rack-mount data center solutions shows why.

Revenue grew 103% year over year to $3.66 billion, a massive acceleration over the previous quarter's 14% revenue growth rate. As AI innovation accelerates, more customers are investing to expand their AI infrastructure. This means more demand for Super Micro's plug-and-play rack systems, which are the building blocks of data centers.

CEO Charles Liang said he is "very confident that this AI boom will continue for another many quarters, if not many years."

What's more, Super Micro is profitably growing. Adjusted earnings per share came in at $5.59, up from $3.26 in the year-ago quarter. New graphics processing units (GPUs) from Nvidia and Advanced Micro Devices will expand Super Micro's offering in the near term. As the business expands and wins market share, it should increase margins.

Analysts expect Super Micro to grow earnings by 37% per year over the long term. That is plenty of growth to support the stock that trades at a forward price-to-earnings (P/E) ratio of 27, which is not that much higher than the S&P 500 average. The stock could hit more new highs in 2024.

2. Nvidia

Nvidia stock rocketed 239% in 2023. Super Micro's earnings report was great news for Nvidia's booming data center GPU business. AI rack-scale solutions designed for deep learning and large language models using Nvidia's HGX-H100 were key sales drivers for Super Micro. This bodes well for continued growth this year from the leading AI chip supplier.

Analysts expect Nvidia's annual revenue to reach $109 billion through the company's fiscal year ending in January 2026. That is more than double the trailing-12-month revenue of $45 billion. Analysts expect earnings to grow 42% per year, which could support new highs for the shares. The stock's valuation sits at a forward P/E of 32, which is quite attractive considering the company's growth.

Nvidia benefits from the high-margin sales of its advanced GPUs for AI. It's also seeing growth in recurring revenue from software, which is up to $1 billion on an annualized basis. This is partly coming from Nvidia AI Enterprise, a software suite that helps organizations streamline the development of AI applications.

Generative AI is a huge opportunity for the global economy, which spells more investment in Nvidia's GPUs. Goldman Sachs estimates generative AI will increase global GDP by 7% over the next decade. Nvidia is already working with India's government and largest tech companies to develop their sovereign AI infrastructure.

Given these powerful trends, the stock sells for what seems like a low valuation against the company's revenue and earnings growth. It's not too late to add this top GPU stock to your portfolio.