Stephen Hawking warns that great technological advances can leave most people "miserably poor."

The well-known British physicist and author said technology is partly to blame for the rise in income inequality.

"Everyone can enjoy a life of luxurious leisure if the machine-produced wealth is shared, or most people can end up miserably poor if the machine owners successfully lobby against wealth redistribution," he said in a Reddit AMA (ask me anything) post last week.

"So far, the trend seems to be toward the second option, with technology driving ever-increasing inequality," Hawking said.

It all comes down to how the gains are distributed between the rich and the poor.

Related: U.S. and Israel have worst inequality in the developed world

The tech community has already fired back.

Marc Andreessen, the outspoken entrepreneur and de facto Silicon Valley spokesman, tweeted that Hawking was trotting out old rhetoric.

"Shorter Stephen Hawking: 'For hundreds of years, people who claimed that machines reduce jobs have looked silly. But I'll be different!'" wrote Andreessen.

He even suggested someone should buy Hawking an Economics 101 textbook.

It's a hot debate among economists and in Silicon Valley where the rising wealth of young tech workers stands out starkly against the mostly minority low income communities in San Francisco.

Hawking is right on this one, not Andreessen

Hawking wins this round, according to most experts.

There's little doubt that technology has driven economic growth in the U.S. and elsewhere in the world. It's why so many countries are trying to replicate Silicon Valley on their own turf.

But while the pie is growing, not everyone is getting more of it.

"My reading of the data is that technology is the main driver of the recent increases in inequality. It's the biggest factor," Erik Brynjolfsson, a professor at MIT's Sloan School of Management, told "Technology Review."

Related: Unemployment keeps going down. So why aren't wages going up?

Technology killed many blue collar jobs

The key problem: Technology has replaced many blue collar jobs that paid well. Those workers have had to switch into retail and home healthcare jobs, where the pay is typically lower.

So Andreessen is right that people still have jobs. But the question is, at what pay?

The median income in the U.S. today is about the same as it was in 1995 when the tech boom really took off. Wages just aren't growing for the bulk of Americans.

But those at the top are seeing large gains -- both from pay and from their investments doing well.

There is increasing competition for engineers and other highly skilled workers. That explains why the pay gap between those with college degrees and those without has widened since the 1970s.

Workers with at least a bachelor's degree now earn about $1 million more over their lifetimes than Americans who only have a high school diploma.