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

591 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

There are several abstraction levels between a transistor and a computer.

You combine transistors to make simple logical devices like NOT, OR, XOR, AND.

You combine simple logical devices to create a bit more complicated devices like multiplexers.

You combine those devices to create even more complicated devices like ALUs.

You make a processor from ALU, memory and other parts.

You make a computer from processor, memory, disk memory, pipelines to connect it all and vola.

It may seem like the complexity is growing with each level, but the beautiful thing about abstraction is that from each level to the next the complexity of the design actually doesn’t increase. Why’s that? Because when you take a device from previous abstraction level you don’t need to concern yourself with it’s internal structure – you care just for input and output rules of that device. In this way one department can design simple logic devices, while another department can just take those and make the next level.

Anonymous 0 Comments

A transistor is basically a voltage controller switch. Depending on the voltage you apply to its gate terminal, it will either allow or prevent current from flowing between it’s source and drain terminals. This means we can use electrical signals to control the behaviour of other electrical devices. The signal that turns on a device is usually referred to as high or 1, while the signal that turns off a device is low or 0 or ground. Most importantly for our discussion here are logic gates and latch.

A logic gate is a configuration of transistors that performs a logic operation: NOT, AND, OR and XOR. A NOT gate takes a single signal and reverses it, turning a 1 into a 0 and visa versa. AND takes 2 inputs, and if they are both 1, it outputs a 1, otherwise it outputs 0. OR takes 2 inputs and if either of them are 1, it outputs 1, which a XOR (exclusive or) gate only outputs a 1 if only one of it’s 2 inputs is 1. From these, you can build what is referred to a combinatorial logic. Based entirely on the current input, the combination of logic gate will produce a consistent output. These kind of devices include multiplexers, encoders, decoders, and circuits that perform mathematical operations.

A latch is something more complex. The most basic design of a latch is when you feedback the output of a NOT gate into itself. This will result in the output of the NOT gate flipping back and forth between 0 and 1 as quickly as the internal transistors can charge and discharge. The current output of the latch is entirely depend of the previous state of the latch. If we put two NOT gates in sequence, and feedback the output of the second to the input of the first, you get a device that will maintain it’s output value until it is acted on by an external device. This is a fairly basic kind of memory. Add a bit more circuitry to control when and how the stored value gets changed, and you get a register, the most basic kind of memory used in your CPU. There is generally a clock pulse used to synchronize all the devices in a system. Any kind of system that has a feedback loop in it is sequential logic.

Ok, now we have enough knowledge to explain finite state machines. Finite state machines are made of two parts: a memory and the control logic. The memory stores which state you are currently in. The control logic decides which state you should go to next based on the current input and the current state, and also produces the output of the machine. Lets say that we want to design a machine that outputs 1 if the last 2 input are the different. It’s control logic would need to implement the following table:

| State | Input | Output | Next State |
|——-|——–|——–|————|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 1 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 1 |

As logic functions:

Output = State XOR Input

Next State = Input

Now this is a trivial example but at it’s heart the CPU operates in fundamentally the same way. It has a table like this that describes how each operation it can perform is done, and the outputs are connected to each individual device to enable or disable them as needed. The input that the CPU sees come from instructions in memory and one of the devices that the CPU controls is the “program counter”, which stores the address in memory for the current instruction.