Enter the maze

Raspberry Pi: How do you make a $25 computer?

The Raspberry Pi, the brainchild of University of Cambridge researchers, is a new cheap computer intended to help school kids get programming. It's all the rage at the moment. In fact, when it was released, the demand was so great that the Raspberry Pi website crashed under the numbers of people trying to get their hands on one. It's really just a cheap but quite powerful computer. But how do you create a powerful computer that can be sold for less than $25?

It's Fab

The Raspberry Pi is essentially made up of a computer processor with high performance video and graphics, a reasonable amount of memory, and sockets to connect camera memory cards, keyboard, mouse and the like. The most expensive component is the chip with the processor on. Chips are cheap to create but only once the fabrication plant is set up. It's very much like printing a book. If you wanted a publisher to only print a single copy of your new novel, that copy would cost thousands of pounds. Someone has to spend the time preparing it and setting up the press for printing it. That is expensive. Once the press is ready to print though it then doesn't cost much more than the ink and the paper to print more at the same time. If you think it will be a best seller and print tens of thousands, that initial cost is spread across all those copies so each one then costs pence. It's the same for computer chips. The big cost is in setting up the fabrication line. That costs tens of millions of dollars for a new chip. Once set up making each chip is a few dollars. It's therefore only economical if you are going to fabricate (and manage to sell) millions.

So a $25 computer is definitely possible if you know you will sell millions, but for Raspberry Pi the initial aims were more modest. Fabricating millions of chips and then not selling them would just leave you bankrupt!

So how did the Raspberry Pi Foundation do it? Well it turned out similar chips already existed for HDTV set-top boxes - they are just computers in disguise. A semiconductor company called Broadcom had chips that were almost exactly what was needed and Broadcom were really keen to help given the Raspberry Pi foundation is a charity with the very laudable aim of getting more people programming. There was one problem though. The idea was that Raspberry Pis would use the Linux operating system. To do that you would need lots more computer memory than you could make available for $25. The existing chip wouldn't quite cut it.

Forget it

Most computers get round this problem of lack of memory using 'virtual memory' hardware. What is virtual memory? It's just a clever way to give the appearance of having more memory than you really do. Suppose you are going shopping. You intend to buy clothes from your favorite boutique, food from the supermarket and some things for the house from a department store. Trouble is you know your memory just isn't good enough to remember so many things. You are bound to forget something. No problem you just write a list for each shop. When in the boutique you just read off the things you wanted there. It's a small list so once looked at you can remember it all. When you go to the department store you can forget the boutique list completely and just read off the new department store set of items, then the same again in the supermarket. Now suppose you didn't get everything you wanted in the boutique. After the supermarket you go to another clothes shop and check the boutique list again to see what hasn't been crossed off. Off you go again, mind only on clothes. No need to worry about the other lists.

The Raspberry Pi Model B

Virtual memory works in the same way. It is used in situations where the computer will need to multitask. It can actually only do one thing at a time so each separate task takes turns just as you couldn't go in all the shops simultaneously so visited them on after the other. Rather than storing all the data needed for each task in memory at once, they are all stored out on an external disk (which acts like the piece of paper storing the lists). Each time a task is started or continued, its data is swapped back in to memory (just as you re-learnt the appropriate shopping list at each new shop). When it's another task's turn, all its current data is stored back out to disk, ready for the new task to take over.

There for you

Virtual memory hardware makes all this happen invisibly. It manages all the swapping so that the actual computer is completely unaware that it doesn't really just have one big memory where everything is. The hardware makes sure that task's data is just there in its memory when it needs it. That's a bit like having your own personal assistant who looks after the lists and as you wander round the shops just tells you what you want next as you get there.

So back to the Raspberry Pi. What was needed was for Broadcom HDTV chips to include virtual memory hardware...and possibly because Broadcom were very supportive their next chip design did! That meant the Raspberry Pi Foundation didn't need a fabrication line to be set up just for them. They could buy what were now off-the shelf chips really cheaply.

So the Raspberry Pi is up and running. A lucky few have them already and it won't be long before there are plenty fabricated. Now what is needed is for the people who do get their hands on them to start programming.