While tech stocks are driving the market's rally to record highs, there are still plenty of hidden gems in the sector that investors can take advantage of. Using the S&P 1500 Tech composite as a universe, CNBC Pro looked at stocks trading at a discount to the index, sector, and their respective industry based on forward price/earnings ratio. In other words, we tried to find stocks that were cheaper than their peers based on their stock prices compared to their future earnings potential. We also considered the following criteria: Gaining momentum: Stocks that have been rising over the past month Analysts expect future gains: Stocks with at least 5% upside from analysts' average consensus price target Market capitalization of at least $1.5 billion Two stocks were displayed on a screen. Percentage of chip stocks in Western Digital and Skyworks Solutions. Chipmakers are riding the tailwinds of the artificial intelligence craze, and Wall Street analysts still think these two stocks have significant upside potential. Oracle is also on the list. Database software stocks rose 12% on Tuesday after fourth-quarter results beat analysts' revenue expectations. Oracle's largest business, Cloud Services and License Support, saw revenue increase 12%. Investors may want to take a closer look at First Solar, according to the screen. First Solar recently boosted its results by reporting solid quarters, with strong results through 2026 and an order backlog that stretches to the end of the decade. Belden, TD SYNNEX, Corning, NetScout Systems and Envestnet were also on the list.