Image caption Electronics giant Sharp has been losing money fast

Japan's electronic giants once ruled the world. Sony, Panasonic, Sharp were household names. Now those same companies are in deep trouble, losing billions of dollars a year. How have the mighty Japanese companies fallen so low? The BBC's Rupert Wingfield-Hayes in Tokyo looks at what went wrong.

If you want to get an idea of what's gone wrong with Japan's electronics industry go for a ride on the Tokyo metro.

The Tokyo metro (or a lot of it) now has 3G mobile reception. But you're not allowed to talk on your mobile phone on public transport in Japan, so everyone in my carriage was busily texting away on their 3G devices.

And what particular device were they using? A quick survey of the carriage I was in found about 80% were holding an Apple iPhone.

That's admittedly not a scientific result - but the evidence is pretty stark. Where once everyone would have been listening to a Sony Walkman, today it is Apple and Samsung that dominate, even here on Sony's home ground.

The evidence can also been seen in their financial results. Japan's electronic giants are bleeding red ink.

Sony may make a small profit this year, its first since 2008. Panasonic (formerly Matsushita) is expected to post a $9bn (£6bn) loss this year. Sharp, which is much smaller, is losing money so fast it will not survive another year without a major infusion of cash.

So what went wrong?

Digital challenge

According to Tokyo-based economist Gerhard Fasol, the Japanese giants were overtaken by the digital revolution.

The Japanese giants, he says, actually built their empires on making complex electrical machines - colour televisions, radios, cassette players, refrigerators, washing machines.

Japan has to become a brain country Gerhard Fasol, Economist

Yes, they contained electronic components, but they were basically mechanical devices.

But then came the digital revolution, and the world changed.

"The Sony Walkman is a classic example," Gerhard Fasol says. "It has no software in it. It is purely mechanical. Today you need to have software business models that are completely different."

The digital revolution not only changed the way electronic devices work, they changed the way they are made.

The whole manufacturing model shifted as companies moved production to low-cost countries. That has put huge downward pressure on profit margins for Japanese manufacturers.

"Look at Apple," Mr Fasol says. "They make iPods and iPhones."

"Apple makes at least 50% profit margins on those. People say iPhones are made in China, but maybe only 3% of the value of an iPhone stays in China."

"So it's hard to become rich today on the scale of a Panasonic just by manufacturing - you have to do a lot more."

'Un-Japanese'

Image caption Mr Nakanishi decided to drop many of Hitachi's consumer electronics divisions

Unfortunately neither Panasonic nor Sharp responded to our repeated requests for interviews, so instead I went to see the boss of another Japanese manufacturing giant.

Hiroaki Nakanishi is the 66-year-old English-speaking president of Hitachi Corporation.

When he took over the reins at the 100-year-old engineering giant in 2010 it too was bleeding red ink. Mr Nakanishi immediately decided to do something very un-Japanese. He closed or sold loss-making divisions, most of them in consumer electronics.

"Digital technology changed everything," he says.

"In the television industry it means that just one chip is now needed to produce a large and high quality TV picture. So now everybody can do it."

"That means the new players from Korea and China, they now have the advantage."

Hitachi had built its reputation on having the best technology. But now competition has switched to who has the best sales and marketing strategy, and the biggest advertising budgets. Mr Nakanishi says the Japanese companies just couldn't keep up.

"The structure of the industry had completely changed," he says. "We could not adjust to such an environment. So that is why I gave up those segments."

'Brain country'

Mr Nakanishi decided to return Hitachi to its core business: heavy engineering. Gas turbines, steam turbines, nuclear power plants, high-speed trains, these are the areas he believes Hitachi can still be a world beater, especially in the developing world.

"In developing countries they don't have specific planning and construction know-how [for big infrastructure projects], but we have," he says.

"It is not simply a case of selling machinery, but also the engineering, planning, even sometimes the financing of a project. That total process, that is our most important advantage."

Mr Nakanishi's strategy is working. Hitachi is back in profit. Hitachi trains are the front-runner in the competition to replace all of the UK's fleet of inter-city high-speed trains.

But it will not be as easy for the others.

Image caption Hitachi has switched its focus to heavy engineering

Sony is the strongest of the three. But even Sony makes far more money today out of selling life insurance than it does out of making electronics. Panasonic and Sharp have less to fall back on.

Gerhard Fasol says that once again, just as they did back in the 1950s and 60s, the Japanese companies need to learn from America.

"It's no coincidence that many of the most successful companies today are in Silicon Valley," Mr Fasol says.

"Companies like Cisco or Oracle are not affected by the Korean competition. Japan has to become a brain country. It's a country like Switzerland or England."

"You have very high education and very clever people so you have to use that. Sometimes that value can be captured through manufacturing, but in other cases through software. And software has been neglected in Japan."