How do processors work? How are a bunch of transistors able to make logical decisions?

976 views

How do processors work? How are a bunch of transistors able to make logical decisions?

In: Engineering

9 Answers

Anonymous 0 Comments

Transistors act like switches (transistor literally means trans-resistor, i.e. a resistor you can control, effectively controlling if the current flows or not). Switches are the easiest component to implement a logic function. Think about it: link two switches together and you have an AND gate, i.e. something that is on only if both switches are closed. Link two switches in parallel and you have an OR gate, i.e. something that is on when at least one switch is on. With this reasoning and some algorithms you can create every logic function you need.

Now processors are a lot more complex, they are made of many smaller components called buses, but the most important ones are two: the ALU and the cache memory.

ALUs are basically a big bundle of logic functions, you can add two inputs, you can compare them and many other things.

Cache memories are extremely fast but very expensive memories, made with groups of transistors called flip-flops (which are called flip-flop because the first ones made this sound, fun fact) which the processor uses to elaborate all the data you ask, by using an address system to understand what piece of memory its being used.

Basically you the programmer use a very simple language called Assembly to tell the computer exactly what to physically do when, for example, someone uses an add function.

I know it sounds confusing so I’ll make an example to help you understand: you want to make a program that sums whatever two numbers are written by the user, so you tell the processor to take the numbers from the cache memory (where they are stored once you input them, there’s a bus in the processor whose job is to interpret the user interface input, i.e. your keyboard, your monitor etc.), send them to the ALU and tell the ALU to add whatever you sent and send you back the result, which is stored in another cell of the cache and sent back to your monitor.

I simplified a lot and cut many things, but if you’re interested I can go on forever, this is what I do for a living 🙂

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