Over the next few years, smarter semiconductor chips will be found in more and more places, spanning devices, cars, industrial factories, 5G phones, and the Internet of Things (IoT). The data these sensors and chips will produce will be sent back over the internet to cloud data centers, where it will be processed, analyzed, and redirected back. Thus, the leading semiconductor chips at the heart of this tech-driven revolution -- including NVIDIA (NVDA -3.33%) and NXP Semiconductors (NXPI 4.18%) -- all seem to have exciting long-term prospects.

These two stocks have had a tough go of it recently in light of the ongoing trade war, yet assuming those issues eventually get resolved, each also has a promising future.

If you're willing to take the Foolish long-term view, which chip pick is best for you?

A cartoon overlay of a city signifying a smart city.

Image source: Getty Images.

What each company does

When assessing the companies, it's important to know which kinds of chips each makes, as well as the end markets each serves.

NVIDIA is the leading producer of graphics processing units (GPUs), which power today's leading video games and special effects. The company's GPUs are also used in artificial intelligence processing, as GPUs are excellent at handling large amounts of data. Finally, NVIDIA's embedded Tegra systems are used in autonomous driving -- yet another exciting long-term growth opportunity.

NVIDIA Segment

% of 2018 Revenue

Gaming

53.3%

Professional visualization

9.6%

Data center

25%

Automotive

5.4%

OEM and IP

6.5%

Data source: NVIDIA annual report. OEM and IP = original equipment manufacturers and intellectual property.

NXP Semiconductors produces different kinds of chips than NVIDIA. NXP primarily makes microcontrollers -- low-power chips used for a specific function in an electrical system, such as those found in automobiles, industrial machines, and smartphones. It also makes analog chips, which turn physical signals into digital ones, and vice versa.

By end market, NXP's segment breakdown looks like this:

NXP Semiconductors Segment

% of 2018 Revenue

Automotive

48%

Industrial and IoT

19%

Communications infrastructure and other

19%

Mobile

12%

Data source: NXP Semiconductors Q4 2018 presentation.

Check out the latest earnings call transcripts for NVIDIA and NXP Semiconductors.

Current troubles

Both companies are dealing with the fallout from a Chinese economic slowdown, caused in part by the U.S.-China trade negotiations. On top of that, NVIDIA is dealing with the headwind of the cryptocurrency crash of 2018. That affected the company because GPUs are used heavily in cryptocurrency mining.

The combined slowdown on a number of fronts was much bigger than expected and left NVIDIA with a huge amount of unsold GPU inventory at the end of 2018. NVIDIA thus saw its gaming revenue cut in half quarter over quarter, with modest declines in other segments as well. As a result, the company posted a 24% overall revenue decline in Q4 from the prior-year period.

NXPI Revenue (Quarterly YoY Growth) Chart

Data by YCharts.

NXP, too, is facing headwinds: The Chinese automotive market slowed mightily in Q4, while European emissions testing has held back European auto production. The slowdown in the auto market, where NXP gets 48% of revenue, caused NXP's revenue to decline 2.2% year over year -- certainly not a good showing, though nowhere near NVIDIA's plunge.

However, NVIDIA's quarterly decline is due in part to stiff comparisons from its previous breakneck growth. Stepping back and looking over the past three years, it's clear NVIDIA has the more exciting growth story.

NXPI Revenue (Annual YoY Growth) Chart

Data by YCharts.

In addition, while both companies' margins are quite impressive, NVIDIA still managed to produce higher operating margins in spite of last quarter's slump. That's a testament to the company's  competitive advantages, which come from both its hardware expertise and CUDA programming platform, an innovation that places the company years ahead of would-be competitors.

Valuation

However, when it comes to valuation, things get less exciting for NVIDIA, and more so for NXP. Currently, NXP trades at just 13 times earnings, whereas NVIDIA trades for about 23 times earnings -- nearly double the price.

Not only that, but NVIDIA's forward P/E ratio, based on this year's upcoming earnings estimates, is actually higher at 28, meaning analysts expect NVIDIA's earnings to decline. Meanwhile, NXP's earnings are projected to grow modestly:

NXPI PE Ratio (TTM) Chart

Data by YCharts.

Which should you choose?

The choice between NXP and NVIDIA comes down to what kind of investor you are. For those looking for a lower-risk option, NXP is likely the better choice. It has steadier, albeit not spectacular, numbers, but it's reasonably priced and has a dividend yield just over 1%.

NVIDIA, on the other hand, is the better choice for those willing to take on a bit more risk in order to achieve bigger long-term gains, as it's the more exciting growth story. And for those who can't decide but want to play a potential recovery in semiconductors, both are fine choices.