Learn · Track 2 of 4

Your Devices

A phone, a Chromebook and a game console look different, but inside they are the same kind of machine. Meet the CPU, RAM, storage and GPU, and see how they work together.

8 lessons 5 Try-it toys and steppers 1 quiz
RAM CPU GPU inside your device

Data moves between a few key parts, billions of times a second.

LESSON 1

Every device is a computer

A phone, a tablet, a Chromebook, a laptop, a desktop PC and a game console look very different. Inside, they are all the same kind of machine: a computer. They have the same parts, packed into different shapes.

Every computer does three jobs, over and over: input (it gets something from you, like a tap, a key press or a mouse click), process (it works out what to do) and output (it shows you the result on a screen or plays a sound). A game is just this loop, repeated 60 times a second.

RAM 4–12 GB · storage 64–512 GB

Phone

Small, battery powered, and the screen is also the keyboard.

RAM 4–16 GB · storage 64 GB–1 TB

Tablet

Like a big phone. Great for reading, drawing and games.

RAM 4–8 GB · storage 32–128 GB

Chromebook

A light laptop that runs mostly web apps, which is why many schools use them.

RAM 8–32 GB · storage 256 GB–1 TB

Laptop

A computer with a screen, keyboard and battery in one folding piece.

RAM 8–64 GB · storage 512 GB–2 TB+

Desktop PC

Lots of room inside, so parts can be bigger, cooler and upgraded.

RAM about 16 GB · storage about 1 TB

Game console

A computer built for games, with a strong graphics chip and a controller.

main board Storagekeeps files RAMshort-term desk CPUthe brain GPUdraws pictures Screenpixels Wi-Fi chiptalks to router Batterypower from the internet power
Data flows from storage to RAM, through the CPU and the GPU, and ends up as pixels on the screen. The Wi-Fi chip brings in new data from the internet. Real devices have more parts, but these are the ones that matter most.
LESSON 2

The CPU: the brain

The CPU (central processing unit) is the chef of the computer. It follows a recipe of very small instructions, one tiny step at a time: "get this number", "add these two", "put the answer there". A whole game is millions of steps like these.

How fast it works is its clock speed, measured in GHz. One GHz is a billion steps every second. A phone or laptop CPU runs at about 3 GHz, so it does around three billion steps per second.

Most CPUs have several cores. A core is like an extra chef in the kitchen. Four cores can work on four different things at the same time, so the computer can play music, run a game and download a file all at once.

Try it

Be the CPU

Here is a tiny program that adds 10 points to a score. Press Step to run one line at a time. Watch the two registers (tiny boxes inside the CPU) and the cell in RAM.

    Register A0
    Register B0
    RAM cell "score"5
    Steps done0

    Press Step to run line 1.

    A 3 GHz CPU does about 3,000,000,000 steps like this every second.

    LESSON 3

    RAM: the desk

    RAM (random access memory) is the computer's desk or kitchen counter. It's where everything you are using right now is kept, so the CPU can grab it instantly. RAM is very fast but short-term: when the power goes off, the desk is cleared.

    More RAM means a bigger desk, so more things can be open at once. When the desk is full, the operating system has to move some things to the storage drive, which is much slower. That's why a device with too little RAM starts to feel slow and laggy.

    Try it

    Fill up the RAM

    Pick how much RAM your device has, then open and close apps. The operating system always uses 2 GB for itself. What happens when the desk is full?

    Storage (the drive) Saved scoresPhotosHomework.docGames Storage keeps your files, even with the power off.
    LESSON 4

    Storage: the backpack

    Storage is where files live for the long term: apps, games, photos, music and saved progress. Unlike RAM, it keeps everything when the power is off. Think of it as your backpack or the pantry, while RAM is the desk.

    There are three common kinds:

    • Hard disk (HDD). Spinning metal disks with a tiny arm that reads them, like a record player. Cheap and big, but slower, and it can break if dropped. Older computers use them.
    • Solid-state drive (SSD). No moving parts, so it is much faster and tougher. Most new laptops and consoles use SSDs.
    • Flash storage. The same idea as an SSD, built into phones, tablets and Chromebooks.

    How big is a byte, a megabyte, a terabyte?

    Computers count in bits (one 0 or 1). Eight bits make a byte. Every step up the ladder is about 1,000 times bigger.

    UnitSizeWhat fits
    bitone 0 or 1one tiny switch
    byte8 bitsone letter, like "A"
    KB kilobyte1,000 bytesa short text message (about 1–2 KB)
    MB megabyte1,000 KBa photo (about 3 MB), a song (about 4 MB), a small web game (a few MB)
    GB gigabyte1,000 MBa movie (about 2 GB), a big console game (50–150 GB)
    TB terabyte1,000 GBhundreds of movies, or a big gaming PC drive
    Fun factComputers really like numbers that are powers of two, so some programs count 1,024 instead of 1,000 for each step. For everyday sizes, thinking "about 1,000" is close enough.
    On Leon GamesOur games are small on purpose. A few megabytes means they download in seconds, even on a slow connection, and they fit easily on any device.
    LESSON 5

    The GPU: the painter

    The GPU (graphics processing unit) draws the picture you see. A CPU has a few very clever cores. A GPU has thousands of small ones that all color pixels at the same time. That's perfect for graphics, where there are millions of dots to paint.

    A pixel is one tiny dot on the screen. A common 1920 × 1080 screen has about 2 million pixels. A game redraws every one of them 60 times a second, which is about 124 million pixels every second.

    Each pixel is made of three tiny lights: red, green and blue. Each light can be set from 0 (off) to 255 (full). Mixing them makes every color on the screen.

    Try it

    Mix a color

    Move the three sliders and watch the color change. The numbers below are exactly what a game sends to the GPU.

    LESSON 6

    How the parts work together

    Let's follow what happens inside your device when you tap Leon Games. Click through the steps.

    operating system (the boss) Screenshows + feels taps Speakersmake sound Storageapps and files RAMthe desk CPUruns the code GPUdraws frames Internetgame files Wi-Fi chipdownloads tap! browser app cachegame files 60 framesa second sound RAM is free againcache is kept 1 2 3 4 5 6 7
    LESSON 7

    The operating system

    The operating system (OS) is the boss software that runs everything else. When you turn a device on, the OS starts first. Its jobs:

    • Shares the CPU and RAM between all the apps, so they don't fight.
    • Manages files on the storage drive.
    • Talks to the hardware using small programs called drivers, one for each part (screen, speaker, camera, controller).
    • Asks permission before an app can use your camera, microphone or location.
    • Draws the home screen and windows you click on.
    Appsbrowser · games · music · messages Operating systemshares resources · drivers · permissions HardwareCPU · RAM · storage · GPU · speaker · screen "Please play a sound" "Speaker, beep!" "Done" "Sound played"
    A game never talks to the speaker directly. It asks the OS, and the OS uses the speaker's driver. That's what lets one game work on thousands of different devices.

    The main operating systems

    Microsoft · PCs and laptops

    Windows

    Apps come from the Microsoft Store or from the web.

    Apple · Mac computers

    macOS

    Apps come from the App Store or from the web.

    Google · Chromebooks

    ChromeOS

    Runs mostly web apps, plus apps from the Play Store.

    Google and phone makers · most phones and many tablets

    Android

    Apps come from Google Play.

    Apple · iPhone and iPad

    iOS / iPadOS

    Apps come from the App Store.

    free to use · servers, Steam Deck, Raspberry Pi

    Linux

    Runs most of the servers on the internet, including many of Cloudflare's.

    made by the console makers

    Console systems

    PlayStation, Xbox and Switch each run their own system.

    An app built for one OS usually can't run on another, because each OS has its own rules for talking to the hardware. A game for Windows needs to be rebuilt for Android, then again for iOS.

    The browser is the universal translator. It's an app that exists on every OS, and it understands the same web language everywhere. So Leon Games runs on all of them with just one version.

    Try it

    Which OS is it?

    LESSON 8

    Keep your device healthy

    A few easy habits keep a device fast and safe:

    • Install updates. They fix security holes that bad people could use, and they fix bugs. An update you keep postponing is a door left unlocked.
    • Restart now and then. Restarting clears the RAM and stops apps that got stuck.
    • Keep some storage free. A drive that is completely full makes a device slow and can stop updates.
    • Only install apps from the official store, with an adult's OK. Apps from random websites can hide viruses.
    • Check app permissions. A flashlight app doesn't need your contacts or microphone. Say no.
    • Don't let it overheat. Don't leave it in the sun, under a pillow or on a blanket while charging. Heat slows it down and wears out the battery.
    Good to knowAsk an adult before you install an update or an app. They can make sure the device is plugged in and that nothing important is lost.
    QUIZ

    Check what you learned

    6 questions about this track. Pick an answer to see if you got it right. Your answers are saved only on this device.

    Next track

    Browser Games

    How browser games are made: the browser, canvas, the game loop, physics, the Hall of Fame and the tools.

    Go to track 3 →