Intel Corp. is in talks to buy Altera Corp. in a deal that would be the chip-making giant’s largest takeover ever.