Many chipmakers posted strong numbers over the past year, thanks to rising demand for semiconductors across multiple industries. Two standout names from that sector are AMD (NASDAQ:AMD) and Cypress Semiconductor (NASDAQ:CY) -- which respectively rallied about 460% and 50% over the past 12 months. Let's take a closer look at both chipmakers, and see if either stock is still worth buying after those big rallies.

AMD and Cypress both rallied strongly last year -- can it top those gains in 2017?

Image source: Getty Images.

What do AMD and Cypress do?

AMD is the world's second largest maker of x86 CPUs and discrete GPUs. But over the past decade, Intel's (NASDAQ:INTC) CPUs and NVIDIA's (NASDAQ:NVDA) GPUs have greatly reduced AMD's share of both markets. To diversify away from those two markets, AMD invested heavily in Enterprise, Embedded, and Semi-Custom (EESC) chips for other devices like gaming consoles. It also launched low-end "VR ready" GPUs to tap into the growing demand for PC-based VR games.

Cypress makes programmable semiconductors for the automotive, industrial, home automation, medical devices, and consumer electronics markets. It's been expanding aggressively over the past two years, by first merging with embedded chipmaker Spansion in a $5 billion deal in 2015, and then acquiring Broadcom's (NASDAQ:AVGO) Internet of Things (IoT) business for $550 million in 2016. Those moves made it a major player in the growing IoT market.

How fast are AMD and Cypress growing?

After falling year-over-year for seven straight quarters, AMD's revenues rose in the past three quarters, thanks to robust demand for the PS4 and Xbox One supporting its EESC business, and strong sales of its new Polaris-based GPUs bolstering the Computing and Graphics business. AMD's total revenue rose 16% annually to $1.11 billion last quarter, fueled by 4% growth in EESC revenues and 28% growth in Computing and Graphics revenues. For the current quarter, AMD expects its revenue to rise 18% annually at the midpoint -- which easily tops analysts' estimates for 2% growth.

Cypress' quarterly revenues have risen annually for nine straight quarters, but some of that growth was inflated by its aforementioned acquisitions. Cypress' revenue rose 16% annually to $530 million last quarter, thanks to the Broadcom acquisition boosting its microcontroller and connectivity division (MCD) revenues, and robust sales growth in China and Japan. For the current quarter, Cypress expects its revenues to rise 20% annually at the midpoint -- which also beats the consensus estimate of 17% growth.

The tailwinds and headwinds

AMD has enjoyed a nice lift from sales of consoles and low-end gaming GPUs over the past year, but the competition is expected to intensify this year as NVIDIA launches its next-gen Volta GPUs and Intel introduces its next-gen 10nm Cannonlake CPUs. AMD is meeting that competition head-on with its high-end Vega GPUs and Ryzen CPUs. Early data indicates that the Vega and Ryzen chips might respectively outperform NVIDIA's current-gen Pascal and Intel's current-gen Kaby Lake chips, but it's unclear how they'll fare against Volta and Cannonlake.

Another issue with AMD is its dependence on console sales. The bulls believe that the recent PS4 and Xbox One upgrades for 4K and VR gaming can rejuvenate console sales this year, but the bears believe that those new features might not persuade consumers to buy new hardware.

The RX 480 is one of the cheapest VR ready cards on the market.

AMD's RX 480. Image source: AMD.

Cypress is well-poised to benefit from the growing demand for connected and programmable chips in the automotive and industrial sectors. Those two high-growth markets accounted for 55% of Cypress' revenue in 2016, compared to just 30% in 2011. The Broadcom acquisition also boosted its content share per connected car by 26%, and is helping Cypress address the wired, wireless, memory, and data storage needs of the broader IoT market. But looking ahead, a key challenge for Cypress will be staying competitive against bigger rivals like Texas Instruments (NASDAQ:TXN), which targets many of the same markets.

Profitability and valuations

Neither AMD nor Cypress is profitable on a GAAP basis. AMD reported a GAAP loss of $497 million in fiscal 2016, but that represented an improvement from its loss of $660 million in 2015. On a non-GAAP basis, AMD's net loss narrowed from $419 million to $117 million.

Cypress reported a GAAP loss of $686 million in fiscal 2016, which was much wider than its loss of $379 million in 2015, due to the rising costs of its inorganic growth strategy. But on a non-GAAP basis, its net income rose 142% to $170 million. Analysts currently believe that AMD can return to non-GAAP profitability this year, and expect Cypress' non-GAAP earnings to grow 41% this year.

AMD currently has an EV/Sales ratio of 2.7, which is lower than Intel's ratio of 3.1 and NVIDIA's ratio of 9.4. Cypress also has an EV/Sales ratio of 2.7, which compares favorably to Texas Instruments' ratio of 5.7. That makes both stocks fairly cheap relative to their industry peers.

The winner: Cypress Semiconductor

I see solid reasons for buying both AMD and Cypress, but AMD's future relies too heavily on Ryzen and Vega's ability to counter Cannonlake and Volta. If those plans don't work out, AMD stock could quickly lose its footing.

Cypress has a better-diversified business, and its growth this year isn't heavily dependent on outmaneuvering bigger competitors. Cypress also pays a forward dividend yield of 3.7%, while AMD doesn't pay one at all. Therefore, the choice between the two is pretty clear -- Cypress is a much safer play than AMD at current prices.

Leo Sun has no position in any stocks mentioned. The Motley Fool owns shares of and recommends Nvidia. The Motley Fool recommends Broadcom, Cypress Semiconductor, and Intel. The Motley Fool has a disclosure policy.