In our last publication, we talked about the basics of computers and CPU, where we saw that information inputted into computers has to follow certain instructions or algorithms in order to produce the desired output.
It turns out that those instructions that the computer has to follow are what we call “Computer Program or software.”
What does it really mean? Well, it is what we are going to learn in this post.
Computer Science pioneers in a way to make humans and machines getting into harmony or to communicate, they came up with a way to talk to computers, to give computer instructions through his language or computer program. It is a list of instructions given to the computer to follow in order to produce the desired output. It is like a cookbook for a chef that contains a list of instructions on how to make for instance a cake.
Those who learned or knew to write those instructions or creating those computer programs are programmers or developers.
In order for a machine to understand, it has to be in a computer’s language, which is BINARY (0’s and 1’s).
However, we as programmers are not writing those instructions in binary; we write it in what we call computer-programming language.
Then, why aren’t we writing in binary? Let us deep in a binary little bit.
In order to decode the above binary number, we will go through steps.
1st step: we give each number a count order starting from right to left.
1 0 1 1 0 1 1 0 => binary
7 6 5 4 3 2 1 0 => order count from right to left
2nd step: is to take each count order to the power of 2 and calculate them
72 62 52 42 32 22 12 02 => order has been taken to the power of 2
128 64 32 16 8 4 2 1 => we calculate the power
3rd step: we take out all values of zero’s (0) then we add the remaining numbers to each other.
128 + 32 + 16 + 4 + 2 = 182
So, the binary 10110110 = 182 decimal.
That is how 182 can be represented in the CPU. If you think of it as circuits, that binary number is: On-off-on-on-off-on-on-off
Let us take for instance my name Alex in binary
A = 0110111
l = 1101100
e = 1100101
x = 1111000
In one line: Alex = 0110111 1101100 1100 101 1111000
As you can see, as humans, we cannot write a complex software or program with binary, because it will take time and a lot of effort even impossible. The reason why computer scientists created programming languages.
Programming Language is a formal comprising a set of instructions that produce various kinds of output.
All depend on what you want to achieve as output.
If you want to create a game or a gaming program, you need the language that is best for the game; If you want to create a website or program for the web, you need languages that are best for the websites; If you want to create any software or application, you need specific programming language for that software.
Here is a list of few popular programming languages:
- Python Language
- C / C++ / C# Language
- Ruby Language
- Java Language
- PHP Language, etc.
Without software or program, the computer is useless and is like all other toys for children to play with.
Then how does the program we wrote could be converted to binary for a computer to understand?
Well, when a programmer finishes to program, he/she has to run or to execute that program for production to become a software. During that time, it has to go through a process of conversion that we call “Compiling” or “Interpreting” to become an executable product, who is machine code or binary code that the CPU can follow to produce the desired output.
Let us take a known example to illustrate a computer program. We take for instance a cashier software or POS (point of sale). A cashier software needs first input before processing and output information. That input is when the cashier scans the barcode of your product or type in the price or the barcode. For the CPU to proceed, it needs instructions from the memory on how to deal with that kind of input. That instruction is a computer program or cashier software. You can read on how a computer works in my previous post.
In conclusion, we talked about the computer program by demonstrating how binary is decoded and that is the reason why we are not writing programs in binary numbers but we use programming languages to develop our software. We finished by seeing an example of a software or computer program on the post of sale that cashier uses.
Thanks for reading.
By Alexis Ange Dauli, Web Developer.