Shares of stock market darling Nvidia (NASDAQ: NVDA) have gained nearly 219% in the past year and have reached near-record highs. The semiconductor giant's prowess in advanced GPUs and artificial intelligence (AI) software has made it the undisputed leader in the AI market, which has translated to dramatic improvement in its financial performance.

AI is undoubtedly the biggest investment theme in 2024. Many investors may be feeling that they have missed the Nvidia rally, especially since the company is now trading at a forward price-to-earnings ratio of 33 times -- far higher than the median semiconductor industry valuation of 19.4 times. These investors can consider buying stakes in other high-quality AI stocks with relatively reasonable valuations, such as Microsoft (MSFT 1.82%) and Intel (INTC -9.20%).

Here's why these two stocks are attractive picks in 2024.

Microsoft

Technology titan Microsoft has come out with stellar results for the second quarter of fiscal 2024, with both revenue and earnings surpassing consensus estimates. Not surprisingly, AI has been a major driving force for the company.

Microsoft's Azure cloud computing platform is the key growth engine, with revenue soaring 30% year over year (including a six percentage point lift from AI services) in the second quarter ending Dec. 31, 2023. On the contrary, revenue from key competitors such as Amazon's AWS and Alphabet's Google Cloud grew year over year by 13% and 26%, respectively, in the most recent quarters. Azure has also managed to secure larger and longer-term deals, including billion-dollar-plus commitments. This will ensure that the business can remain relatively unscathed even in difficult times.

Azure is also quickly becoming an ideal cloud computing platform for AI workloads, thanks to its top-notch performance in training and inferencing of large language models. Microsoft offers customers a diverse selection of AI software models and AI hardware (from multiple chip players) to choose from, all integrated deeply with Azure infrastructure, data, and tools. The company has already built a base of 53,000 Azure AI customers, of which nearly one-third have joined the Azure platform in the past 12 months.

Another major growth catalyst for Microsoft is the AI-powered assistant CoPilot embedded in multiple Microsoft products such as Microsoft 365 productivity suite, GitHub, and Microsoft security platform. The company expects the rapid adoption and monetization of CoPilot to translate into a significant improvement in average revenue per user in the coming years.

Besides the multiple AI tailwinds, Microsoft's core PC and gaming businesses are also set to recover in 2024. The company's productivity and business processes division has also returned to double-digit growth in the past few quarters.

Microsoft currently trades at a price-to-sales (P/S) ratio of 13.3 times, which is quite expensive compared to the software industry's median valuation of 2.2 times. However, considering the company's strength in the AI market and improving IT spending trends, this leading consumer and enterprise software company can prove to be a smart buy in 2024 -- even at the current elevated price levels.

Intel

Semiconductor giant Intel has seen its shares tank by nearly 13.4% after posting mixed fourth-quarter 2023 results on Jan. 25. While the company's revenue and earnings surpassed consensus estimates, its earnings guidance for the first quarter of fiscal 2024 fell significantly short of analysts' expectations. Intel has attributed the weak outlook to temporary headwinds in the Mobileye autonomous driving business, PSG (Programmable Solutions Group), and Intel Foundry Services businesses. Despite these setbacks, there are few positives for this stock.

The PC market seems to be recovering in 2024. IDC expects the total PC market to grow 3.4% year over year in 2024 -- driven by the PC refresh cycle to replace the aging installed base of commercial PCs and upgrade to new PCs with integrated AI capabilities. With its market-leading position in the client PC market, Intel is well-positioned to capitalize on this trend.

Intel is also making rapid strides in the AI PC market with its Core Ultra client processors -- also known as Meteor Lake. These processors have been designed to run low-power computations for AI workloads on client PCs. The company has partnered with more than 100 independent software vendors and plans to release over 300 AI-accelerated software features optimized for its AI PCs through 2024.

Furthermore, the company's partnerships with multiple PC manufacturers will also play a pivotal role in driving the adoption of its AI PC systems. Intel expects to ship 40 million AI PC systemsin 2024, to be used in over 230 designs from ultrathin PCs to hand-held gaming devices. Even without a significant impact from AI PC systems, Intel's client computing business saw a healthy 33% year-over-year jump in revenue to $8.8 billion in the fourth quarter.

Intel also sees its foundry business as a major growth catalyst and expects to become the second-largest foundry by 2030. Although the business currently focuses on traditional chip packaging, Intel expects its wafer manufacturing and advanced chip packaging to earn meaningful revenue in the coming years. This will be driven by the increasing rapid global adoption of AI technologies, which needs a secure and sustainable supply chain of AI-optimized chips. Intel's foundry business has already secured commitments from multiple clients and has a disclosed total deal value pipeline of over $10 billion. In the fourth quarter, foundry services posted a solid 63% year-over-year jump in revenue to $291 million.

Intel is currently trading at a P/S ratio of 3.5 times, far lower than that of peers such as Nvidia and Advanced Micro Devices. Hence, considering the strong tailwinds and reasonable valuation, Intel may be a smart AI long-term buy -- even if the stock encounters some choppiness in the short run.