SAN FRANCISCO (KCBS) — A wave of semiconductor consolidation is washing over Silicon Valley, with a pair of Milpitas companies being bought in massive deals.

Irvine-based Western Digital is buying memory chipmaker Sandisk for $19 billion. The value of the deal depends on the closing of an investment from China’s Unispendour in Western Digital, and Sandisk may require Toshiba’s green light as Sandisk and Toshiba partner on chipmaking.

Fremont-based Lam Research is also buying chip equipment maker KLA-Tencor for more than $10 billion. Lam will now have almost 50 percent of the wafer fabrication equipment market.

Its already been a record year for semiconductor mergers, with the Sandisk and KLA-Tencor deals pushing the total dollar value this year to more than $100 billion.

The deals are resulting from higher demand for cheaper chips found in all sorts of devices now, as well as a smaller client base for the chip industry with companies like Apple and Samsung focusing more on homegrown components.