# The Elements of Computing Systems

## Metadata
- Author: [[Noam Nisan und Shimon Schocken]]
- Full Title: The Elements of Computing Systems
- Category: #general-computing
## Highlights
- generate low-level code that reexpresses this semantics using the machine language of the target computer. The result of this elaborate translation process, known as compilation, will be an executable sequence of machine language instructions. ([Location 465](https://readwise.io/to_kindle?action=open&asin=B084V7R8PT&location=465))
- Now, every one of these hardware devices is constructed from lower-level, elementary logic gates. ([Location 469](https://readwise.io/to_kindle?action=open&asin=B084V7R8PT&location=469))
- And these gates, in turn, can be built from primitive gates like Nand and Nor. ([Location 469](https://readwise.io/to_kindle?action=open&asin=B084V7R8PT&location=469))
- switching devices, typically implemented by transistors. ([Location 471](https://readwise.io/to_kindle?action=open&asin=B084V7R8PT&location=471))
- First, all computers are based, at bottom, on elementary logic gates, of which Nand is the most widely used in industry ([Location 481](https://readwise.io/to_kindle?action=open&asin=B084V7R8PT&location=481))
- Starting at the bottom tier of the figure, any general-purpose computer has an architecture that includes a ALU (Arithmetic Logic Unit) and a RAM (Random Access Memory). All ALU and RAM devices are made of elementary logic gates. ([Location 490](https://readwise.io/to_kindle?action=open&asin=B084V7R8PT&location=490))
- all high-level languages rely on a suite of translators (compiler/interpreter, virtual machine, assembler) for reducing high-level code all the way down to machine-level instructions. ([Location 492](https://readwise.io/to_kindle?action=open&asin=B084V7R8PT&location=492))
- The distinction between abstraction and implementation plays a major role in systems design, as we now turn to discuss. ([Location 520](https://readwise.io/to_kindle?action=open&asin=B084V7R8PT&location=520))
- We deal with this complexity by breaking the system into modules. ([Location 524](https://readwise.io/to_kindle?action=open&asin=B084V7R8PT&location=524))
- a good modular design implies just that: you can work on the individual modules independently, while completely ignoring the rest of the system. In fact, if the system is well designed, you can build these modules in any desired order, and even in parallel, if you work in a team. ([Location 527](https://readwise.io/to_kindle?action=open&asin=B084V7R8PT&location=527))
- abstraction describes what the module does, and implementation describes how it does it. With this distinction in mind, here is the most important rule in system engineering: when using a module as a building block—any module—you are to focus exclusively on the module’s abstraction, ignoring completely its implementation details. ([Location 531](https://readwise.io/to_kindle?action=open&asin=B084V7R8PT&location=531))
- the RAM storage and direct-access capabilities will be realized using registers and multiplexers, respectively. ([Location 542](https://readwise.io/to_kindle?action=open&asin=B084V7R8PT&location=542))
- whenever your implementation uses a lower-level hardware or software module, you are to treat this module as an off-the-shelf, black box abstraction: all you need is the documentation of the module’s interface, describing what it can do, and off you ([Location 545](https://readwise.io/to_kindle?action=open&asin=B084V7R8PT&location=545))
- This abstraction-implementation paradigm helps developers manage complexity and maintain sanity: by dividing an overwhelming system into well-defined modules, we create manageable chunks of implementation work and localize error detection and correction. This is the most important design principle in hardware and software construction projects. ([Location 548](https://readwise.io/to_kindle?action=open&asin=B084V7R8PT&location=548))
- modular design is the bread and butter of applied computer science: every system architect routinely defines abstractions, sometimes referred to as modules or interfaces, and then implements them, or asks other people to implement them. ([Location 553](https://readwise.io/to_kindle?action=open&asin=B084V7R8PT&location=553))
- Hardware Description Language. The HDL ([Location 564](https://readwise.io/to_kindle?action=open&asin=B084V7R8PT&location=564))
- Although these chips come in different shapes and forms, they are all made of the same building blocks: elementary logic gates. ([Location 602](https://readwise.io/to_kindle?action=open&asin=B084V7R8PT&location=602))
- Boolean algebra manipulates two-state binary values that are typically labeled true/false, 1/0, yes/no, on/off, and so forth. We will use 1 and 0. A Boolean function is a function that operates on binary inputs and returns binary outputs. Since computer hardware is based on representing and manipulating binary values, Boolean functions play a central role in the specification, analysis, and optimization of hardware architectures. ([Location 615](https://readwise.io/to_kindle?action=open&asin=B084V7R8PT&location=615))
- a truth table is often a convenient means for describing some states of nature, whereas a Boolean expression is a convenient formalism for realizing this description in silicon. The ability to move from one representation to the other is one of the most important practices of hardware design. ([Location 667](https://readwise.io/to_kindle?action=open&asin=B084V7R8PT&location=667))
- A gate is a physical device that implements a simple Boolean function. ([Location 675](https://readwise.io/to_kindle?action=open&asin=B084V7R8PT&location=675))
- Today, gates are typically implemented as transistors etched in silicon, packaged as chips. ([Location 679](https://readwise.io/to_kindle?action=open&asin=B084V7R8PT&location=679))
- gate’s internal architecture, or implementation, whereas the left side shows the gate interface, namely, its input and output pins and the behavior that it exposes to the outside world. ([Location 701](https://readwise.io/to_kindle?action=open&asin=B084V7R8PT&location=701))
- gate implementation will realize its stated interface, one way or another. ([Location 714](https://readwise.io/to_kindle?action=open&asin=B084V7R8PT&location=714))
- Given a gate abstraction (also referred to as specification, or interface), find an efficient way to implement it using other gates that were already implemented. ([Location 717](https://readwise.io/to_kindle?action=open&asin=B084V7R8PT&location=717))
- design the chip architecture using a formalism called Hardware Description Language, or HDL. The designer specifies the chip logic by writing an HDL program, which is then subjected to a rigorous battery of tests. The tests are carried out virtually, using computer simulation: A special software tool, called a hardware simulator, takes the HDL program as input and creates a software representation of the chip logic. ([Location 740](https://readwise.io/to_kindle?action=open&asin=B084V7R8PT&location=740))
- An HDL definition of a chip consists of a header section and a parts section. The header section specifies the chip interface, listing the chip name and the names of its input and output pins. The PARTS section describes the chip-parts from which the chip architecture is made. Each chip-part is represented by a single statement that specifies the part name, followed by a parenthetical expression that specifies how it is connected to other parts in the design. ([Location 755](https://readwise.io/to_kindle?action=open&asin=B084V7R8PT&location=755))
- A multiplexer is a three-input gate (see figure 1.9). Two input bits, named a and b, are interpreted as data bits, and a third input bit, named sel, is interpreted as a selection bit. ([Location 831](https://readwise.io/to_kindle?action=open&asin=B084V7R8PT&location=831))
- Demultiplexer: A demultiplexer performs the opposite function of a multiplexer: it takes a single input value and routes it to one of two possible outputs, according to a selector bit that selects the destination output. ([Location 839](https://readwise.io/to_kindle?action=open&asin=B084V7R8PT&location=839))
- HDL programs treat multi-bit values like single-bit values, except that the values can be indexed in order to access individual bits. ([Location 848](https://readwise.io/to_kindle?action=open&asin=B084V7R8PT&location=848))
- Multi-way/Multi-bit demultiplexer: An m-way n-bit demultiplexer routes its single n-bit input to one of its m n-bit outputs. The other outputs are set to 0. The selection is specified by a set of k selection bits, where Here is the API of a 4-way demultiplexer: ([Location 873](https://readwise.io/to_kindle?action=open&asin=B084V7R8PT&location=873))
- two general approaches to implementing logic gates: behavioral simulation and hardware implementation. ([Location 881](https://readwise.io/to_kindle?action=open&asin=B084V7R8PT&location=881))