Artificial intelligence (AI) dominated financial headlines throughout 2023. While myriad companies are participating in the AI marathon, the "Magnificent Seven" stocks are setting the pace. Among this cohort of stocks, perhaps the biggest beneficiary from the AI boom is Nvidia (NVDA 6.18%). The company recently reported earnings for its third quarter of fiscal 2024, ended Oct. 29, handily beating its revenue guidance and setting a new record.

But even after its 240% stock return so far this year, there are plenty of reasons to believe the party is just getting started for Nvidia. Let's dig into the tailwinds pushing demand for the company's semiconductor chips and assess if now is a buying opportunity for long-term investors.

Artificial intelligence is fueling demand

Nvidia specializes in the production of graphics processing units (GPUs). GPUs play a critical role in gaming, crypto mining, and AI. When it comes to AI use cases, GPU chips are designed to help power large language models (LLMs). This is important because LLMs are a core component of generative AI applications.

Given the skyrocketing rise of Microsoft's ChatGPT and Alphabet's Bard, it's easy to draw a dotted line connecting Nvidia to a host of other major AI players. To get a sense of just how much demand Nvidia is experiencing, let's take a look at the company's financial picture and how its valuation has shifted.

A person working inside of a datacenter.

Image source: Getty Images.

Nvidia's path to a $1 trillion valuation

The table below illustrates some of Nvidia's key financial metrics over the last year.

Category Q3 FY 23 Q4 FY 23 Q1 FY 24 Q2 FY 24 Q3 FY24
Revenue $5.9 billion $6.1 billion $7.2 billion $13.5 billion $18.1 billion
Gross margin % 53.6% 63.3%

64.6%

70.1% 74%
Diluted earnings per share $0.27 $0.57 $0.82 $2.48 $3.71

Data source: Nvidia Investor Relations. 

You can see that Nvidia's revenue has increased by 206% over the last year. But perhaps even better is the company's bottom line. The impressive margin expansion has helped fuel a rise in profits, as diluted earnings per share increased from $0.27 during the third quarter of fiscal 2023 to $3.71 for the most recent quarter -- over 1,200% growth in just one year.

Nvidia's eye-popping growth on both the revenue and earnings lines sheds light not only on the demand for its products, but the pricing power that the company can command given its market-leading position.

NVDA Market Cap Chart

NVDA Market Cap data by YCharts

The chart above illustrates Nvidia's market cap over the last year. Nvidia's market cap has grown over 200% to eclipse $1 trillion. Although this valuation might appear steep, a thorough analysis benchmarked against its peers might prove otherwise.

Should you buy Nvidia stock in 2024?

The chart below illustrates Nvidia's forward price-to-earnings (P/E) ratio compared to its "Magnificent Seven" cohorts. Investors can see that Nvidia's forward P/E of roughly 40 is right in the middle of the pack. What is actually surprising to me is that Tesla, which is a known customer of Nvidia, is trading at a forward P/E nearly double that of Nvidia's.

NVDA PE Ratio (Forward) Chart

NVDA PE Ratio (Forward) data by YCharts

Perhaps an even more head-scratching dynamic can be seen in the chart below.

NVDA PE Ratio (Forward) Chart

NVDA PE Ratio (Forward) data by YCharts

Advanced Micro Devices is Nvidia's top rival. While AMD has been posting some impressive results of its own, the disparity between its forward P/E and Nvidia's is astounding. It may sound convoluted to say that a trillion-dollar company is cheap. But when you measure Nvidia against its megacap peers as well as its No. 1 rival, the case for buying the stock becomes increasingly clear.

As demand for AI applications continues to gain momentum, I see Nvidia continuing to play an integral role. And with the stock trading at discounts to smaller rivals as well as end customers reliant on the company's technology, now looks like a terrific opportunity for long-term investors to scoop up shares.