Before we write code, we must understand the machine. From basic logic gates to complex architectures. Antes de escribir código, debemos comprender la máquina. Desde puertas lógicas básicas hasta arquitecturas complejas.
Santi Scagliusi, PhD
The building blocks of everything we do.Los bloques fundamentales de todo lo que hacemos.
The Exclusive OR (XOR) is critical in assembly for toggling bits and comparing values.
Output is 1 only if inputs are different.
La OR Exclusiva (XOR) es fundamental en ensamblador para alternar bits y comparar valores.
La salida es 1 solo si las entradas son diferentes.
| Input AEntrada A | Input BEntrada B | Output (A^B)Salida (A^B) |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
Embedded systems live in Hexadecimal.Los sistemas embebidos viven en Hexadecimal.
In code, we see 0 and 1. In the real world, these are voltage levels. En código, vemos 0 y 1. En el mundo real, estos son niveles de tensión.
Between HIGH and LOW lies the dangerous "Undefined Region" (Noise Margin). Entre ALTO y BAJO se encuentra la peligrosa "Región Indefinida" (Margen de Ruido).
It is a computing system dedicated to a specific task within a larger system. Unlike a PC (General Purpose), an embedded system does one thing, and does it efficiently. Es un sistema de computación dedicado a una tarea específica dentro de un sistema mayor. A diferencia de un PC (Propósito General), un sistema embebido hace una sola cosa, y la hace eficientemente.
From the first chips to microprocessors, microcontrollers and SoCs.Desde los primeros chips hasta microprocesadores, microcontroladores y SoCs.
Intel 4004 & TI TMS1000. The first "computers on a chip".Intel 4004 y TI TMS1000. Las primeras "computadoras en un chip".
More peripherals (ADC, UART). 8-bit dominates (8051, PIC).Más periféricos (ADC, UART). Dominan los 8 bits (8051, PIC).
16/32-bit (MSP430, ARM). Low Power for battery devices.16/32 bits (MSP430, ARM). Bajo consumo para dispositivos con batería.
CPU only. Needs external RAM, Flash, I/O.Solo CPU. Necesita RAM, Flash, E/S externos.
CPU + RAM + FRAM + Peripherals in one chip.CPU + RAM + FRAM + Periféricos en un solo chip.
CPU + GPU + Radio + DSP. Extreme integration.CPU + GPU + Radio + DSP. Integración extrema.
Before comparing architectures, identify the four actors that appear in every diagram.Antes de comparar arquitecturas, identifiquemos los cuatro actores que aparecen en todos los diagramas.
Registers, ALU and control unit. The part that executes instructions.Registros, ALU y unidad de control. La parte que ejecuta instrucciones.
Stores code and data. In many systems it becomes the main bottleneck.Almacena código y datos. En muchos sistemas se convierte en el principal cuello de botella.
Peripherals that connect the processor with sensors, actuators and the outside world.Periféricos que conectan el procesador con sensores, actuadores y el mundo exterior.
The shared roads that move addresses, data and control signals.Las carreteras compartidas que mueven direcciones, datos y señales de control.
How does the CPU fetch data and instructions: through one shared path or through separate ones?¿Cómo obtiene la CPU datos e instrucciones: por un camino compartido o por caminos separados?
Used by MSP430. Simpler, flexible, but creates a "Bottleneck".Usada por el MSP430. Más simple, flexible, pero crea un "Cuello de Botella".
Separate paths allow simultaneous access. Faster, but more complex.Caminos separados permiten acceso simultáneo. Más rápida, pero más compleja.
A shared bus simplifies hardware, but it also forces arbitration: only one transfer can occupy the road at a time.Un bus compartido simplifica el hardware, pero obliga a arbitrar: solo una transferencia puede ocupar la carretera a la vez.
I/O → Memory directly. No CPU needed.E/S → Memoria directo. Sin CPU.
The diagram matters because it changes who controls transfers, how many transactions are needed, and who has to wait.El diagrama importa porque cambia quién controla las transferencias, cuántas transacciones hacen falta y quién tiene que esperar.
The CPU is the bus master. Every peripheral access must go through it, so moving one I/O datum into memory can require several transactions.La CPU es el maestro del bus. Todo acceso a periféricos pasa por ella, así que mover un dato desde E/S a memoria puede requerir varias transacciones.
A single shared bus means contention. If code fetch, memory access and I/O all want it, someone has to wait.Un único bus compartido implica contención. Si la búsqueda de código, la memoria y la E/S lo quieren a la vez, alguien tiene que esperar.
Direct Memory Access lets a peripheral or DMA controller become the temporary master to move blocks without burning CPU cycles.El acceso directo a memoria permite que un periférico o el controlador DMA sea maestro temporal para mover bloques sin gastar ciclos de CPU.
Simple, regular instructions are easier to overlap. Compare a dependency stall against a clean flow.Las instrucciones simples y regulares son más fáciles de solapar. Compara un atasco por dependencia frente a un flujo limpio.
IF = fetchbúsqueda · D = decodedecodificación · E = executeejecución · M = memorymemoria · WB = write backescritura
Instruction 2 depends on the value loaded by instruction 1, so the pipeline inserts a stall.La instrucción 2 depende del valor cargado por la instrucción 1, así que el pipeline inserta un bloqueo.
When instructions are simple and independent, fetch, decode and execute can overlap almost like an assembly line.Cuando las instrucciones son simples e independientes, búsqueda, decodificación y ejecución pueden solaparse casi como una cadena de montaje.
How does code become machine instructions?¿Cómo se convierte el código en instrucciones de máquina?
Java is the classic example: part compile stage, part virtual-machine execution.Java es el ejemplo clásico: parte de compilación y parte de ejecución sobre máquina virtual.
"Write once, run anywhere.""Escribir una vez, ejecutar en cualquier lugar."
Managing resources so multiple programs can coexist.Gestión de recursos para que múltiples programas coexistan.
Chooses which task gets CPU time and when a context switch must happen.Decide qué tarea usa la CPU y cuándo debe ocurrir un cambio de contexto.
Allocates and protects memory regions so programs can coexist safely.Asigna y protege regiones de memoria para que varios programas puedan coexistir con seguridad.
Abstracts disks or files so applications do not talk to raw storage directly.Abstrae discos o ficheros para que las aplicaciones no hablen directamente con el almacenamiento físico.
Provides drivers and standard interfaces for screens, keyboards, network cards and sensors.Proporciona drivers e interfaces estándar para pantallas, teclados, tarjetas de red y sensores.
Different systems share CPU time in very different ways, and RTOS is not the same as multicore parallelism.Los sistemas comparten tiempo de CPU de formas muy distintas, y un RTOS no es lo mismo que el paralelismo multinúcleo.
Each task voluntarily yields. If A hangs → everything freezes.Cada tarea cede voluntariamente. Si A se cuelga → todo se congela.
Windows 3.1, Classic Mac OS
OS forces context switches. No task can monopolize CPU.El SO fuerza cambios de contexto. Ninguna tarea monopoliza la CPU.
Windows 95+, Linux, macOS
Here there is actual simultaneity: different tasks are running at the same time on different cores.Aquí sí hay simultaneidad real: distintas tareas se están ejecutando al mismo tiempo en núcleos diferentes.
Typical in multicore CPUs and modern SoCsTípico en CPUs multinúcleo y SoCs modernos
Guaranteed bounded response time. What matters is not only multitasking, but deterministic latency.Tiempo de respuesta garantizado y acotado. Lo importante no es solo la multitarea, sino la latencia determinista.
FreeRTOS, VxWorks, QNX
Why did we choose this specific chip for the course?¿Por qué elegimos este chip específico para el curso?
8-bit is too limiting. 32-bit is complex. 16-bit is perfect for learning: clean architecture, powerful enough for math, simple enough to understand every bit. 8 bits es muy limitado. 32 bits es complejo. 16 bits es perfecto para aprender: arquitectura limpia, suficientemente potente para cálculos, suficientemente simple para entender cada bit.
Designed to run on batteries for years. It has sophisticated Low Power Modes (LPM) that we will master. Diseñado para funcionar con baterías durante años. Tiene sofisticados Modos de Bajo Consumo (LPM) que dominaremos.
It's not just a CPU. It includes Timers, ADCs, and Communication modules on-chip. Real-world capabilities. No es solo una CPU. Incluye Timers, ADCs y módulos de comunicación en el chip. Capacidades del mundo real.