How do you move from it being a collection of transistors to it being a fully functional computer?

588 views

How do you move from it being a collection of transistors to it being a fully functional computer?

In: 20

12 Answers

Anonymous 0 Comments

By arranging the transistors in the right patterns, you can use them to do logic on single-bit values (1s and 0s). These circuits are called **[logic gates](https://en.wikipedia.org/wiki/Logic_gate)**. For instance, an AND gate will output the value 1 only if *both* of its inputs are 1; whereas a NOR gate will output a 1 only if *neither* of its inputs are 1.

Once you have logic gates, you can arrange those in the right patterns and use them to do binary arithmetic. For instance, by combining an AND gate with an XOR gate, you can make a **half adder** that computes the sum of two bits. A half adder can only do a tiny amount of addition: it can only do 0+0, 0+1, 1+0, and 1+1.

To deal with numbers bigger than a single bit, adders and other logic are connected together in bigger patterns. When you have circuits to do a lot of different arithmetic and logic operations, they can be bundled together into an **arithmetic and logic unit (ALU)**. This lets you input two numbers (each made of many bits) but also has a third input that selects what operation you want to do on them — adding, subtracting, and so on.

With a simple ALU, a small memory circuit (a **register**), and some circuits to control the display, you can make an old-school pocket calculator. This isn’t quite a computer yet, because it doesn’t run code; it just responds to button presses by doing one arithmetic operation and displaying the result.

A computer has a few things a pocket calculator doesn’t. A pocket calculator can only remember one or two numbers at a time. A computer has a **memory** that allows it to store data in numbered locations. So instead of saying *”add 3 and 5 and show me the result”*, you can tell it to *”take the number in memory cell #1 and the number in memory cell #2, add them together, and store the sum in memory cell #3.”* This is where **variables** come from.

A computer can also have a list of instructions stored in its memory: a **stored program**. This is *code* in the simplest sense. These instructions are stored as numbers, and each instruction is in a numbered cell in memory. The computer also has a special memory register called the **program counter (PC)** to keep track of which instruction to do next. And it also has instructions to modify the PC, which allows it to skip around in the list of instructions — which makes it possible to do branches and loops in code.

You are viewing 1 out of 12 answers, click here to view all answers.