How does a computer program work?

Naduni Ranasinghe
2 min readJan 14, 2021

Everybody knows what a computer is. For your information, I’ll show what Wikipedia says about the computer.

“ A computer is a machine that can be instructed to carry out sequences of arithmetic or logical operations automatically through computer programming. Modern computers have the ability to follow generalized sets of operations, called programs. These programs enable computers to perform an extremely wide range of tasks.”

You may think now, a computer is nothing without computer programs. Absolutely it’s correct to think like that. A program is nothing but a magic wand that makes a computer usable. Actually, it’s not magic. Is all about some efforts of a human or a group of people who have tried to get some work done by a computer. In simple terms, even the most powerful computer is nothing more than an object without a program. Similarly, without a player, a guitar is nothing more than a wooden or metal box.

You may argue now, how come computers perform very complex tasks if they are just objects. This is what I really need to explain to you. The ability to perform any mathematical or logical task by a computer is not inborn or natural. It can execute only extremely simple operations which means a computer can not produce the value of a complicated mathematical function itself.

Let’s assume that we want to convert a temperature in Celsius into Kelvin. You only know the temperature in Celsius and you need the temperature in Kelvin. Do you think that the computer can give the kelvin value for the respective Celsius value?

Yes, of course, It does. But the computer does not have any idea about such things, temperature, Celsius or Kelvin. Therefore, it is necessary to instruct the computer to

  • Accept a number representing the temperature in Celsius.
  • Add 274.15 to that user input value
  • Display the result as the temperature in Kelvin and that result should be in a readable format.

Actually, this is far beyond what really happens inside the computer. Because the computer does not understand human language as it has its own machine language to work with.

Therefore, the programmers who write programs to the computer should be able to write those programs in a language that can be understood by computers. This is the reason why we need programming languages.

Even though the programs we write to the computer should be translated into a machine language where the computer only knows the zeroes and ones.

Read the next post about computer programming languages.

Until then, Happy Reading!

--

--

Naduni Ranasinghe

Lecturer at University of Indigenous Medicine| News Anchor — SLRC | Tech Enthusiast