A computer stores everything as binary numbers, uses a CPU to execute instructions, keeps working data in fast memory (RAM) and long-term data in storage, relies on an operating system to run programs and manage resources, and talks to other computers over networks using protocols such as TCP/IP and HTTP. Knowing these foundations makes you a better programmer and explains why AI training uses GPUs.

Why should programmers understand the machine?

Code runs on real hardware with real limits. Understanding the basics explains everyday puzzles: why a program slows down when data no longer fits in memory, why reading from disk is slower than reading from RAM, why 0.1 + 0.2 isn't exactly 0.3, why a web request sometimes times out, and why training a neural network on a GPU is dramatically faster than on a CPU. It turns mysterious bugs into understandable ones.

What is binary, and why do computers use it?

Computer hardware is built from switches that are either on or off, so information is represented with two digits: 1 and 0 (bits). Eight bits make a byte, which can represent 256 different values. Numbers, text (through encodings such as UTF-8, which covers Indian scripts), images (as grids of colour values), sound and video are all ultimately sequences of bytes. Decimal fractions often have no exact binary form, which is why floating-point arithmetic has small rounding errors.

How many distinct values n bits can represent
8 bits (1 byte)256
16 bits65,536
32 bits≈4.3 billion

Arithmetic: 2ⁿ. Each extra bit doubles the range, which is why 32-bit and 64-bit sizes matter for numbers and memory addresses.

What does the CPU do?

The central processing unit fetches instructions from memory, decodes them and executes them: arithmetic, comparisons, moving data, jumping to other instructions. It does this billions of times per second (clock speeds are measured in gigahertz). Modern CPUs have several cores that run instructions in parallel, plus small, very fast caches that keep recently used data close. Your Python or JavaScript code is translated, by an interpreter or compiler, into the machine instructions the CPU actually runs.

How do memory and storage differ?

LevelSpeedSize (typical laptop)Keeps data without power?
CPU registers and cacheFastestKilobytes to megabytesNo
RAM (memory)Very fast8–32 GBNo
SSDFastHundreds of GB to TBYes
Hard diskSlowerTerabytesYes
Network / cloud storageSlowest (depends on connection)Practically unlimitedYes

Programs load data from storage into RAM to work on it. When data exceeds RAM, the operating system swaps to disk and everything slows dramatically, which is why a Pandas analysis can crawl on a large file and why loading only the needed columns helps.

What does the operating system do?

The operating system (Windows, macOS, Linux, Android) manages hardware and runs programs. It schedules which processes get CPU time, gives each its own memory, manages files and folders, controls devices, and enforces permissions. A process can have several threads sharing its memory. Most servers, including those running AI models and websites, run Linux, so learning the terminal and basic Linux commands pays off early.

What happens when you run a program?

  1. You type python app.py in the terminal.
  2. The OS starts a process for the Python interpreter and gives it memory.
  3. The interpreter reads your file, compiles it to bytecode, and executes it.
  4. Your program asks the OS (through system calls) to read files, open network connections or print output.
  5. When it finishes, the OS frees its memory and resources.

How does the internet work, at a high level?

Computers on the internet have IP addresses. Data is split into packets sent through routers, with TCP making delivery reliable and in order. When you visit a website: DNS translates the name into an IP address; your browser opens a TCP connection and a TLS-encrypted session (HTTPS); it sends an HTTP request; the server responds with HTML, CSS, JavaScript and data; and the browser renders the page, making further requests for images and APIs. Understanding this sequence makes web development and debugging much easier. See building a REST API for the server side.

Why are GPUs used for AI?

A CPU has a small number of powerful cores optimised for varied tasks. A GPU has thousands of simpler cores designed to perform the same operation on many numbers at once. Neural network training is dominated by matrix multiplications, the same arithmetic applied to huge grids of numbers, which GPUs execute in parallel. That's why training and running large models uses GPUs (and specialised AI accelerators), why GPU memory limits model size, and why national programmes such as the IndiaAI Mission invest in shared GPU compute. See backpropagation explained for what those calculations are.

What is the cloud, really?

Cloud computing means renting computers, storage and services in someone else's data centre and paying for what you use. Your application runs on virtual machines or containers there, which you can scale up or down. It's the same hardware concepts (CPU, memory, storage, network) offered on demand, which is why understanding the basics helps you choose and configure cloud resources sensibly.

Which foundations should you learn first?

  • Using the terminal and navigating files and folders.
  • How memory, storage and processes behave.
  • How the web works: DNS, HTTP, HTTPS, requests and responses.
  • Git for version control.
  • Basic number representation and why floats are approximate.

How do these foundations help in everyday debugging?

A program that works on your laptop but crashes on a server may be running out of memory there. An API that times out may be waiting on a slow DNS lookup or an overloaded database. A script that suddenly takes hours may have started swapping to disk. A model that won't fit on a GPU needs smaller batches or lower-precision numbers. Each of these is a foundations problem, and engineers who can reason about the machine solve them in minutes rather than days.

What is the difference between compiled and interpreted languages?

A compiler (as for C++, Go or Rust) translates your whole program into machine code before it runs, producing fast executables. An interpreter (as for Python) reads and executes the program step by step, usually via an intermediate bytecode, which makes development quicker but execution slower. Many modern systems blend the two: JavaScript engines compile hot code just in time while the program runs, and Python libraries such as NumPy and PyTorch do their heavy lifting in compiled C, C++ or CUDA code. That's why Python can be the main language of AI despite being interpreted.

How should a beginner learn these foundations?

Learn them alongside coding rather than as a separate theory course. Use the terminal daily, watch memory usage while your programs run, look at network requests in your browser's developer tools, and read what an error message says about the system. Short, practical exposure each week builds intuition quickly.

How does Program Zero start?

Program Zero begins with exactly these foundations in its first weeks (how computers and the internet work, the terminal, Git and problem solving) before programming in Python and JavaScript. That's why complete beginners can join. See the Python course, the full curriculum, and which language to learn first.