The S&P 500 has delivered impressive annual average returns over the past decade and investors should consider using this year's sharp stock market decline as an opportunity to add some great companies to their portfolios at attractive valuations. Nvidia (NVDA 3.71%) and Applied Materials (AMAT 0.73%) are two such companies that are worth buying now.

Both tech stocks have generated healthy returns for investors over the past several years. A $100,000 investment in Applied Materials at the beginning of 2014 was worth roughly $1 million at the end of 2021, assuming the dividends were reinvested. Nvidia, on the other hand, generated much bigger returns, turning $100,000 into roughly $7.8 million over the same period.

The growth drivers that these companies are sitting on could help them deliver such eye-popping returns over the next eight years as well. Let's see why Nvidia and Applied Materials have the potential to make more investors into millionaires by 2030.

1. Nvidia

Nvidia stock is up 20% so far this month, but shares of the graphics card specialist are still down 40% for the year. Investors who have been waiting to buy this tech stock may want to act while Nvidia's valuation is still at a relatively attractive level.

The chipmaker is trading at 47 times trailing earnings and 33 times forward earnings estimates. Those multiples represent a discount to its five-year average price-to-earnings ratio of 58. The stock is tempting because the company is sitting on bigger catalysts as compared to 2014.

The company reported $4.1 billion in revenue in fiscal 2014, which ended on Jan. 26, 2014, when it was mainly known for selling graphics cards for powering personal computers (PCs). Nvidia had started making moves in the data center market at that time, and that has paid off handsomely over the years.

In the year ended Jan. 30, 2022, the company reported revenue of $26.9 billion, with the data center business producing $10.6 billion of the total

The good part is that the data center business isn't done growing yet. Sales of data center accelerators such as CPUs (central processing units), GPUs (graphics processing units), and DPUs (data processing units) are expected to grow at 40% a year through 2030, generating nearly $156 billion in annual revenue at the end of the forecast period.

Nvidia is well placed to take advantage of this massive opportunity thanks to its solid market share in data center GPUs. More importantly, the company is all set to expand its addressable market in data centers when it enters the server processor market with its Grace CPUs next year, which have already been selected by several customers for deployment from the first half of 2023.

The data center market alone could turn out to be a massive tailwind for Nvidia through 2030 and give its top and bottom lines a big boost. Analysts are expecting the company's earnings to grow at an annual pace of 23% for the next five years, but it won't be surprising to see it clock faster growth for a longer time, thanks to opportunities in the data center and other emerging areas. The stock could rocket over the next eight years.

2. Applied Materials

Semiconductor stocks have taken a beating in 2022, with the PHLX Semiconductor Sector index down 27% so far this year. However, the demand for chips remains healthy thanks to the growing usage of chips in several applications ranging from smartphones to data centers to gaming consoles to cars and even factories.

Market research firm IDC forecasts a 13.7% increase in semiconductor sales this year to $661 billion. That's significantly higher than the industry's 2013 revenue of $305 billion. The semiconductor industry is expected to generate $1 trillion in annual revenue by 2030, according to McKinsey. Other third-party estimates peg the size of the semiconductor market at $1.2 trillion by 2030.

As such, the demand for the semiconductor manufacturing equipment that Applied Materials sells should remain strong in the long run. The company is already benefiting from a spike in capital spending by chipmakers, as evident from the 16% year-over-year increase in its revenue in the first six months of fiscal 2022, which started in November.

Analysts are upbeat about the company's prospects and expect its earnings to increase at a compound annual rate of nearly 14% for the next five years. Even better, Applied Materials sports a dividend yield of 1.1%. While that may not look like much, it is worth noting that the company has increased its dividend for the past five years and has a payout ratio of just 12%. This suggests that Applied Materials could keep increasing its dividend. And the healthy prospects of the market it operates in make it look like the stock is capable of replicating its past gains.

Throw in the company's valuation, and it is easy to see why buying Applied Materials stock looks like a no-brainer right now. The stock trades at just 13.7 times trailing earnings -- a nice discount to the S&P 500's multiple of 20.