2. 2006 2009 2011 2012 20142013
What is Raspberry Pi?
Eben Upton, Rob Mullins, Jack Lang and Alan Mycroft
University of Cambridgeâs Computer Laboratory
Concern: with studentâs shift from creators (1980s) to end-users (2000s)
Idea: create low-cost computer that most families could afford
Intention: promote the teaching of programming to children
Software
- Python, C, C++, Java, Ruby, (any language which will compile for ARMv6)
- Scratch, an MIT developed program that helps children program their own interactive stories, games,
and animations
Hardware
- GPIO pins, allow creators to create anything
- camera module
idea
3. 2006 2009 2011 2012 20142013
The User/Computer Paradigm
Operating System
Usability
Hardware
Complexity &
Cost
Technical and
Programming
Skills
RPi Foundation
4. 2006 2009 2011 2012 20142013
Raspberry Pi Schematics
SoC: Broadcom BCM2835
(700MHz ARMv6 CPU, VideoCore IV GPU)
RAM: 256/512 MB
Video: HDMI, RCA
USB: 2.0 x2
Audio: 3.5mm
Storage: SD card
Misc.: 8x GPIO, Camera Port
Power: 5v microUSB
OS: Raspbian, RISC, Raspbmc, many Linux distros
100k sold day 1
5. 2006 2009 2011 2012 20142013
ARM Architecture
â Raspberry Pi uses ARM architecture developed by ARM Holdings
â ARM architecture is also commonly used in smartphones and embedded systems
â ARM architecture is RISC-based and supports 32-bit addressing and 32-bit arithmetic. (Some upgrades can
support 64-bit and some can provide hardware for executing Java bytecode.)
â Early implementations had a three-stage pipeline, while more advanced versions have up to 13 stages. The
version in Raspberry Pi has 8 stages.
20k shipped
6. 2006 2009 2011 2012 20142013
VideoCore IV
â In addition to the CPU, the Raspberry Pi has the VideoCore IV GPU (or Graphical Processing Unit).
â The VideoCore IV is a multimedia processor specially designed for low power use, such as in mobile devices.
â The driver code for the VideoCore IV was recently made available for public use, making the Raspberry Pi
chip the first ARM-based multimedia SoC with fully open-source vendor-provided drivers.
â This is especially important as Raspberry Pi is a tool for learning and the more open-source code, the
more users can learn.
â VideoCore has a quad processor with architecture somewhat different from what weâve seen in class,
including:
â 64-bit encoding
â Two sets of registers
â Independent âADDâ and âMULâ ALUs
â No branch prediction (for the sake of simplicity)
8. 2006 2009 2011 2012 20142013
63 62 61 60 59 58 57 56 55 54 53 52 51 50 4 9 4 8 4 7 4 6 4 5 4 4 4 3 4 2 4 1 4 0 39 38 37 36 35 34 33 32
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
p m sf ws
1 1 0 1 p m sf ws
1 1 1 1 re l re g ws
1 1 1 0 0 0 0 p m sf ws
1 1 1 0 0 0 1 p m sf ws
1 1 1 0 0 1 1 p m sf ws
1 1 1 0 1 0 0 p m sf ws
sa
m ul_a m ul_b
d on't ca re
alu sm all
im m
unp a ck p a ck cond _a d d cond _m ul wa d d r_a d d wa d d r_m ul
op _m ul op _a d d ra d d r_a sm a ll_im m e d a d d _a a d d _b
cond _a d d cond _m ul
cond _a d d cond _m ul
Pe r-e le m e nt MS (sig n) b it Pe r-e le m e nt LS b it
m ul_a m ul_b
wa d d r_m ul
S e m a -
pho re
p a ck wa d d r_a d d wa d d r_m ul
cond _a d d cond _m ul
Pe r-e le m e nt MS b it Pe r-e le m e nt LS b it
cond _a d d cond _m ul
se m a p hore
lo a d im m
pe r-e lm t
unsig ne d
p a ck wa d d r_a d d
wa d d r_m ul
im m e d ia te
lo a d im m
pe r-e lm t
sig ne d
p a ck wa d d r_a d d wa d d r_m ul
bra nc h
cond _b r ra d d r_a wa d d r_a d d
wa d d r_m ul
lo a d
im m 32
p a ck wa d d r_a d d wa d d r_m ul
im m e d ia te
sig unp a ck cond _m ulcond _a d d
op _m ul op _a d d ra d d r_a
a lu
p a ck wa d d r_a d d
ra d d r_b a d d _a a d d _b
Instructions
9. 2006 2009 2011 2012 20142013
Branch Instruction
Field Bits Description
cond_br 4 Branch condition
rel 1 Branch relative. If set, branch target is relative to PC+4 (add PC+4 to target)
reg 1 Add value of raddr_a (value read from SIMD element 0) to branch target
raddr_a 5 Read address for register file
waddr_add 6 Write address for ADD ALU (same as ALU instruction)
waddr_mul 6 Write address for MUL ALU (same as ALU instruction)
ws 1 Write swap bit (same as ALU instruction)
immediate 32 Signed 32-bit immediate (always added to branch target - set to 0 if not used)
1 1 1 1 re l re g ws
63 62 61 60 59 58 57 56 55 54 53 52 51 50 4 9 4 8 4 7 4 6 4 5 4 4 4 3 4 2 4 1 4 0 39 38 37 36 35 34 33 32
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
bra nc h
cond _b r ra d d r_a wa d d r_a d d wa d d r_m ul
im m e d ia te
1M sold
11. 2006 2009 2011 2012 20142013
0
5
10
15
20
25
MHz/$ MB/$
MHz and MB per Dollar
Mac Mini RPi
Mac Mini
CPU: 2.6 GHz
RAM: 4GB
Price: $600
RPi (Model B)
CPU: 700 MHz
RAM: 512 MB
Price: $35
MHz/$: 4.3
MB/$: 6.7
MHz/$: 20.0
MB/$: 14.6
RPi vs Mac Mini
40k/day MFD
12. 2006 2009 2011 2012 20142013
â Won regionals at the University of Manchester
â Won UK's National Robot Design prize
â "You have a headset on your head, and it reads your
brainwaves into the computer. We link the computer to
the robot, and when you think a certain thought, we can
train our brains to move the robots," twelve-year-old
Claire Revans.
â EEG headsets are linked to the Lego robots using Python
Robots, Brains and Pi?
500k MFD in UK
13. 2006 2009 2011 2012 20142013
â Home automation systems (for controlling
lights, thermostat, etc.) can be costly and
difficult to customize.
â Instead, you can use a Raspberry Pi,
Arduino, and a few other tools to achieve
the same result.
Home Automation System
1M MFD in UK
14. 2006 2009 2011 2012 20142013
â In March, a Seattle news station reported
of a bitcoin mine in eastern Washington
running an estimated 1,500 Raspberry
Pis (in conjunction with other hardware)
to mine bitcoins.
â The mine was reported to be generating
$8 million in bitcoins per month.
Bitcoin Mining
(Not Recommended)
1.75M sold
15. 2006 2009 2011 2012 20142013
Raspberry Pi Foundation (est. 2009)
â "promote the study of computer science ..., especially at school level, and to put the fun back into learning
computing.â
â September 2014 - UK school system is bringing coding into the curriculum
Manchester CoderDojo (est. 2009)
â 8 coders first month; all boys
â April 2014 - over 150 coders, good mix of boys
and girls
â "Coding gets more attention now because it's
cooler"
Progress?
2M sold
16. 2006 2009 2011 2012 20142013
As commercial and computers get more and more powerful, small-scale pieces
like Raspberry Pi will likely stay in the realm of hobbyists and students.
BUTâŠ
As more students get hands-on learning opportunities and as more tinkerers get a
chance to test out their new ideas, we will likely see greater innovation arising.
New products, services, and ideas will not just be coming from big companies
with Research & Development teams, but from programmers working out of
their garages like they did in the 1970s and 80s.
The Future
2.5M sold
17. 2006 2009 2011 2012 20142013
â Hennessy, John L., and David A. Patterson. Computer Organization and Design: The Hardware. San Francisco, CA:
Kaufmann, 2012. Print.
â "Raspberry Pi." 2009. 11 May. 2014 <http://www.raspberrypi.org/>
â "Raspberry Pi - Wikipedia, the free encyclopedia." 2011. 11 May. 2014 <http://en.wikipedia.org/wiki/Raspberry_Pi>
â Hermitage, Herman H. "Hermanhermitage/videocoreiv-qpu." GitHub. Web. 11 May 2014.
<https://github.com/hermanhermitage/videocoreiv-qpu>.
â "BBC News - Teenage computer coders on the rise - BBC.com." 2014. 11 May. 2014
<http://www.bbc.com/news/25844295>
â David Meyer. "Robots meet Raspberry Pi: How kids are using their brains ..." 2012. 11 May. 2014
<http://www.zdnet.com/robots-meet-raspberry-pi-how-kids-are-using-their-brains-3040155394/>
â "VideoCoreÂź IV 3D Architecture Reference Guide - Broadcom." 2014. 11 May. 2014
<http://www.broadcom.com/docs/support/videocore/VideoCoreIV-AG100-R.pdf>
â "BCM2835-ARM-Peripherals.pdf - Raspberry Pi." 2012. 11 May. 2014 <http://www.raspberrypi.org/wp-
content/uploads/2012/02/BCM2835-ARM-Peripherals.pdf>
â "ARM1176JZF-S Technical Reference Manual." 2010. 11 May. 2014
<http://infocenter.arm.com/help/topic/com.arm.doc.ddi0301h/DDI0301H_arm1176jzfs_r0p7_trm.pdf>
â "Raspberry Pi Foundation - Wikipedia, the free encyclopedia." 2011. 12 May. 2014
<http://en.wikipedia.org/wiki/Raspberry_Pi_Foundation>
References
2.5M sold
To reiterate, weâve seen a great deal of progress as consumers. Our operating systems have become far easier to use âout of the boxâ and require no technical training. In addition, our hardware has become increasingly powerful, albeit complicated. But these have come with a cost. Enthusiastic potential computer scientists are: a) not being challenged by their computers. They donât need to know programming, or even how to use the command line to use their systems. They just need to know how to use a mouse or a touch screen.
And b) their computers are far too complex and, more importantly, EXPENSIVE to just tinker around with. Few students can afford to open up a machine that cost more than $500 and risk breaking it. And so with fewer avenues to train their budding skills, young programmers today are not getting the same early experiences as those of just 20 years ago.
Hereâs a look at the VideoCore IV datapath, including the two registers and the âaddâ and âmultiplyâ ALUâs.
Here are the instruction encodings for various QPU instructions, including ALU, ALU with small immediate, branch, three different loads, and a semaphore instruction.
As you can see, with 64 bits instead of 32, there is room for a lot of additional information. SOme of these are rather complex, so weâre only going to look at the branch instruction.
Here we have the branch instruction encoding, which includes a lot more information than the MIPS branch-equals instruction weâve seen.
First, itâs worth repeating that the VideoCore IV architecture does not implement branch prediction. This is done for the sake of simplicity and means that instructions never need to be canceled because the branch condition was found to be false. It does, however, require that three âdelay slotâ instructions (like stalls or waits) are executed following any branch instruction. Itâs a trade off.
On to the instruction:
The first part are the signaling bits. Four ones is the signal for branch and the other four signal bits arenât used. Then there is a four-bit branch condition, which corresponds to a series of different condition codes. Then there is the rel flag, which if set indicates that the branch target is relative to PC+4. The reg flag determines if branch target also includes the value in register file A (raddr_a). If both flags are not set, then the branch target is computed using just the 32 bit immediate field.
Next are the write addresses for the dedicated ADD ALU and MUL ALU and the ws flag. This flag is in most instructions and determines which register (A or B), the instruction writes too.
It can be hard to compare the Raspberry Pi to more commonly purchased machines, because unlike a laptop, or tablet it doesnât come with a keyboard or monitor, and itâs so much smaller than any desktop system. So I chose the Mac Mini as a point of comparison.
As you can see , the Mac Mini cpu is nearly four times faster, at 2.6 GHz to the Raspberry Piâs 700 MHz. And the Mac Mini has eight times as much RAM, 4GB for the most basic model, compared to 512 for the Pi Model B (which is already twice as much as the Model A).
So it would seem that the RPi is the clear loser here.
But if you look at those specs in comparison to price, they tell a VERY different story. Looking at MB of RAM per dollar, the ratio for the Mac Mini is 6.7 MB per dollar and for the RPi itâs 14.6. Even more striking is the CPU, which for Mac Mini is 4.3 MHz per dollar and for RPi itâs 20 MHz per dollar. Nearly FIVE TIMES BETTER.
Thereâs a growing trend of people wanting to control everything in their lives from their smartphone or computer, from paying for groceries to household tasks. With a RPi,