Tech investors who are looking for their next stock pick may have come across semiconductor companies Ambarella, Inc. (NASDAQ:AMBA) and NVIDIA Corporation (NASDAQ:NVDA). Ambarella makes chips that process visual information for many types of cameras, including for security automotive cameras, and for GoPro's action cameras. In fiscal 2018, about 12% of the company's top line came from selling chips to GoPro.

Ambarella's stock price hasn't quite lived up to the company's potential, and over the past year, its shares have failed to keep pace with the S&P 500. In stark contrast, NVIDIA's share price has far exceeded the S&P 500 over the past year and is up about 60%. Besides Ambarella and NVIDIA both being semiconductor companies, there aren't many similarities between the two. NVIDIA makes the majority of its revenue from selling graphics processing units (GPUs) for the gaming market, which attributed to about 54% of its top line in the most recent quarter.

Let's compare their financial fortitude, competitive advantages, and valuations to see which one looks like the better long-term buy.

A microchip on a motherboard.

Image source: Getty Images.

Financial fortitude

Company

Cash

Debt

Free Cash Flow (TTM)

Ambarella

$435 million

$0

$59 million

NVIDIA

$7.1 billion

$2 billion

$4 billion

Data source: Yahoo! Finance and Morningstar. TTM = trailing 12 month.

Both of these companies are in solid financial shape when it comes to cash, debt, and trailing free cash flow. Ambarella's ability to run its business without any debt is impressive, even for a company with a market cap of just $1.4 billion, and it continues to generate significant free cash flow.

Similarly, NVIDIA is performing well across these three financial categories as well. The company does have some debt, but it's relatively low when compared to its $4 billion in trailing free cash flow and the company's overall sales -- which totaled $9.7 billion in fiscal 2018.

Winner: Tie.

Competitive advantage

One of the most important aspects of picking a stock is finding companies that have a competitive advantage over their rivals. Not only can this help companies earn more sales and earnings in the short term, but most importantly, it allows them to outpace their competition for years to come.

NVIDIA is currently a leader in the GPU space when compared to its most relevant rival, Advanced Micro Devices (NASDAQ:AMD). NVIDIA's GPUs accounted for about 66% of discrete desktop GPU market (graphics chips in desktop computers) at the end of 2017. Not only is NVIDA beating AMD in discrete GPU market share, but it also outpaced AMD in the entire GPU market with 18% market share, compared to AMD's 15%. That's not a massive lead over AMD, but what NVIDIA has going for it -- that AMD doesn't -- is that NVIDIA is also using its GPUs to expand into artificial intelligence data centers and driverless cars. AMD hasn't kept pace in these two markets at all, which means NVIDIA is starting to build out a competitive advantage in these two segments.

Ambarella, unfortunately, isn't in as good of shape. There's nothing inherently unique about Ambarella's system-on-a-chip (SoC) technologies, which means the company can't build out a sustainable competitive advantage over its competition. The company has wisely begun to diversify its revenue streams away from its previously heavy reliance on GoPro, but any of Ambarella's core customers could just as easily choose a rival SoC maker over Ambarella.

To be fair, NVIDIA isn't immune to its customers moving toward AMD GPUs in the future, but I think NVIDIA's ability to tap new markets that its competitor isn't still provides it enough of an advantage to earn it the win in this match-up.

Winner: NVIDIA.

Valuation

Next, we'll take a look at both of these companies' valuation based on their price-to-earnings ratio (P/E), their forward P/Es (a ratio that looks at future earnings projections) and their enterprise value-to-EBITDA ratio (earnings before interest, taxes, depreciation, and amortization).

Company

P/E Ratio (TTM)

Forward P/E

EV/EBITDA

Ambarella

219.8

33.5

71.0

NVIDIA

40.2

30.7

35.3

Data source: Yahoo! Finance. TTM = trailing 12 month.

It's not unusual for tech stocks to have high valuations, but of course, that doesn't mean every technology company is worth paying a premium for. For comparison, stocks in the S&P 500 have an average P/E of about 25 and an EV/EBITDA of 15 right now.

So, we can see that NVIDIA's trailing P/E is higher than the average, but it's still far lower than Ambarella's sky-high P/E of 219. Additionally, if we look at each company's enterprise value-to-EBITDA, they are both significantly higher than the average, but Ambarella's is far more expensive compared to NVIDIA's shares.

Considering that NVIDIA's shares have grown more than 50% over the past year, and Ambarella's share price has dropped 16%, NVIDIA's lower metrics look even more attractive.

Winner: NVIDIA.

The verdict

It's clear from this match-up that NVIDIA is the better buy between these two tech stocks. Not only is NVIDIA a leader in the GPU market, but it's also carving out new opportunities in driverless cars and artificial intelligence, which should allow it to outpace competitors for years to come.

Meanwhile, Ambarella has managed to diversify its sales in the SoC business and rely less on GoPro, but its shares are underperforming the market, they are expensive compared to NVIDIA's, and the company doesn't appear to be creating any technology to set itself apart. For all of those reasons, I think NVIDIA is easily the better buy, even though its shares are trading at a bit of a premium right now.

Chris Neiger has no position in any of the stocks mentioned. The Motley Fool owns shares of and recommends Ambarella, GoPro, and Nvidia. The Motley Fool has a disclosure policy.