Skip to contentPedro Farbo
Lesson 2 / 1625 min

How Computers Work

How Computers Work

Before coding, let's understand the machine we're going to command.

Basic Components

Processor (CPU)

The computer's "brain". Executes calculations and instructions.

Think of it as a super-fast chef: it can only do one thing at a time, but does it so quickly it seems simultaneous.

Memory (RAM)

Temporary memory. Stores what the computer is using right now.

It's like your work desk: the more space, the more things you can have open. But when you turn off the computer, everything is erased.

Storage (HD/SSD)

Permanent memory. Stores your files, programs, photos.

It's like a filing cabinet: slower to access, but nothing is lost when you turn off.

Simple Example

When you open a browser:

  1. Storage → The browser is saved here
  2. RAM → The browser loads into memory
  3. CPU → Executes browser instructions

Binary: The Computer's Language

Computers only understand binary: 0 and 1.

Hello → 01001000 01100101 01101100 01101100 01101111

Each 0 or 1 is a bit. 8 bits = 1 byte.

UnitEquivalent
1 KB1,024 bytes
1 MB1,024 KB
1 GB1,024 MB
1 TB1,024 GB

Where Does Code Fit In?

When you write code in JavaScript:

javascript
alert("Hello!");

It goes through this process:

Your code (JS) → Interpreter → Machine code (0s and 1s) → CPU executes

That's why we have programming languages: they're more readable for humans and are translated to binary.

Input, Processing and Output

Every program follows this cycle:

  1. Input - Receives data (keyboard, mouse, file)
  2. Processing - Does something with this data
  3. Output - Shows the result (screen, file, sound)

Example: calculator

  • Input: numbers 2 and 3
  • Processing: 2 + 3
  • Output: shows 5

Operating System

The operating system (Windows, macOS, Linux) is the "manager" that:

  • Controls hardware
  • Allows programs to run
  • Manages files
  • Provides security

Think of it as the building's superintendent: it doesn't live in the apartments (programs), but keeps everything running.

Summary

  • CPU: processes instructions
  • RAM: temporary memory (fast)
  • Storage: permanent memory
  • Computers only understand binary (0 and 1)
  • Programming languages are translated to machine code
  • Everything follows: Input → Processing → Output

In the next lesson, we'll explore tech careers! 🚀

Enjoyed the content? Your contribution helps keep everything online and free!

PIX:0737160d-e98f-4a65-8392-5dba70e7ff3e