This article was first published in the August 2015 issue of WIRED magazine. Be the first to read WIRED's articles in print before they're posted online, and get your hands on loads of additional content by subscribing online

It's a muggy July day in the Hua Qiang district of Shenzhen. Spread across several blocks, it's reminiscent of a wet market, except instead of fish and meat, the stall-holders are hawking circuit-board components and mobile phones.

WIRED is with Roger Wang, a scrappy, bright-eyed local who specialises in sourcing electronics for his employer, engineering and manufacturing company AQS. Our quarry today: the Hongmi 1S, made by the mobile-phone startup phenomenon Xiaomi, the most popular device manufacturer in China.


Reworking the supply and demand equation, Xiaomi limits availability through online-only flash sales. Tightly controlled and lean, this model allows the manufacturer to sell phones at near cost to the fortunate few who can catch a flash sale before supplies run out. Many phones end up in the hands of touts, and our challenge is to find a couple of authentic Hongmi 1S models for the best price.

Bobbing and weaving through the crowds, Wang leads me into the Yuanwang Digital Shopping Center, a trading floor for mobile phones that's crammed with hundreds of stalls. Transactions are strictly cash-only, so serious buyers arrive with stacks of banknotes several centimetres high, and every stall has safes lining the wall. If you don't need a purse for your cash, you're a tourist; if you're a tourist, you'll be duped. So WIRED is carrying a shoulder bag, even though our stack of cash is only a centimetre thick.

Read next Which Samsung Galaxy phone should you buy? Which Samsung Galaxy phone should you buy?

Wang leads WIRED to a run-down stall near the back of the market, where we're presented with two shrink-wrapped kraft boxes. The stall's owner is asking 800RMB (£90) each, which is £11.50 over the flash-sale price. Suspicious of fakes, we reveal serial numbers hidden by a scratch-off code and check them against Xiaomi's website. They're authentic -- at least, the boxes are. We power them up and check the kernel and baseband version numbers. As we run tests, other buyers come in and buy phones. Bricks of cash change hands, money-counting machines churn, receipts are drawn. Satisfied the phones are legit, WIRED slaps its money on the table and melts into the din of the market.

Despite its low price, the Hongmi 1S is a solid piece of hardware with great battery life. It's powered by a 1.6GHz quad-core Snapdragon 400 -- a reasonable alternative, at a fraction of the price, to the Samsung S3's 1.4 GHz quad-core Exynos 4412. The milling crowds of customers who throng the market seem to agree -- more than 60 million Xiaomi smartphones were sold in 2014. How is it that Xiaomi, which was only founded in 2010, could grow into a credible threat to Samsung and Apple in just five short years?


Part of the answer lies in the silicon itself. There are hundreds of millions of transistors inside a processor. The quality of a transistor is dominated by a single metric known as "gate length". Simply put, smaller is better, and for the past 50 years, gate lengths have been dropping by about 16 per cent each year. Gordon Moore, co-founder of Intel, predicted this trend in 1965 in a famous paper, "Cramming More ­Components on to Integrated Circuits", in the process coining the term "Moore's law".

If only physics were so simple that we could reduce anything to a single curve shooting off to infinity. In the autumn of 2001, Paul Otellini, then EVP and GM of the Intel ­Architecture Group, proclaimed that the Pentium 4 architecture would hit speeds of 10GHz over its lifetime. It's now 2015, and the chances are that you're using a machine running at a speed much lower than 5GHz. In fact, Intel did an abrupt about-face in 2004, when it reorganised around the Core line, focusing on multiple central processing units (CPUs) over more MHz. The premise behind the Pentium 4 internal architecture was so flawed that it was taken out back and shot; the architecture of today's Core line is actually a descendent of the Pentium III.

Shotopop

Read next The best new features in Android 11 The best new features in Android 11

So what happened? It turns out that the speed enhancements that came with halving gate lengths of transistors tapped out about a decade ago when niggling physics problems conspired to drive power consumption through the roof. The Pentium 4 could scale to 10GHz, but its double-pumped ALU (the arithmetic logic unit is an important part of the CPU) architecture would generate the heat of a blast furnace, and nobody wants that anywhere near their lap. The clear, bright line of Moore's law was starting to become fuzzy as various real-world constraints began to set in.


The principal constraint limiting performance is the amount of battery life we desire, or, if we're considering the desktop, how much cooling we're able to throw at the CPU. Looking at the landscape in another light, the normalisation of MHz across platforms means that even incredibly youthful upstarts, such as Xiaomi in the ultra-competitive smartphone market, can launch homespun products that boast a performance that's easily comparable to that of more established incumbents.

Unlike the MHz race, the rule of Moore's law (to bring you twice the number of transistors every two years) has so far held strong. SSDs (solid-state disks, a data-storage device) now pack more than a terabyte; high-end desktops sport a dozen CPU cores; and graphics processing units (GPUs) tout thousands of cores. This ability to bring you twice the amount of goodness for the same cost is known as cost scaling.

Moore's law -- and the cost-scaling benefits associated with it -- has been so reliable because the underlying principle is so simple. Any student who has tweaked font sizes to fit an essay within a page limit has discovered the basis of Moore's law. Open a text-only document, and reduce the font size by 50 per cent. You've taken the same amount of information and crammed it into half as many pages. Congratulations, you've reduced the cost to print your document by half! As printers spit out pages at a fixed rate, you've doubled the rate of information flow out of the printer. You've now done both cost and performance scaling, Moore's-law style.

Gate-length scaling for transistors pretty much works exactly like the printer example: the industry has been reducing the "font size" of circuits printed on a silicon wafer year after year. The problem is, we're now approaching the point where transistors are just a few atoms wide. The industry is now facing the same problem you'd have shrinking fonts on your screen: once text is just a few pixels tall, reducing the font any further makes the text illegible. Proposed alternatives, such as 3D stacking and alternative material systems, may provide a one-time extension to Moore's law, but none of the proposals feature the clockwork elegance of gate-length scaling; no proposal charts a similar path for several more orders of magnitude cost and performance improvements. The next step is quantum computers.

Read next Why your phone can’t work out how to take a photo of the apocalypse Why your phone can’t work out how to take a photo of the apocalypse

The cover of the book that WIRED bought for £2.70 in the Hua Qiang electronics market Shotopop

Unfortunately, these are highly specialised and will probably require cryogenic cooling for the foreseeable future. In other words, don't expect one in your pocket in the next decade or so.

Cost scaling means Moore's law is like the LIBOR interbank rate, but for the computer industry. Shrinking gate lengths have meant 30 per cent more transistors per year for the same-sized fleck of silicon (transistors are laid out in a two-dimensional array, so gate-length scaling improves density in two ­dimensions). It's as if the entire computer industry is backed by a government bond that appreciates at a rate of 30 per cent every year. Compound interest is a powerful force: a deflection of a few per cent in the interest rate can push an entire economy into or out of a recession. Similarly, even a few per cent reduction in the rate of Moore's law should have an incredible impact that will ripple throughout the computer industry.

Despite the billions of dollars funnelled into next-generation factories, we can see evidence today that cost scaling is reaching its limits. GPUs: they are a bellwether for cost scaling. They're built using thousands of processing units, so there's a direct correlation between performance, cost and how many transistors you can cram into a given piece of silicon.

Back in 2011, when the desktop gaming community was scrambling to upgrade their GPUs to unlock the stunning graphics of the blockbuster game Skyrim, trouble was erupting in Hawaii at the ­International Trade Partner Conference. In a keynote talk, John Chen, vice president of technology at NVIDIA, lambasted its long-time silicon-manufacturing partner, Taiwan Semiconductor Manufacturing Company (TSMC). NVIDIA's analysis of TSMC's next-­generation 20nm and 14nm processors concluded they were worthless: the cost of producing chips had risen faster than the rate at which transistors were shrinking. As a result, those gamers lucky enough to buy a 28nm GPU in 2012 will find that, three years on, their best option is still a 28nm GPU. The Moore's-law bus is a year late, and both NVIDIA and Advanced Misco Devices (AMD) are still waiting in the rain for it to arrive. Although high-value products such as the iPhone 6 and the Samsung Galaxy S6 are shipping today using 20nm and 14nm gate lengths respectively, it seems that a range of products will take a bit longer than usual to enjoy the cost-scaling benefits of Moore's law.

Read next The iPhone 16 could be powered by nuclear waste diamond batteries The iPhone 16 could be powered by nuclear waste diamond batteries

A copy of the troubleshooting guide to the iPhone 6 motherboard. Components and connectors are labelled with their function, as well as the symptoms if any given component or connection is faulty Shotopop

Back at the Hua Qiang electronics market, WIRED continues its quest to measure the pulse of the electronics industry, checking into a favourite district -- the Longsheng Telecommunications Market. It's a building that spans an entire block, featuring three floors chocked with vendors hawking mobile phones and phone parts, and stalls offering repair services. Visiting this market is like digging through the electronics ­industry's trash to learn about its private life. What's selling, what needs fixing, what's being retired, what's getting hacked and what's getting copied -- it all happens here.

Brutally efficient and tightly coupled to global supply chains, the Shanzhai (imitations or "improved" versions of brand-name electronics -- see WIRED 01.11) traders waste no time on has-been, overhyped or vapourware products. WIRED pays extra attention to the stalls selling tools of the trade; they are often a goldmine for insider information. We eventually find a tool stall, jammed between a battery hawker brazenly attaching authenticity holograms to otherwise fake batteries, and a lady, with a toddler sprawled in her lap, selling vanity bezels for iPhones.

The tool stall is run by a Ms Zou. Shy and diminutive, she speaks softly as WIRED makes enquiries. Her Mandarin is thick with the local Cantonese accent. Sifting through her wares, our eyes alight upon an inconspicuous-looking pile of books buried underneath a pile of solder stencils. Jackpot! It's a mix of books explaining how mobile phones work and how to repair them, and schematics for the iPhone 6, iPhone 5 and a couple of late-model Samsung smartphones. WIRED buys the iPhone 6 schematic book (above) for 25 RMB (£2.70).

In the privacy of a hotel room, WIRED peels open the schematics and feasts its eyes on the naughty bits of the iPhone 6. It's like getting a master class on circuit design -- WIRED takes notes on the backlight driver it uses, and checks out the measures deployed to mitigate real-world problems such as static electricity and unintentional radio emissions. This writer thinks back to his days at MIT, learning electrical engineering from textbooks: lots of theory, but little practical knowledge. Nowhere in this formal education were these ­commercially important circuit-design details taught, in part because a professor could not very well include iPhone schematics on the required reading list. Yet for £2.70, engineers in China can get a leg up on the best and brightest university-educated kids by studying these designs. Even if it takes a couple of years and several iterations for a self-taught engineer to reproduce, the resulting product isn't terribly out of date: the iPhone has only undergone a modest increase in clock rate over the past four years, from 1GHz in the iPhone 4 to 1.4GHz in today's iPhone 6. This relative stagnation is endemic, leaving a large window of opportunity for engineers to learn from and emulate the designs of the best.

Read next Some people never let BlackBerry go. Their reward? A 2021 comeback Some people never let BlackBerry go. Their reward? A 2021 comeback

A knee-jerk reaction to this may be to come down harshly and call for stricter enforcement of IP laws. However, reverse engineering has been judged legal by numerous courts. As a result, one can draw schematics by staring at circuit boards. Unlike source code and its resulting compiled programs, there is a one-to-one correlation between schematic diagrams and circuit-board implementations.

It's also not practical to encrypt or otherwise obfuscate hardware; cost-sensitive consumer electronics need to be easy to inspect and test, which also makes it relatively easy to reverse engineer. As a result, there are established, legitimate businesses that earn their keep creating schematics from circuit boards. As the pace of Moore's law diminishes, learning through reverse engineering will become increasingly effective, as me-too products will have a larger market window to amortise reverse-engineering efforts before the next new thing comes along.

A schematic of the power distribution network within the iPhone 6. It maps the myriad of voltages piped around the motherboard, feeding various subsystems within the device Shotopop

How much larger is this market window? Even a modest deceleration of Moore's law can have a dramatic effect: a five per cent reduction in the pace of gate-length shrinkage -- from 16 percent to 11 per cent per year -- increases the available time to develop products within a technology generation by 50 per cent, from two years up to three.

This additional development time is a boon to time- and resource-constrained organisations, from startups in Shenzhen to university research labs. Open-source hardware in particular stands to benefit from a gradual slowing of Moore's law. Such projects can take years to get off the ground; stacked against Moore's law, a multi-year development cycle would yield a product that's obsolete the day it shipped.

Read next The best new gear from IFA 2020 (oh, and a few other places) The best new gear from IFA 2020 (oh, and a few other places)

Times have changed. Take me and my business partner Sean "xobs" Cross, for example. We're building laptops in a home office. This isn't your Silicon Valley startup: cardboard and old yoga mats line the floor; the 3D printer doubles as a towel hanger. However, over three years we managed to design, build and ship an open-source hardware laptop called Novena.

Three years to ship a computer ought to be ruinous. If Moore's law were holding, we'd expect the Raspberry Pi 2 to clock in at over 2GHz, as extrapolated from Raspberry Pi's debut three years ago at 700 MHz. This would make our 1.2GHz quad-core Novena laptop seem sorely out of date. Happily for us, that's not the case. Although the Raspberry Pi 2 has four cores, they're only clocking at 900MHz. There's a reason the numbers haven't changed much: the Pi CPU, the Pi 2 CPU and Novena's CPU are all made using 40nm technology. Like NVIDIA, for three years our CPU vendors have elected to stay off the Moore's law-bus, relying instead upon circuit-design and ­architectural improvements to bring more modest gains.

This is possibly the beginning of a larger trend. Instead of running in fear of ­obsolescence, open-source hardware developers now have time to build communities around platforms; we can learn from each other, share blueprints and iterate prototypes before committing to a final design. The extra time also allows hardware product ­development to be leaner -- one doesn't have to burn money to meet a tight schedule. A team of two can now take three years, working mostly in their spare time, to build a laptop from scratch as a hobby. This is a great time to be developing hardware products, particularly open-source ones.


This trend extends from the system level all the way down to the silicon level. The lowRISC project out of the computer laboratory at the University of Cambridge aims to build an open-source CPU using the RISC V instruction set. "We feel like we are pushing on an open door," says Robert Mullins, a senior lecturer at the University of Cambridge. "Innovative chip designs will be required to enable many of the new exciting applications on the horizon... and only an open-source approach will provide the necessary freedom and scalability." According to Alex Bradbury, a research assistant working with Mullins, the project is about a year from fabrication in either a 40nm or a 28nm process -- the same geometries used by Novena, the Raspberry Pi and today's flagship GPUs. According to Bradbury, "there are arguments that 28nm may be the long-term 'value' node, as it seems the cost per transistor rises beyond that." If he's right, it means lowRISC will have an excellent chance of achieving commercially competitive performance despite being a university research project.

Although silicon foundries are still cramming more transistors on to a single chip, they are taking much longer to do so, and at a higher cost than ever. As Moore's law yields, small communities of innovators around the world are given space to gather their strength and build products that may some day compete with mainstream providers. Today's phenomenon of Shanzhai and open hardware is likely to be just the first shot across the bow of traditional corporate juggernauts.

Andrew "bunnie" Huang directs Kosagi, a hardware design studio in Singapore, and is a co-founder of Chibitronics