> For the complete documentation index, see [llms.txt](https://kevinli.gitbook.io/crafting-computer/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kevinli.gitbook.io/crafting-computer/master.md).

# Introduction

Computers power everything from phones and laptops to cars and planes. However, they have always been magical blackboxes to most people. If you are interested in understanding exactly how the magic works under the hood, this book is for you. We will guide you through the fundamentals of computing by creating a 16-bit computer from scratch. To make the design and test of our computer easier, we will construct it virtually in the browser using a Hardware Description Language called Sim. You can print the circuits we designed physically and create a real version of our computer but that's not the focus of this book. The purpose of this book is to guide you through crafting a general computer without being bogged down by the nuisances of the electric hardware. Don't worry too much, we will start simple and slow at first and gradually release the joy of explorations and creations to you after learning the basics.

Here's a roadmap for building our computer:

1. Logic circuits
2. Arithmetic circuits
3. Arithmetic Logic Unit
4. Memory
5. Central Processing Unit

You can follow the tutorials and build the circuits using the online [Sim editor](https://alienkevin.github.io/sim-lang/). All progress are saved automatically so you can pause and resume work anytime.

## Credits

Thanks to all the wonderful projects below that inspired Crafting Computer:

* [Nand to Tetris](https://www.nand2tetris.org/)
* [Elm](http://elm-lang.org/)
* [Type inference for beginners — Part 1](https://medium.com/@dhruvrajvanshi/type-inference-for-beginners-part-1-3e0a5be98a4b)

## License

MIT


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://kevinli.gitbook.io/crafting-computer/master.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
