top of page

HOW DO COMPUTERS WORK?

Since the beginning of humanity, people have used machines in order to help them with physical tasks. However, one of the main things they have always wanted to do was to build a machine able to help them with intellectual tasks. Therefore, in the 19th century, such a machine was built and was called a computer!

How do computers work ?: About

WHAT EXACTLY IS A COMPUTER?

In etymological terms, a computer is something that calculates, and it is exactly what it does. Though we are able to do more complex things than calculations on a computer, it all comes down to simple calculations that a human could do.
So, you might be wondering, why couldn’t humans do those calculations by themselves? Well, that’s because computers go way faster than the human brain.

How do computers work ?: About

HOW DOES IT WORK?

A computer does 4 things: input, store, process and output. Everything that happens due to a computer is linked to those 4 simple things.


Imagine you are asking a question to a friend:


Firstly, you ask your question. This is called to input in computering. Basically, you are typing on your keyboard or using a mouse or even connecting a webcam to your computer in order to get a response.


Then, before even responding to you, your friend has to save, in his mind, the information you are giving him. In a computer, this is to store. Basically, a computer stores something in its memory. We will explain later how a memory works.


Thirdly, your friend now has to think about what you just told him and find an answer. This is the moment when the computer processes the information. This happens in the CPU (central processing unit), which is like the brain of the computer (we will detail its functioning later). 


Finally, your friend has to tell you what the answer he found is! Here, the computer is outputting its information using your screen or your speakers; or any other output device.

How do computers work ?: About

WHAT IS A COMPUTER MADE OUT OF ?

            Now that we have simply defined what a computer does, lets define with what a computer can do those actions. Well, if we divide in two entities a computer, we can say it is made out of software and hardware.


On the one hand, hardware are all the physical elements on your computer. It is the machine you are using. It is made out of things that we talked about earlier such as a mouse, a keyboard or a webcam. If we compare this to a human being, it would be our body. Most of the hardware in a computer is set into what we call a motherboard. Every smaller item of hardware is located on the mother board.


Software, on the other hand, is something that you cannot see. A program is software. This is like a human being’s thoughts and feelings.


In order for anything to happen in a computer, both hardware and software are used (note that most of the time, software is contained in hardware like your thoughts are contained in your body).

How do computers work ?: About

STEP BY STEP EXPLANATION

Now, lets explain precisely how each of the 4 mechanism we talked about earlier work and how and when they interact with both hardware and software. 


However, before talking about the different stages, we have to talk about the CPU (central processing unit). In terms of software, the CPU is the brain of a computer and nothing could happen without it. Therefore, for each stage from input to output, the CPU controls what is happening. However, like an orchestra leader, the control unit does not execute program instructions; rather, it directs other parts of the system to do so and it oversees every operation.




In terms of hardware, the CPU is an assembling of circuitry that uses electrical signals to direct the entire computer. It is made out of an arithmetic unit (processes the information), a control unit and a memory unit (stores data) among other things. The control unit oversees everything and orchestrates the communication between components through the use of buses (cables) which make electrical signal flow and allow the transfer of data. 

Moreover, it controls the rhythm at which actions are being made in the computer through its internal clock which produces pulses at a fixed rate to synchronize all computer operations. This is set up in order for the computer to have time to execute every information it is given. Indeed, if the clock tells the CPU to execute instructions too quickly, the processing will not be completed before the next instruction is carried out. Therefore, a well-timed clock is key.



Now let’s go on to explain in details the step by step process a computer goes through! 


In order to give a concrete example for each stage of actions that the computer goes through to make information go from input to output, we decided to take a simple operation such as 2+2 as an example.

Capture d’écran 2019-01-27 à 14.51.33.pn
How do computers work ?: About

HOW DOES INFORMATION GO FROM IMPORT TO STORAGE ?

The first stage of what a computer does is going from input to storage. For this to happen, someone has to input the information he wants to be answered. In the case of 2+2, he does so by writing it on a keyboard.

By writing it on a keyboard, the information is directly converted in a language the computer can understand (as is shown in the diagram below). This language is binary code. It is a series of 1s and 0s that are in the form of electrical signals.

COMP.PNG
How do computers work ?: About

What is binary ?

In modern days, countries use Arabic numbers which are a way of counting that uses base 10. Binary, contrarily to Arabic numbers, uses a base 2. This means that when you have a 4 in Arabic numbers, you have a 100 in binary.

Here is a table of a few numbers converted to binary:

BINARY.PNG
How do computers work ?: About

In a computer, each key has a binary number associated to it. For example, the letter T is represented by the number 01010100. Computers can understand binary because binary is simply a succession of electrical impulses to which it has pre-associated values (such as the letter T and 01010100). The coding of the letters on the keyboard is called an 8 bit (binary digits) coding, as it uses 8 digits to represent 1 key. This provides 2 different possibilities; enough for all things on a keyboard. However, you might be wondering how a computer goes from an electrical signal (continual flow) to a series of numbers.

How do computers work ?: About

Digitization

This conversion of information into a digital format happens due to a process named digitization. This is done by transforming an analogue signal into a digital signal. This makes the information lose precision (because an analogue signal is continuous and therefore has an infinity of representations) but it allows us to store the information.

ANALOGUE.PNG
How do computers work ?: About

So, in a computer, electrical signals which are analogue signals are converted through the analogue to digital converter (ADC). In the case of the electrical signal sent by the keyboard, the precision is not important. Indeed, what happens is that to determine whether a signal will be converted into a 1 or a 0, the converter compares whether the electrical potential it has received is above or below the average of the potentials for the lowest and the highest values of the potentials. If it is above the average, the signal is converted to a 1 in binary. Contrarily, if it is beneath the average, the signal is converted to a 0.

If this all sounds confusing to you, here is a diagram of an ADC converter, and a table of the possible outputs it can give:

TPE.PNG
How do computers work ?: About

V represents the value that is being put in; in our case, the electrical signal. 3V/4, V/2 and V/4 are the average potentials the comparators are given to compare with V ; these are set values. The triangles are the comparators and the 2 and 2 are the representations of the two possible outputs it can give in binary.

After this explanation of binary code and digitization, lets continue the process of how information goes from input to storage.

After the information is sent, the CPU has to be alerted that someone (in this case, the keyboard) wants his attention. He will then interrupt what he is doing in order to listen to the 

keyboard and do what has been told to him. This is orchestrated by the PIC (programmable interruption controller). Though this might not seem important, it is key to the functioning of the computer. Indeed, interruptions are what allows you to have various tasks running at the same time on your computer.

Therefore, when the keyboard wants to interact with the computer it has to send a signal to the PIC. The PIC then sends the information to the CPU when he is “asked” to by it. Here “asked” means that the CPU, after having received an electrical signal from the PIC that the keyboard wants to communicate, has sent back an electrical signal saying that he had time for the information to be sent.

After the interruption has been dealt with by the CPU, the data will be sent to primary storage.

How do computers work ?: About

What is storage ?

Storage in a computer is the same thing as storage in real life; it is how things are stored that varies. Indeed, as we said before, in a computer, the information is converted to binary code; therefore, it has to be stored as such. However, though it is stored in binary code, the way the code is written is not always the same within different areas of the computer.

Indeed, computers use two types of storage: the primary storage (also called memory) and the secondary storage. A computer's memory holds data only temporarily (it is called volatile), at the time the computer is executing a program. On the contrary, secondary storage holds permanent or semi-permanent data (non-volatile).

In terms of the primary storage, every electrical signal will be written in the memory in what we call a memory cell. The memory cell is principally composed of a transistor and a capacitor.

A transistor is an electrical component that acts as a switch. Because it functions as such, it allows us to code information in binary code; indeed, 1s and 0s can also be seen as ON and OFF signals but also as current flowing and current not flowing.

Transistors are made out of silicon, which are semi-conductors. When assembled together, each silicon atom forms covalent bonds with 4 neighboring silicon atoms as it has four electrons in its valence shell. In this state, silicon conducts extremely badly as no electron is free to move. Therefore, in order to improve conductivity (and make silicon a semi-conductor), a technique called doping (injection of foreign material to enhance the performance) is used. Two types of doping exist: n-type and p-type. N-type doping is the injection of a group V atom into the system of silicon atoms. As the new atom contains 5 valence electrons, 1 electron will be free to move in the system. Therefore, the system will be negative overall, hence the nomination of N-type doping.

P- type doping, on the other hand, it the injection of a group III atom into the system. Given that the new atom only has 3 valence electrons, it will only bond with 3 silicon atoms and therefore will create a vacant position for electrons called a hole. However, though there are very little there still are free electrons in this type of doping. The system is positive overall.

doped_silicon.png
How do computers work ?: About

Now that we have defined what N-type and P-type doping are, we can explain how transistors are made. Basically, a transistor is made of a sequence of either N P N or P N P doped silicon systems.

Capture d’écran 2019-01-31 à 18.00.49.pn
How do computers work ?: About

The boundary between N and P will become slightly positive on the N-side and slightly negative on the P-side due to the fact that free electrons from the N-side will go in the holes of the P-side; this is called a depletion layer. In order to overcome this layer, a barrier potential of 0,7 V has to be overcome.

Capture d’écran 2019-01-31 à 17.57.11.pn
How do computers work ?: About

In order to have a flow of electron in this NPN or PNP set up, it is necessary to plug in a capacitor. A capacitor is an assembling of two metal plates around an insulator, which due to the fact that one stores electrons and the other doesn’t, have an electric field between them.

COMPU.PNG
How do computers work ?: About

If the power is strong, a strong electric field will be created between the two conductive plates of the capacitor when it is plugged into the transistor, due to the fact that when plugged to a power source, electrons will leave a metal plate and go to the other one. The electrons put in the P-type region due to this will be attracted to the positive metal plate of the capacitor, creating a surplus of electrons in this region and therefore forming a new depletion layer. This allows current to flow between the two N-type doped regions. As there is electric current flowing, this is the ON state, represented as a 1 in binary code.
However, if the applied voltage is not sufficient, the electric field between the two conductive plates will be weak and there won’t be a channel formation and hence no electron flow. This is the OFF state, represented by a 0 in binary code. Each memory cell is able to store 1 bit of data.

NPNPNP.PNG
How do computers work ?: About

In the computer, the hardware representing primary storage is the RAM, it is composed of millions of memory cells that each store 1 bit (binary digit). The memory cells are arranged in a grid, in order to reduce to amount of wire required. Indeed, in order to get information in or out of a memory cell, 2 wires are required. This might not seem like a lot, but when you have millions of memory cells, it is a lot! Therefore, organization in a grid allows us to save a lot of wires. When information is written or taken out of a memory cell, electricity in both the row and the column have to be switched on. Subsequently, the information is given an address, corresponding to the crossroad of its column and its row. You can think of this as in a city where you might live at the crossroads of 14th avenue and 8th street; that’s an address that defines and intersection. For information to be accessed, a multiplexer is required. It is the device that, when given an address, converts the information it has received to select a row and a column.

Here is an example, of the wires where electricity would flow if the data required was on the 8th column and 3rd row in a 16 x 16 grid:

Capture ecran.PNG
How do computers work ?: About

On the other hand, we have secondary storage. We will not go into details concerning this type of storage as it does not act in most processes of input to output and merely acts when there is a need for keeping information for a long time (such as documents on a computer). In terms of hardware, secondary storage is mainly represented by the hard drive. All that is needed to know is that bits are not engraved the same way in this software. Indeed, flat circular non- magnetic disks called platers coated with a layer of magnetic material hold the recorded data. What happens is that tiny grains of the magnetic substance form groups in which data is stored. In each group, all of the grains have their magnetization aligned in one of two possible states which correspond to 0s and 1s. Data is written on to a disk using an electro magnet strong enough to change the direction of the metal grain’s magnetization due to the field it creates.

Remember, before this section about storage, we said that the CPU had interrupted itself to hear out what the keyboard had to say. Well, it still is in ‘interruption mode’ due to the fact that it has not processed the information yet. This leads us to how the information goes from memory to processing.

How do computers work ?: About

HOW DOES INFORMATION GO FROM STORAGE TO PROCESSING ?

As we said before, the CPU is the component of the computer that controls every other component. Therefore, the first thing that happens for information to go from storage to processing is that the control unit fetches (gets) the instruction from memory. To do so, it has to read the information that was stored in memory. To read information, the computer has to send an address through the multiplexer in order for both wires that determine where a bit of memory is stored to get activated. Then, a logic one voltage will be driven into the transistor which will make it conductive, thus allowing it to pass the charge it has stored to the capacitor which then sends it along the same wire through which the information was encoded.

Then, the control unit decodes the instruction (decides what it means) as he knows what each series of binary digits translate to. He subsequently directs that the necessary data be moved from memory to the arithmetic/logic unit (ALU). These first two steps together are called instruction time, or I-time.

Then, the arithmetic/logic unit executes the arithmetic or logical instruction. That is, the ALU is given control and performs the actual operation on the data.

How do computers work ?: About

What is an ALU ?

The arithmetic/logic unit (ALU) contains the electronic circuitry that executes all arithmetic and logical operations. It can perform many kinds of arithmetic operations. To perform operations, the ALU sends the information that has to be processed to what is called a logic gate. Remember how we said that there was a component called a transistor in a memory cell. Well, logic gates are simply an assembling of transistors that due to their special arrangement allow for various results to come out after information has been put in. There are 7 logic gates in total; however, they can be assembled together to create bigger systems, that give out even more complex results.

For example, here is a gate that is called the ‘and’ gate and what it gives out when A and B are inputted in the form of binary digits.

pc.PNG
How do computers work ?: About

However, the ALU, as its name implies, also performs logical operations (which is usually a comparison). The unit can compare numbers, letters, or special characters. This is a very important capability. It is by comparing that a computer is able to tell, for instance, whether there are unfilled seats on airplanes or whether charge-card customers have exceeded their credit limits. Logical operations can test for three conditions: Equal-to condition, Less-than condition, Greater-than condition also through the use of logic gates.

Now that we have explained what the ALU does, let’s go on to our final step.

Finally, the arithmetic/logic unit stores the result of this operation in memory or in a register by writing it as we saw before. Steps 3 and 4 together are called execution time, or E-time. The combination of I-time and E-time is called the machine cycle.

Here is an illustration of a machine cycle:

unnamed.jpg
How do computers work ?: About

What is a register ?

Registers are temporary storage areas for instructions or data; they are used and prioritized during this process over the RAM as they are faster. Registers work under the direction of the control unit to accept, hold, and transfer instructions or data. The control unit uses a data storage register the way a store owner uses a cash register-as a temporary, convenient place to store what is used in transactions.

Registers are often assigned four basic roles: accumulator (collects the result of computations), address register, which keeps track of where a given instruction or piece of data is stored in memory, storage register, which temporarily holds data taken from or about to be sent to memory, general-purpose register, which is used for several functions.

To see how registers, memory, and second storage all work together, lets use the analogy of making a salad. In our kitchen we have: a refrigerator, a counter, a cutting board, a recipe, the corners of the cutting board and a bowl.

The refrigerator is the equivalent of secondary (disk) storage. It can store high volumes of veggies for long periods of time. The counter top is the equivalent of the computer's motherboard - everything is done on the counter (inside the computer). The cutting board is the ALU - the work gets done there. The recipe is the control unit - it tells you what to do on the cutting board (ALU). Space on the counter top is the equivalent of RAM memory - all veggies must be brought from the fridge and placed on the counter top for fast access. The corners of the cutting board where we temporarily store partially chopped veggies are equivalent to the registers. The corners of the cutting board are very fast to access for chopping, but can not hold much. The salad bowl is like a temporary register, it is for storing the salad waiting to take back to the fridge or for taking to the dinner table.


At the end, the result of process goes back to memory. In the case of 2+2, the information will now be stored as 4.

How do computers work ?: About

HOW DOES INFORMATION GO FROM PROCESSING TO OUTPUT ?

Finally, the control unit directs memory to release the result to the graphic processing unit (GPU). The graphic card (sort of processor dedicated to graphic calculations) thus converts digital data to graphic data and sends the information to the screen (in the case of our 2+2 operation) or to any other output devices (ex: speakers).

A screen is made out of millions of tiny squares (called pixels) that can be switched to produce red, blue, or green light. All these squares put together make up images visible by a human. To decide which pixel will be switched on a certain color, the graphic card comes in. It uses what is called a bitmap. Basically, it has a map of all the pixels on your screen, and to each pixel, it associates a color. Remember at the beginning how we said that to each character on the keyboard was associated a sequence of binary digits; well, the same thing happens for colors: to each color is associated a binary digit. Therefore, in the bitmap, each pixel is given a number that represents a color.

The graphics card decides how to use the pixels on the screen to create the image. It then sends that information to the monitor through a cable.

Here is an excel to illustrate how when you associate a binary digit to a color, you can then associate to each pixel (square on excel) a color and thus make multiple shapes:

PACMAN.PNG
How do computers work ?: About

Finally, everything is ended when the CPU sends an instruction to come back to normal procedures.

How do computers work ?: About

DIAGRAM

Now you know how a computer works!! Here is a small diagram that sums up the basic actions a computer does:

unnamed.jpg
How do computers work ?: About

CONCLUSION

Computers have allowed countless progress in many fields and will keep on doing so due to the multitude of tasks they allow us to do. Though there is still optimization to be done in many aspects of computering, this process has enabled countless discoveries and will continue to do so.

How do computers work ?: About

BIBLIOGRAPHY

https://lestutosdelinternet.com/2016/02/16/cours-danatomie-de-lordinateur/ https://www.bbc.com/bitesize/guides/zmb9mp3/revision/2 https://www.youtube.com/watch?v=fpnE6UAfbtU https://www.irif.fr/~carton/Enseignement/Architecture/Cours/Gates/ https://en.wikipedia.org/wiki/Memory_cell_(computing) https://homepage.cs.uri.edu/faculty/wolfe/book/Readings/Reading04.htm https://computer.howstuffworks.com/graphics-card.htm https://fr.wikipedia.org/wiki/Processeur https://www.supinfo.com/cours/1CPA/chapitres/09-assembleur-x86 https://www.youtube.com/watch?v=stM8dgcY1CA https://www.youtube.com/watch?v=FZGugFqdr60

How do computers work ?: About

©2018 by Alan Turing and his impact on WWII. Proudly created with Wix.com

bottom of page