This e-book aims to illustrate the basics of how a computer works, focusing on how a program written in a high-level language ends up being physically executed on a Central Processing Unit (CPU). The e-book is intended to be used in the context of an introductory computer science course at high school or undergraduate level.
The e-book starts with a concise explanation of the fundamental architecture shared by a wide variety of modern "computers", such as desktop computers, mobile phones, or car control units. This is followed by an explanation of the essential elements of the structure of any CPU, and the machine (assembly) language that it can execute.
This e-book is built around the Educational CPU Visual Simulator (CPUVSIM), also available as an OER in Merlot, which you can access through the 'Simulator' button in the top right corner. The e-book is a dynamic document because the simulator is seamlessly integrated with the proposed exercises: by clicking on the 'Show solution' buttons, the CPUVSIM comes to life, loading the solution for the specific exercise into memory. This allows one to experiment directly with the programming exercises presented in the book.
The associated CPUVSIM allows users to visualize with detailed animations the execution of assembly language code. Its main goal is to support novices in understanding the behavior of the key components of a CPU, focusing on how code written in high-level languages is actually executed on the hardware of a computer.It supports a simplified but representative assembly language of 16 (Data Transfer, Control Flow, Arithmetic-Logic) instructions, with immediate and direct addressing modalities. Instructions and numeric data can be inserted and edited directly in RAM. It is possible to define “labels” to be used as parameters in jump instructions, or as variable identifiers. The speed and level of details of the animations can be controlled by the users. At any time, it is possible to switch between symbolic and binary representations.