Semiconductor stocks had a hard time toward the end of 2018, but they have gotten off to a flying start this year. This is clearly evident from the impressive gains clocked by the PHLX Semiconductor Sector index so far in 2019.

^SOX Chart

NVIDIA and Xilinx Year-to-Date Stock Performance vs. PHLX Semiconductor Sector Index, data by YCharts.

The positive sentiment has rubbed off nicely on the likes of NVIDIA (NVDA -2.69%) and Xilinx (XLNX): two chipmakers that have been in the news in recent months for reasons both good and bad. Though NVIDIA has fallen from grace in the aftermath of the cryptocurrency bust -- and the company has warned that it is in for a difficult year -- shareholders seem upbeat.

Xilinx, meanwhile, has taken off, thanks to a diverse set of catalysts that have positively impacted its financial performance. Its programmable chips are in great demand on the back of fifth-generation (5G) wireless networks and artificial intelligence (AI)-enabled data centers. So, Xilinx's rally seems justified when compared with NVIDIA's.

But is that enough to make Xilinx a better bet than NVIDIA? Let's find out.

Man looking at a wall which has arrows painted on it.

Image Source: Getty Images

NVIDIA is on shaky ground

NVIDIA is having a terrible time right now because its gaming hardware business has taken a big hit due to an oversupply of graphics cards. The gaming segment's revenue crashed 45% year over year during the fourth quarter of fiscal 2019, dealing a body blow to NVIDIA's top and bottom lines, as it accounts for nearly half of the company's sales.

Also, sales in NVIDIA's OEM and intellectual property segment, which includes sales of graphics cards for cryptocurrency mining purposes, fell 36% year over year. NVIDIA doesn't have a way of identifying if the graphics cards it sells are used for gaming or mining by the end user. So, there's a possibility that some of the graphics card sales included in the gaming segment actually went to cryptocurrency miners.

Once the cryptocurrency mining wave died, graphics card prices crashed as demand fizzled out. Retailers were left with excess graphics card supply, and they are busy working through that glut. As a result, graphics card demand is weak.

NVIDIA is witnessing weaker-than-anticipated sales of its latest-generation graphics cards, although it believes that the market will hit bottom in the current quarter. But even if that happens, NVIDIA's outlook for the year indicates that it will struggle to attain the kind of rapid growth that investors grew used to in recent years.

The company expects full-year revenue to be flat in fiscal 2020, though investors can take heart that it anticipates a major comeback after a projected 31% year-over-year sales decline in the current quarter. However, NVIDIA may find it difficult to walk the talk, since rival Advanced Micro Devices' product development moves could help the latter make a bigger dent in the gaming and data center markets.

In my opinion, investors should wait for concrete signs of a turnaround at NVIDIA before buying into the stock. The market isn't likely to take a lenient view the next time its results and guidance fall below expectations, so it's better to be safe than sorry.

Xilinx could keep flying

Xilinx has stepped into the limelight big-time in recent quarters because of the utility of its programmable chips. The company's field-programmable gate arrays (FPGAs) are being deployed in data centers by the likes of Amazon and Alibaba to power their AI-enabled cloud computing applications. Also, Xilinx's chips are being used in smart memory drives meant to enhance computing speeds in data centers.

But the hottest catalyst for Xilinx right now is 5G wireless connectivity. The company's communications revenue shot up 41% year over year last quarter, thanks to its early 5G deployments. Telecom customers have lined up to buy Xilinx's FPGAs because they can be configured after being purchased, allowing network operators to make any tweaks or updates easily during the initial rollout phase.

This creates a massive opportunity for Xilinx, since more telecom operators can be expected to opt for its programmable chips once 5G network deployments gather steam globally. IDC estimates that 5G infrastructure investments will jump from $528 million last year to $26 billion in 2022, indicating healthy demand for Xilinx's programmable chips.

More importantly, Xilinx is future-proofing its 5G opportunity by integrating additional features into its 5G chip platform. The company is trying to ensure that its offerings remain relevant even when application-specific integrated circuits (ASICs) meant specifically for 5G infrastructure hit the market.

The chipmaker says that its 5G chip platform can reduce the power consumption and size of the system by 50% to 75%, thanks to the integration of digital, analog, and embedded software into a single design.

Meanwhile, FPGA demand in data centers is expected to increase at a rapid pace. According to Research and Markets, demand for data center accelerator chips, such as central processing units, graphics cards, FPGAs, and ASICs, is expected to grow at an annual rate of almost 50% through 2023, when the market will be worth $21 billion.

Of these types of chips, demand for FPGAs is expected to grow at the fastest rate during the forecast period because they are expected to play an important role in accelerating enterprise workloads. Xilinx is in the pole position to take advantage of this opportunity because it leads the FPGA market.

The verdict

Xilinx's business is on the rise while NVIDIA's is waning.

XLNX Revenue (Quarterly) Chart

NVIDIA vs. Xilinx Revenue and Net Income (Quarterly), data by YCharts.

However, investors looking to take advantage of Xilinx's growth will have to pay a premium, as the stock trades at almost 40 times the company's current-year earnings. NVIDIA is cheaper, with a trailing price-to-earnings (P/E) ratio of less than 29. But Xilinx's premium seems justified because of its superior growth rate. Also, the company enjoys a clear path to success, as it leads the fast-growing FPGA market, while NVIDIA is trying to overcome its recent slump in the face of tough competition from AMD.