You press Enter. The terminal displays the result. Three tenths of a second
have gone by.
In those three hundred milliseconds, a cascade of events unfolded at speeds impossible to visualize intuitively: the processor fetched hundreds of millions of instructions from memory; the cache subsystem tried to anticipate which data would be needed next; the pipeline overlapped the execution of dozens of simultaneous operations; the control unit decoded, one by one, the machine language instructions that correspond to your lines of code, which had previously gone through the phases of lexical analysis, parsing, semantic analysis, and code generation.
And all of this on hardware that, deep down, understands only two states: high or low voltage. Zero or one.
This series explores how these layers really work: how memory is organized and addressed, how the processor fetches and executes instructions, what the differences between RISC and CISC are, what a pipeline hazard is, how a decimal number becomes a sequence of bits in memory, how a program in a high-level language reaches the hardware.
Prerequisites and companion series #
This series is self-contained as far as computer architecture is concerned. It does have a sister series, however, From Zero to Float, which covers binary number representation in depth: number bases, two’s complement, overflow, and IEEE 754 floating point. If you are not yet familiar with these concepts, I recommend starting there. The article on data representation in this series revisits the main points, but does not replace that reading.
Programming in Python is welcome, but not required. All the calculation and reasoning examples are presented mathematically. Python appears as a bonus in some articles for those who want to explore the concepts interactively.
What you will learn in this series #
If we could open up a computer and map how its main parts “talk” to each other, we would see a very well-defined model. On one side, we have the machine’s “brain”: the CPU, which houses the control unit, the calculation units (logic and arithmetic), and the registers. On the other, we have the Main Memory and the devices that interact with the outside world (keyboards, printers, monitors). So that the CPU does not need an individual cable for each part, everything is connected by a main communication path called a bus, as the following diagram illustrates:

Understanding this organization of a computer is the central goal of this series of articles. By the end, I hope the reader will have a deep understanding of every aspect presented in the figure.
The model in the figure is the Von Neumann one: instructions and data live in the same memory and travel through the same bus. There is an alternative, the Harvard architecture, in which instructions and data have separate memories and buses. It is worth keeping the distinction in mind, because it reappears twice in the series: when the cache splits into one part for instructions and another for data, and when the pipeline stalls because two stages want to access the same memory in the same cycle. Both cases are a consequence of instructions and data sharing the same path, and modern processors solve it with a middle ground called modified Harvard.
The series is organized into 13 thematic articles, in addition to this introduction. Each article is dedicated to a specific aspect of computer architecture, but all of them are interconnected to form a complete picture of how a machine works internally. The topics in the table below link directly to each article:
| # | Topic | Topics covered |
|---|---|---|
| 0 | Introduction | This very article |
| 1 | Boolean Algebra | Logic gates, postulates and theorems, De Morgan’s laws, universality of NAND and NOR, and algebraic simplification |
| 2 | Simplifying Logic Functions | Minterms and maxterms, SOP and POS forms, Karnaugh map, and don’t-care conditions |
| 3 | Memory Hierarchy | Cells, addresses, MAR/MDR, SRAM, DRAM, ROM, ECC, and sizing |
| 4 | Cache Memory | Locality, direct/associative/set-associative mappings, replacement, and writes |
| 5 | CPU: Components and Instruction Cycle | ALU, CU, registers, IR, PC, and the fetch-decode-execute cycle |
| 6 | CPU: The Hypothetical Processor | 12-bit instruction set, step-by-step execution, and hypothetical assembly |
| 7 | Pipeline and Buses | Stages, data/control/structural hazards, and hardwired × microprogrammed CU |
| 8 | Data Representation | ASCII, Unicode, two’s complement, shifts, and IEEE 754 |
| 9 | Instruction Representation | ISA, formats with 0 to 3 operands, and the 7 addressing modes |
| 10 | Program Execution | Evolution of languages, compiler phases, assembler, linker, and loader |
| 11 | Python and the Path from Code to Hardware (bonus) | CPython, bytecode, VM, and differences between interpreted and compiled languages |
| 12 | Input and Output | Polling, interrupts, DMA, and the I/O overhead calculation |
| 13 | Advanced Architectures | RISC × CISC, Flynn’s taxonomy, SMP, NUMA, clusters, and multicore |
About the methodology #
Each article starts from precise definitions, presents the fundamental formulas and models, works through theoretical and numerical examples step by step, and ends by connecting the topic to the next article.
The assembly code examples follow closely the way they appear in academic references, with occasional adaptations for didactic reasons: an address adjusted here, a comment added there, a name changed to keep consistency with the rest of the series. The closeness to the original material is intentional: you will be seeing essentially the same assembly that appears in classic computer architecture textbooks.
About the origin of the series and my background #
I have a bachelor’s degree in chemistry and later did a master’s in chemistry. However, I have always had a strong affinity for computing and electronic equipment in general. So much so that, while still an undergraduate doing undergraduate research, I became responsible for the maintenance and management of the laboratory equipment and its respective computers. Besides that, whenever I could automate something with code, even if it was just an Excel spreadsheet, I automated it.
So, naturally, my career evolved toward something related to programming. For example, I was once a chemistry teacher at a federal institute, and in my classes I used interactive materials that I developed myself. I also advised students on projects involving programming. And today I am a data scientist, having worked on several projects for large national and international companies.
I learned programming on my own, from books, documentation, and material on the internet. Until, because I enjoy studying so much, I decided to start a new undergraduate degree. Honestly, I don’t even know if I will see the program through to the end, because of time and work. I started because I like to study, and I was already studying on my own various undergraduate and graduate computing materials. If I think it is worth it, I will continue; otherwise I will leave the program and keep going on my own, as I have always done. But, in any case, this series is based on one of the program’s courses. Let’s talk a bit about the program and the course that gave rise to the articles in this series.
Associate Degree in Computer Systems #
This series of articles was inspired by the materials of the course Computer Organization in the Tecnólogo (associate degree) program in Computer Systems offered by CEDERJ.
In case you are not from Rio de Janeiro or do not know the project, CEDERJ (Centro de Educação Superior a Distância do Estado do Rio de Janeiro, the Rio de Janeiro State Distance Higher Education Center) is a consortium that brings together the main public universities of the state (such as UFF, UFRJ, UERJ, among others) to offer higher education. In the case of this program, the diploma is issued by UFF. The program is blended: students study through a platform with dedicated teaching materials and online tutoring support, but the official exams take place in person at the regional centers spread across the state.
If you have doubts about what a Tecnólogo program is, know that it is a higher-education degree, exactly like a bachelor’s or a teaching degree. The main difference lies in focus and duration: while a bachelor’s in Computer Science can last four or five years with an extensive theoretical load, the Tecnólogo is leaner (it usually lasts about three years) and has a curriculum that is theoretically more oriented toward practice and toward the real, immediate demands of the technology job market. Emphasis on “theoretically”, but that is talk for another article.
Someday I will write more about the program, whether it is worth it, how it is organized, and other points. Here, it is worth commenting a little on the course and also making some clarifications.
How the series was developed #
A few very important points:
- I have no connection to CEDERJ other than as a student. I do not know the course’s professors (remember that the program is delivered through an online platform with pre-recorded videos) or the tutors.
- The articles grew out of personal notes I took while studying for the course. Later I complemented them with other things I found interesting that were not covered in the course. And I adapted them to fit the form and language of the other articles here at Ciência Programada.
- The articles have no pretension whatsoever of replacing the course materials. In fact, I wrote them to be read by anyone interested in the topic, even someone who does not know what CEDERJ is or does not even read this introductory article. Again, the articles are completely independent of the material that served as inspiration.
- The articles cover several topics not covered in the course that I found interesting to add. For example, since I work with Python, I added several examples in that language that are not original to the course. I included them because I like the language and thought it would be nice to add.
- The course material is very dated. So I made an effort to update it and complement it with more recent information whenever possible.
- The course materials served only as inspiration and reference. In order not to violate any copyrights of the professors, the institution, or the books the professors may have used to produce the material, I did not copy any passage, however small, from the slides. I also did not directly use any figure from the slides.
- Regarding the figures that appear in the articles, I either recreated them using Draw.io or Mermaid, or they were created from scratch by me. Some were also created using AI image generators, such as Gemini, and in those cases you can tell by the watermark that such tools usually leave. The ones I recreated have additions that I found interesting compared to the original figures in the course materials.
- Regarding the examples that appear in the articles. Some are inspired by examples from the course materials, whether from the slides or from assignments, but were adapted and modified to fit better the form and language of the articles here on the site. Some others are adapted from the books cited below. And there are examples that are original, created by me, with no relation whatsoever to the course materials.
In fact, the course material is quite simple and old. And I am not criticizing the professors who originally developed the material. If anyone deserves criticism, it is the institution CEDERJ, which does not invest in updating the material. That is precisely why I went looking for other sources while studying, since the material did not satisfy my curiosity and is quite outdated, especially in format.
For those who are curious, here are the course slides. And also the distance assignments from recent years and the exams from recent years. All of these links are from a Google Drive maintained by the program’s Student Council, of which I am not a member and with which I have no involvement.
The same Student Council uploaded the videos available on the study platform to YouTube, in this playlist. The reason is the platform’s instability, which constantly harms students. By staying on YouTube, the chance of being offline drops drastically.
The links above point to material hosted by third parties (Google Drive folders and a YouTube playlist), maintained by the program’s Student Council. I have no control over either of them, and content like this tends to vanish without notice. If you find a dead link, leave a comment letting me know: I will try to find another way to share the material.
As you can see, the videos were recorded a long time ago, almost 20 years. The low image quality is not because of YouTube, it is exactly like that on the platform. Unfortunately, that is what CEDERJ provides. And it is not only in this course that the situation is like this. Again, I am not criticizing the professors who recorded this years ago with the resources and technologies available at the time. I believe not even they thought back then that the material would be used almost two decades later. What I criticize is the institution that does not invest in updating the material, whether in format or in content. I have more than a decade of teaching experience, and I know when a deficiency in material is due to a lack of investment by the institution or a lack of effort by the teacher. And, in this case, it is clearly the institution that does not invest.
Anyway, someday I will write more about CEDERJ’s problems (and also some of the positives). The goal here is just to make clear that the articles, however much they were initially inspired by the course material, do not contain copies of passages from the materials. In fact, I imagine that anyone who reads the articles will notice that they have content, form, and approach quite different from the slides and videos.
Finally, the course recommends the book “Introdução à Organização de Computadores” by Mário A. Monteiro, published by LTC. As far as I could determine, the latest edition of this book is from 2007… The book is good, but I believe a more up-to-date one would be more interesting. I ended up studying more from “Computer Organization and Architecture” by William Stallings, which has more recent editions and a teaching approach that I found better than that of Monteiro’s book.
Now enjoy the series #
That’s it for this article. Unlike other series here on the site, I felt this one needed a more detailed introduction before getting straight into the content. There is a whole context that, for more demanding readers, can make a difference. But, overall, I think the series can easily be understood and enjoyed without the personal context covered here.
For those reading on the day this article was published, the first article in the series will be available tomorrow. See you then!