Berkshire Hathaway (BRK.B -0.09%) is headed by legendary investor Warren Buffett, who has an enormous following. As a result of his success, many investors follow his trades as soon as they are available when Berkshire Hathaway files its quarterly Form 13F, which reveals what moves the company has been making.

One noticeable change in its latest filing was Berkshire's 86% reduction in its Taiwan Semiconductor (TSM -0.23%) stake. So with Berkshire Hathaway selling, should you follow suit and liquidate your position? Let's find out.

Taiwan Semiconductor had a big customer cancel some of its order

The chip industry is notoriously cyclical, and Taiwan Semiconductor (commonly abbreviated as TSMC) is a vital part of this field. Its semiconductor foundries produce some of the top chips in the world, including cutting-edge 3 nm (nanometer) chips. However, when demand for consumer electrics falls, Taiwan Semiconductor gets whacked.

Because it is a foundry, it creates chips for customers like Apple, AMD, Nvidia, and many more technology giants. But when news like Apple reducing its 3 nm chip order by a significant margin breaks, it casts a shadow on the chip industry. This cycle has played out multiple times, but eventually, consumer demand returns, creating a massive demand for TSMC's products.

Berkshire likely believes the chip cycle has peaked, so it's getting out before things worsen.

But could Berkshire's short-termed mindset be your opportunity?

From a historical perspective, Taiwan Semiconductor looks like it has bottomed

Berkshire is usually a long-term-focused company, so if it sells a stock, it would seem to indicate management thinks the business is in trouble. However, I think it comes back to Buffett's No. 1 rule of investing: "Never lose money."

Because the chip cycle is turning over, Berkshire is getting out before it loses money. That's not to say Berkshire doesn't like the company. In fact, Charlie Munger, Buffett's right-hand man and vice-chairman of Berkshire, recently said: "But I do think Taiwan Semiconductor is the strongest semiconductor company on earth."

So how bad could it get for Taiwan Semiconductor? Well, let's look at a chart.

Chart showing Taiwan Semiconductor's price falling and EPS steady since 2021.

TSM data by YCharts

This chart shows how long TSMC's earnings per share (EPS) and stock price stayed below its all-time high. So if you look at the significant dips in TSMC's EPS figure, that lines up with various dips in the chip cycle. TSMC's 36% dip is roughly equal to what it experienced in 2005 and 2008, so the stock is at its historical bottoming point if you subtract what happened during the late 1990s and the dot-com bust.

With the stock trading at about 13.7 times earnings, you might think it's a bargain, but this is a trap. Earnings will likely fall throughout 2023 thanks to falling chip demand, and the stock will look more expensive from an earnings basis by the end of the year. However, the lowest price-to-earnings (P/E) ratio that Taiwan Semiconductor has reached this century was 9.8, so investors shouldn't be worried about too much more downside.

As Munger stated, TSMC is one of the best semiconductor companies on the planet. With its cutting-edge technology and solid customer base, TSMC will likely emerge on the other side of this downturn fine. Because of that, I think investors can use the pessimism of large firms like Berkshire to their advantage and establish a position in Taiwan Semiconductor. But you'll have to be patient with the results, as they may take a few years to come to fruition.