NVIDIA's Titan X graphics card. Image source: NVIDIA

NXP Semiconductors (NASDAQ:NXPI) is the largest provider of automotive chips in the world. Last quarter, about 36% of the company's revenue came from its automotive division -- its single largest segment. The rest of NXP's revenue comes from several different sources, including, most notably, the NFC chips it supplies to smartphone makers.

NVIDIA (NASDAQ:NVDA) in contrast, is mostly dependent on the market for video games -- PC games in particular. Gamers purchase the company's GPUs in droves, as they're required to power graphically intense modern PC games. Just over half of NVIDIA's revenue last quarter was gaming-related. The rest mostly came from graphics professionals and data centers. NVIDIA is also an automotive supplier, but less than 10% of its revenue last quarter was automotive-related.

But that overlap still makes for an interesting comparison, as both companies appear well-poised to capitalize on the growing shift toward autonomous vehicles. Investors looking to add some chip or autonomous car exposure to their portfolios might consider buying shares in one of the two companies. But which is the better pick?

The connected, autonomous vehicle

In terms of its product portfolio, NXP is more diversified than NVIDIA, with dozens of different products spanning many industries. Its top customers include smartphone makers Apple, Samsung, and Huawei, as well as automotive suppliers Delphi and Continental, and electronics companies Philips and Delta Electronics. In addition to automotive, NXP divides its business into four other segments: Standard Products (about 12% of revenue), Secure Identification Solutions (about 9.5% of revenue), Secure Connected Devices (about 22% of revenue), and Secure Interface & Infrastructure (about 19% of revenue).

NXP's Standard Products business is broad based, and includes many general semiconductor components. Its Secure Identification Solutions business provides chips for chip-based credit cards, public transportation services, and secure government documents. Secure Connected Devices is NXP's Internet-of-Things business, and includes NFC chips and low-power bluetooth controllers -- technologies designed to allow objects to interact with one another. Finally, NXP's Secure Interfaces and Infrastructure business consists of chips used in networking, power chargers, and display signals (such as the HDMI transceivers found in home theater receivers).

In short, NXP is a diversified provider of chips for both consumer and enterprise electronics. If the market for electronic devices continues to expand, NXP could do well.

But for investors, the most intriguing aspect of NXP's business may be its automotive exposure. NXP provides a wide variety of chips designed for automobiles. Most are relatively pedestrian (no pun intended) -- environmental sensors, security systems, in-car networking -- but some are more exciting. Earlier this month, NXP announced its BlueBox system, an off-the-shelf autonomous driving solution that should allow automakers to sell fully autonomous vehicles by the end of the decade. NXP's system relies on its automotive sensors and its chips for processing power. Given its deep ties to the automotive industry, NXP could emerge as a major supplier of autonomous vehicles in the years ahead.

Virtual reality and AI

NVIDIA's automotive business is similarity pedestrian, in the sense that most of its automotive revenue is currently coming from in-car infotainment systems. But like NXP, NVIDIA is also working on solutions for autonomous vehicles.

Earlier this year, NVIDIA unveiled DRIVE PX 2, its second-generation autonomous car platform that relies on some of NVIDIA's most powerful chips. DRIVE PX 2 is effectively a supercomputer for the car, designed to process data from a variety of sources autonomous cars may depend on, including LiDAR, radar, and video cameras. Right now, NVIDIA isn't actually selling automobile manufacturers chips, but rather working in tandem with them to develop solutions. In total, NVIDIA's automotive division generated about 8.6% of its revenue last quarter. That was up an impressive 47% annually, but most of that was driven by infotainment sales.

But NVIDIA has exposure to other interesting growth markets beyond autonomous cars, including virtual reality and artificial intelligence.

The Oculus Rift and Vive -- the two most advanced virtual reality headsets currently on the market -- require powerful graphics cards to function. NVIDIA dominates the market for discrete graphics cards, and its recently unveiled GTX 1080 and GTX 1070 may help sustain its lead for the foreseeable future. Virtual reality headsets have yet to go mainstream, but if they do, it will likely mean that NVIDIA finds itself selling many more GPUs in the months and years ahead. NVIDIA's GPUs are also popular in data centers, and NVIDIA is increasingly selling ever-more powerful GPUs to companies experimenting with artificial intelligence. Last month, NVIDIA unveiled its DGX-1, a $129,000 box designed specifically for AI solutions.

NXP is a cheaper stock

From a valuation perspective, NVIDIA is clearly the more expensive stock. On both a trailing- and forward-price-to-earnings ratio basis, NVIDIA is priced much more aggressively than NXP.

NXPI PE Ratio (TTM) data by YCharts

But that difference in valuation makes sense. NVIDIA's business is growing more rapidly, and it has more exposure to a wider variety of next-generation technologies. Last quarter, NVIDIA's revenue rose 13% on an annual basis -- while NXP's declined almost 16%. (NXP reported annual revenue growth of nearly 52%, but that growth was driven by the acquisition of Freescale. NXP's total first-quarter revenue was actually below the first-quarter revenue of both companies combined in 2015.)

Both stocks look attractive, but appear to offer different risk profiles. NVIDIA may offer more upside, but NXP could be the safer pick.