# The Elements of Computing Systems: Building a Modern Computer from First Principles

## Noam Nisan, Shimon Schocken

Language: English

Pages: 344

ISBN: 0262640686

Format: PDF / Kindle (mobi) / ePub

In the early days of computer science, the interactions of hardware, software, compilers, and operating system were simple enough to allow students to see an overall picture of how computers worked. With the increasing complexity of computer technology and the resulting specialization of knowledge, such clarity is often lost. Unlike other texts that cover only one aspect of the field, *The Elements of Computing Systems* gives students an integrated and rigorous picture of applied computer science, as its comes to play in the construction of a simple yet powerful computer system.

Indeed, the best way to understand how computers work is to build one from scratch, and this textbook leads students through twelve chapters and projects that gradually build a basic hardware platform and a modern software hierarchy from the ground up. In the process, the students gain hands-on knowledge of hardware architecture, operating systems, programming languages, compilers, data structures, algorithms, and software engineering. Using this constructive approach, the book exposes a significant body of computer science knowledge and demonstrates how theoretical and applied techniques taught in other courses fit into the overall picture.

Designed to support one- or two-semester courses, the book is based on an abstraction-implementation paradigm; each chapter presents a key hardware or software abstraction, a proposed implementation that makes it concrete, and an actual project. The emerging computer system can be built by following the chapters, although this is only one option, since the projects are self-contained and can be done or skipped in any order. All the computer science knowledge necessary for completing the projects is embedded in the book, the only pre-requisite being a programming experience.The book's web site provides all tools and materials necessary to build all the hardware and software systems described in the text, including two hundred test programs for the twelve projects. The projects and systems can be modified to meet various teaching needs, and all the supplied software is open-source.

flow and stack processing and subroutines and symbols and syntax and testing and translator Virtual memory segments Visual Basic VM. See Virtual Machine Void methods von Neumann architecture White space Windows Working stack XML Xor function implementation of multi-bit versions of Yet Another Compiler Compiler (YACC)

■ The system can code a total of 2n signed numbers, of which the maximal and minimal numbers are 2n–1–1 and–2n–1, respectively. ■ The codes of all positive numbers begin with a 0. ■ The codes of all negative numbers begin with a 1. ■ To obtain the code of–x from the code of x, leave all the trailing (least significant) 0’s and the first least significant 1 intact, then flip all the remaining bits (convert 0’s to 1’s and vice versa). An equivalent shortcut, which is easier to implement in

operations, number and type of registers, and assembly syntax rules, there is a Tower of Babel of machine languages, each with its own obscure syntax. Yet irrespective of this variety, all machine languages support similar sets of generic commands, which we now describe. 4.1.3 Commands Arithmetic and Logic Operations Every computer is required to perform basic arithmetic operations like addition and subtraction as well as basic Boolean operations like bit-wise negation, bit shifting,

and so forth. Here are some examples, written in typical machine language syntax: Memory Access Memory access commands fall into two categories. First, as we have just seen, arithmetic and logical commands are allowed to operate not only on registers, but also on selected memory locations. Second, all computers feature explicit load and store commands, designed to move data between registers and memory. These memory access commands may use several types of addressing modes—ways of specifying

operations (gates in hardware), these algorithms end up requiring O(n2)-bit operations. There exist multiplication and division algorithms whose running time is asymptotically significantly faster than O(n2), and, for a large number of bits, these algorithms are more efficient. In a similar fashion, optimized versions of the geometric operations that we presented (e.g., line- and circle-drawing) are often also implemented in special graphics acceleration hardware. Readers who wish to extend the