It’s been a tough year in the stock market, but reserve some empathy for semiconductor investors.

The iShares Semiconductor ETF SOXX, +3.06% is down 40.5% this year, compared with 19.6% for the benchmark S&P 500 SPX, +0.92%.

You never want to give in to schadenfreude, but on the other hand it’s time to turn their pain into your gain.

The selloff means that bargains in quality names abound — that is, for anyone who is patient enough to think long term.

“In hindsight, periods like these tend to be incredible buying opportunities,” says David Jeffress, a portfolio manager at Laffer Tengler Investments.

Before we get to five favorite stocks of Jeffress and two other chip-sector experts, here are three main concepts to keep in mind when hunting for bargains in the space.

Read: Semiconductor stocks have bounced from 2022 lows — and analysts expect big upside next year

1. The good thrown out with the bad

The best news for new investors is that good names are getting thrown out with the bad in the current debacle. “Semiconductor names get painted with a fairly broad brush. But the companies are not all created equal,” says Jeffress. “We focus on higher quality, so selloffs like these are tremendous buying opportunities.”

In contrast, be wary of the super-high-growth, speculative names with high customer concentration.

2. You can’t time the cycle

Forget about trying to call the lows.

“It’s impossible to handicap when the bottom of the cycle is,” says Todd Lowenstein, chief equity strategist at The Private Bank at Union Bank. “Averaging in during the downturn is the way to go.”

But there are a few reasons to think chip stocks might not go much below their mid-October lows. Ongoing consolidation in the sector has increased returns on capital. And the related improved diversification and cost cutting suggest chip companies are less cyclical than they used to be.

Plus, any looming recession might not be all that bad. Lowenstein thinks we are going through a rolling recession that’ll pick off various sectors at different times. This suggests any recession will be short and shallow.

3. Chips are becoming ubiquitous

Semiconductors are infiltrating so many aspects of life, demand for them will recover sooner or later, and boost the shares of chip stocks you buy now.

“Everyone is worried about what is going to happen if we go into recession and what that means for chip stocks. But what they missing is that the need for chips is expanding,” says Jeffress.

The big-picture secular demand trends like cloud computing, artificial intelligence, electric vehicles, robotics, 5G and the Internet of Things are not going away.

“Chips are ubiquities. They are the backbone of the modern economy,” says Lowenstein.

Here are five chip stocks that look attractive now because they are quality names trading at discounts. They are in alphabetical order.

Note that they all pay dividends, which account for a big part of investor and market returns, over time. You get paid to wait, as the saying goes. In fact, four of the companies have higher payouts than the S&P 500’s 1.8% dividend yield.

1. Analog Devices. Dividend yield: 2.1%

Analog Devices ADI, +2.30% specializes in analog signal processing chips and semiconductors used in power management. That makes it a play on everything from cars and wireless base stations, to 5G, factory robots and medical equipment.

“Its chips get designed into long-cycle trends in the auto and industrial sectors,” says Lowenstein. That provides stability and visibility on earnings. So does its very diverse customer base.

These qualities distinguish it from chip companies that are a play on one or two large product cycles and market trends that can go out of favor quickly. This plus a forward price-to-earnings (P/E) ratio of 14.8 vs a five-year average of 20.7 add up “quality at a reasonable price” for Lowenstein.

Analog Devices has a wide moat because of its proprietary chip designs, and because once its chips get designed into products it is costly for customers to switch to another supplier, says Brian Colello, a stock analyst at Morningstar, which puts a lot of emphasis on the importance of moats in investing. This provides visibility into revenue trends and pricing power.

Reports earnings Nov. 22.

2. ASML Holding. Dividend yield: 1.4%

Chip makers use photolithography to etch patterns onto semiconductors in ways that increase the number of transistors they can cram on the same amount of silicon.

The hottest iteration of this is called extreme ultraviolet (EUV) lithography. ASML ASML, +2.79% is the main supplier of photolithography equipment that does EUV lithography. This equipment is so important, ASML’s top three customers — Intel INTC, +2.25%, Samsung Electronics and Taiwan Semiconductor TSM, +4.22% — took equity stakes in ASML to help fund EUV development research.

ASML trades at a forward P/E of 23.8 which isn’t cheap compared to an S&P 500 P/E of 16.5.

“ASML is fairly and reasonably valued. But if you are going to pay up for a business, ASML is the one to pay up for,” says John Rotonti, who covers the chip sector for the Motley Fool. “They have guided for 11% compound annual revenue growth over next decade. That is what the market is pricing in.”

That said, ASML does actually look cheap relative to its own history. The current forward P/E of 23.8 is well-below the trailing five-year average of 33.9. ASML has a wide economic moat based on its proprietary knowhow that’s far ahead of what competitors have. At a time when tech companies are reporting weaker sales trends, ASML upped its 2022 sales growth estimate to 13% from 10% when it reported earnings Oct. 19.

Reports earnings Jan. 25.

3. Broadcom. Dividend yield: 3.5%

Broadcom AVGO, +2.27% sells radio frequency filters used in smartphones to manage various data streams and filter out interference. Apple AAPL, +1.93% is its main customer.

This makes it a play on 5G. It also sells chips used in networking switches, broadband, enterprise storage, and wireless connectivity. Broadcom’s diverse product line stems from a series of mergers over the years and one more is pending — the acquisition of VMware VMW, +1.19%. This will broaden their product offering yet once again. Broadcom has a good track record for purchasing industry leaders and selling off their non-core businesses.

All of this helps explain why Broadcom is one of Jeffress’ “12 best ideas,” especially favored stocks that are part of Laffer Tengler Investments concentrated equity strategy. He also likes the large order backlog.

“It’s probably real, and not the result of deliberate double ordering which can create sales growth air pockets,” says Jeffress. That’s because Broadcom asks customers to prove they need the inventory they order.

“The growing backlog and their breadth of chip offering suggests Broadcom will weather an economic slowdown,” says Jeffress. “The demand for their products is insatiable. They see demand continuing to accelerate as the data center buildouts continue.”

Jeffress argues that Broadcom is cheap, citing its historically high dividend yield. Dividend yields rise when stock prices sink. When stocks fall enough such that dividend yields rise to relatively high levels, this is a good sign of value.

Reports earnings Dec. 7.

4. Taiwan Semiconductor Manufacturing. Dividend yield: 3%

Taiwan Semiconductor TSM, +4.22% is the world’s chip supplier. Its plants supply chips used in virtually all devices. This makes it a play on everything from smartphones and artificial intelligence, to the Internet of Things and the cloud.

Taiwan Semiconductor also benefits from two sector trends. One is that chip makers are going fabless to leave the manufacturing to someone else. Next, customers are demanding increasingly complex chips. Taiwan Semiconductor has the sophisticated technology that gets the job done. Its knowhow and size give it a wide moat.

Taiwan Semiconductor looks cheap trading at a forward P/E of 12.8 compared to an average of 21.4 over the past five years and 16.5 for the S&P 500.

“That valuation makes no sense to me,” says Motley Fool’s Rotonti. “Taiwan Semiconductor is the most attractively-priced semiconductor company that I am interested in today. It is extremely undervalued.”

He projects earnings and free cash flow will grow at a mid-teen percentage rate over the next five years.

The low valuation is particularly odd because it appears to price in a cyclical downturn for the business.

“Demand for Taiwan Semiconductor’s fabs is very strong and long-term in nature. I don’t think Taiwan Semiconductor’s business will be very cyclical going forward,” says Rotonti.

Reports earnings Jan. 11.

5. Texas Instruments. Dividend yield: 3.1%

Like Analog Devices, Texas Instruments TXN, +2.75% is in analog chips. Its largest end market is the industrial sector, and the auto sector in particular. Companies with exposure to these cyclical areas of the economy get hit when recession worries abound. This explains why Texas Instruments’ stock is cheap. It trades with an historically high dividend yield, notes Jeffress.

Texas Instruments does have issues near term. While it posted 13% year-over-year sales gains for the third quarter, it offered negative fourth quarter guidance. This is because industrial sector demand is surprisingly weak.

But this near-term guidance isn’t a big deal because Texas Instruments is a quality chip-sector name, says Jeffress. We know this in part because the stock has performed relatively well this year, he says. It is down 14.5% vs. 19.6% for the S&P 500 and 40% for the iShares Semiconductor ETF.

Next, Texas Instruments has a huge backlog of orders.

“We believe the business is more resilient than other investors are giving them credit for,” says Jeffress.

And it is returning cash to shareholders via buybacks and its dividend, which it just hiked.

“Management only increases dividends when they have a high degree of confidence they can weather the economic environment,” he says.

Texas Instruments also has a nice economic moat because of its proprietary analog chips, and the fact that it costs customers a lot to switch suppliers once they have designed the chips into their products.

Reports earnings Jan. 23.

Michael Brush is a columnist for MarketWatch. At the time of publication, he owned SOXX and ADI. Brush has suggested ADI, INTC and TXN in his stock newsletter, Brush Up on Stocks. Follow him on Twitter @mbrushstocks.