The foundation nobody gives you

Computer Science
Foundations

This is not a curriculum. It's a map. Understand how a computer thinks and everything else — including AI — starts to make sense.

By Badar · Veyralabs

This guide does not aim to teach you everything. It aims to show you what exists, give you the basics, and spark curiosity so you can dig deeper on your own. At the end of each section you will see how it connects to artificial intelligence.

01

Computer Logic

What is this about?

A computer only understands true (1) and false (0). All the complexity of software is logic built on top of that. If you understand boolean logic, you understand the foundation of everything.

💡

Analogy

Think of a light switch. On = 1, Off = 0. Now imagine a billion switches working together in nanoseconds. That is a processor.

The 3 operations you need to know

OperationSymbolRuleReal example
AND&&True only if BOTH are trueDo you have an ID AND a car? → you can drive
OR||True if AT LEAST ONE is trueUmbrella OR hood? → you stay dry
NOT!Inverts the valueIf NOT raining → I go out without an umbrella
pseudocode — logic in action
// Decide whether to go for a run
if (notRaining AND freeTime) {
    goForRun()
}

// Open the fridge if hungry OR bored
if (hungry OR bored) {
    openFridge()
}

if (NOT haveHomework) {
    watchNetflix()
}

AI Connection

AI models like Claude make millions of logical decisions per second when generating text. Each neuron in a neural network applies variations of these operations on numbers.

To explore: "Boolean algebra", "Truth tables", "George Boole". He invented this 170 years ago without imagining it would bring computers to life.

02

Data and Binary Representation

Why binary?

Computers use electricity: there is current (1) or there is not (0). That is a bit. With 8 bits you have a byte. With bytes you can represent letters, numbers, images, video — anything.

📬

Analogy

Imagine you can only communicate with light bulbs: on or off. To say "hello" you need a code. That is ASCII — a table that says "the letter A is the number 65, which in binary is 01000001".

decimal → binary
// The number 13 in binary is 1101. Why?
// 1×8 + 1×4 + 0×2 + 1×1 = 8+4+0+1 = 13

position:  8    4    2    1
binary:    1    1    0    1    → decimal: 13

// Number 7:
position:  4    2    1
binary:    1    1    1    → decimal: 4+2+1 = 7

Storage units

UnitEqualsAnalogy
1 bitA 0 or a 1A switch
1 byte8 bitsA letter of the alphabet
1 KB~1,000 bytesA short text message
1 MB~1,000 KBA photo from your phone
1 GB~1,000 MBA movie in medium quality
1 TB~1,000 GBYour computer hard drive

AI Connection

Claude processes text as tokens — numbers. The phrase "hello world" becomes [15496, 31537] before the model processes it. Everything is binary under the hood: text, images, audio.

To explore: "Hexadecimal system", "ASCII table", "UTF-8 encoding". CSS colors like #E8602C are hexadecimal numbers (base 16) — each pair is one byte.

03

Algorithms and Programming Logic

What is an algorithm?

A sequence of steps to solve a problem. It does not have to be code. A cooking recipe is an algorithm. IKEA instructions too.

🍳

Analogy

Frying an egg: 1. Turn on heat. 2. Add oil. 3. If pan is hot → crack the egg. 4. Wait 2 min. 5. Remove and eat. Input (egg), process (steps), output (fried egg). That is an algorithm.

The 3 building blocks of any program

With these three structures you can build any software in the world:

1. SEQUENCE — steps in order
turnOnComputer()
openBrowser()
searchOnGoogle("how to program")
2. CONDITIONAL — decisions
if (grade >= 5) {
    show("Passed ✓")
} else if (grade >= 4) {
    show("You need the oral exam")
} else {
    show("Failed — back to studying")
}
3. LOOP — repeat
// Count from 1 to 10
for i from 1 to 10 {
    show(i)
}

// While not home, keep walking
while (NOT atHome) {
    walk()
}

AI Connection

Language models are essentially very sophisticated algorithms. Given an input (your prompt), they execute millions of steps (the neural network forward pass) to generate an output (the response). There is no magic — there are algorithms.

To explore: "Algorithmic complexity O(n)", "Sorting algorithms" — search "sorting algorithms visualized" on YouTube. Watching them move changes everything.

04

Hardware — How the Computer Works

🧠 CPU — The Processor

The "brain". Executes instructions. Takes data, processes it, and produces results. Speed is measured in GHz (billions of operations per second). Almost all modern processors have multiple cores.

👨‍🍳

Analogy

The chef in a restaurant. Only the chef cooks, but they are incredibly fast. Cores are like multiple chefs working in parallel.

💾 RAM — Working Memory

Temporary memory. When you open Chrome, the data goes to RAM. Fast but volatile — when you turn off the computer everything is erased. More RAM = more things open without slowing down.

🗂️

Analogy

Your work desk. The larger it is, the more papers you can have open. At the end of the day (shutdown), you clear the desk.

Basic CPU cycle: Fetch → Decode → Execute
1. FETCH     → The CPU retrieves the next instruction from memory
2. DECODE    → It figures out what to do
3. EXECUTE   → It does it (add, compare, move data...)
4. Go back to step 1.

This happens billions of times per second.

AI Connection

AI models like Claude do not run on regular CPUs — they run on GPUs and TPUs, chips designed to perform thousands of matrix operations in parallel. A GPU can have thousands of small cores vs the 8-32 of a CPU. That is what makes modern AI possible.

To explore: "Von Neumann architecture", "What is a GPU and why does it matter for AI?". The GPU is the piece that changed everything.

05

Your First Real Code

Which language to learn first?

The honest answer: any of them works for learning concepts. But if I had to pick one today: Python. Clean, readable, used everywhere: web, data, artificial intelligence, automation.

🗣️

Analogy

Python is like English — fairly straightforward. C is like Latin — precise and powerful but hard. JavaScript is like the internet's lingua franca — it is everywhere. The concepts you learn in one transfer to the others.

Python — variables and functions
# Variable — a named box where you store a value
name = "Ana"
age = 22
passed = True   # True = yes

print("Hello,", name)  # → Hello, Ana

# Function — reusable block of code
def evaluate_grade(grade):
    if grade >= 9:
        return "Outstanding 🏆"
    elif grade >= 5:
        return "Passed"
    else:
        return "Failed"

grades = [6.5, 9.2, 4.5, 7.0]
for grade in grades:
    print(f"Grade: {grade} → {evaluate_grade(grade)}")

AI Connection

The Anthropic SDK for calling Claude from code is available in Python and JavaScript. With 20 lines of Python you can send a message to Claude and process its response. That is the next step after this guide.

To explore: Search "CS50 Harvard Python" on YouTube — it is the best free introductory course out there. Install Python and write your first print("Hello world"). The first code you run on your own is a moment you never forget.

06

Networks and the Internet

How does the Internet work?

The Internet is a huge network of computers that communicate using protocols — common rules for speaking the same language. Without protocols, computers could not understand each other.

📮

Analogy

When you send a letter you need: the recipient's address (IP), an envelope (TCP packet), and the post office as intermediary (router). The Internet works the same way but in milliseconds.

Essential concepts

ConceptWhat is it?
IPYour computer's address on the network. Like your house number.
DNSTranslates names (google.com) to IPs. The Internet's address book.
HTTP/HTTPSProtocol for the web. The S means it is encrypted.
PortLike the door of a house. 80 = HTTP, 443 = HTTPS, 22 = SSH.
What happens when you type 'google.com'?
1. Browser asks DNS: "What IP is google.com?"
2. DNS replies: "It is 142.250.184.14"
3. Your computer sends an HTTP request to that IP (port 443)
4. Google's server receives the request
5. It returns the HTML of the page
6. Your browser renders it on screen

All of this happens in under 200ms.

AI Connection

When you call Claude's API, your code does exactly this: an HTTPS request to api.anthropic.com, with your message in the body (JSON), and Claude responds with text. It is just a web request like any other.

To explore: "What is a REST API?", "How does HTTPS work?". Once you understand HTTP you will understand how the entire modern web works — and how to talk to Claude from code.

07

What to Explore Next

Computer science is vast. You do not need to learn everything now — you need to know what exists so you can find it when you need it.

Foundation

Data Structures

Arrays, lists, trees, graphs. How to organize information efficiently.

Foundation

Operating Systems

How does the computer manage multiple programs? Processes, memory, files.

Programming

Object-Oriented Programming

Organizing code into objects. The basis of Python, Java, C#.

Programming

SQL Databases

How to store and query data. Ubiquitous in the industry.

Web

HTML + CSS + JavaScript

The three languages of the web. With them you can build any app.

Key 2026

Artificial Intelligence

Machine Learning, neural networks. It is not magic — it is math.

Infra

Linux and the Terminal

Most servers run Linux. Learning the terminal means talking directly to the computer.

Infra

Git and Version Control

How to save the history of your code. The most used tool in development.

Suggested roadmap

W1

Install Python and write your first code

  • Download Python.org
  • Write your first variable, your first if, your first loop
  • Do not skip this — it is the foundation of everything
W2

Understand binary and logic

  • Convert numbers to binary by hand
  • Practice truth tables
  • Search "CS50 Harvard" on YouTube — it is free and excellent
W3

Basic algorithms

  • Implement the algorithms from this guide in Python
  • Search "sorting algorithms visualized" — watching them move changes everything
W4

HTML and the web

  • Create your first web page (it does not have to be pretty)
  • Understand what a server is, what a client is
  • Make an HTTP request by hand
+

When comfortable → Claude

  • You now have the foundation to understand how AI works
  • Continue with the certification roadmap →

Next step

Ready to build on it?

The Claude certification roadmap takes you from these foundations all the way to passing the Anthropic exam.