Click here to Skip to main content
15,885,435 members
Articles
(untagged)

What is Software

Rate me:
Please Sign up or sign in to vote.
4.60/5 (3 votes)
10 Aug 2016CPOL16 min read 13K   3   10
Many times, you have heard the word "software"; can you describe it?

I am not an ichthyologist (someone who studies fish); so, if you ask me what a fish is, I would probably say it is something that swims in the ocean and can be fried and consumed once caught. Well, technically, dolphins are not fish, and, technically, the definition still holds because I have not seen anyone try to fry and eat dolphins. But, the fish scientist may, perhaps, be inclined to write volumes about the nature of fish if requested to describe her subject of study. All this talk about fish in the frying pan is already starting to work an appetite even on me, so before losing you to your thoughts about your next meal, allow me to kindle your curiosity about software: What is software?

The usual response to this question is that it is a set of instructions. But … really? You call “software” the instructions on your cookbook too? I am of the conviction that software cannot be described in a sentence or two. But, if you are inquiring why it is even important to have a dictionary definition of the word “software”, look no farther than your smart phone. Smart phones are different than regular phones for the reason that they run complex software applications. Without software, your so-smart cell phone amounts to nothing more than a brick. I know this from the experience of when I bricked a smart phone trying to install the Android OS. Had I read the functionality provisions of the software package and compared them to the specification of the phone, perhaps, I would have achieved a different outcome. The informed customer is a smart customer. But, as it is impossible to describe software or its requirements without mentioning words such as memory capacity and processor speed, demystifying the world of computers demands a clear understanding of the keywords software, hardware, memory, processor, IO, and so on.

Flintstone Goes Digital

Fred is in the metal cutting business. He serves the residents of Flintstone by flattening metal sheets with a hammer and cutting through them with a pair of shears. The hammer and the pair of shears are fine tools that has been in use for a long time, however, Wilma realizes a better tool for the job would be a machine that does the cutting and shaping of the pieces from a large sheet of metal. But, this machine is able to produce only one shape. For three different shapes, they need to have three of such machines. Husband and wife put their heads together to take parts from the three machines and assemble a new machine. The machine now has three buttons and each button is made to turn the machine to produce a different shape of metal. Although majorly improved over the previous one, a drawback to this setting is that an operator should be attending at the site to switch the buttons of the machine in accordance to the desired shapes. Henceforth is where software comes into play. Fred and Wilma enlist the help of a computer engineer who studies at the local college. He can render their machine capable of accepting instructions in a batch, automatically switching buttons to produce metal shapes according to the given instructions. Then, all that the couple would have to do is communicate instructions to the machine of their wishes and desires as far as shapes of metal is concerned. In this case, the program or software is eliminating the need for a human operator by automating the procedure. Moreover, whereas before they had to have a different machine for each shape, now they can instruct a single machine to produce three different shapes.

The “moral” of the story is that although computers are much faster and more precise, they cannot do what humans are not able given enough time and resources. Evidently, in the story, Fred and Wilma were doing fine without a computer. The other take home lesson is that hardware alone may be configured into a state where it can perform something, but software comes in to reconfigure the hardware to a different state to produce other things. And, the limit to what can be achieved by the combination of software and hardware is bounded by imagination only. This is the essence of software.

Instructing Your Machine

A programmable machine would perform its tasks exactly as instructed. Even if it malfunctions, the assumption is that something must be broken and the machine would be expected to go back to the blind following of instructions after a fix is made. If the instruction was erroneous or in computer parlance “buggy”, the machine is still expected to follow instructions verbatim as it lacks the common sense or judgment that the human mind is endowed with. A machine is not able to make judgments unless of-course judgment or artificial intelligence is programmed into it. But, even artificial intelligence is a simulation of real intelligence achieved by playing tricks. So, the situation of programming a machine can be analogous to teaching arithmetic operations to a child for the first time. Suppose this child can follow your instructions on how to add, subtract, multiply, or divide two numbers but cannot make decisions based on judgment, this child will continue to perform operations on numbers either rightly or wrongly totally dependent on the teaching. If taught correctly, you can leave this child to calculate the percentage of income to tax while you tend to other aspects of your accounting business.

Programming on a computer might be similar to teaching that child, but unlike the child, the computer was not raised learning English as its mother tongue. You can only communicate to your computer using a programming language. Once programmed, it can be relied upon allowing you for time to sit back and relax knowing that your computer will diligently accomplish what it is programmed to do in the confines of its limitations. In actuality, except for the fact of reconfiguration, programming or writing a piece of software does not add new functionality to a machine. Any combination of hardware and software, for example, is not able to produce video and audio without a display device and a speaker. But, software can help in making selections of playing or not playing video and audio and give a menu for the selection of various sources of video and audio (files) conditional the proper combination of hardware and software is made available.

The question of what suitable language we can use to program the computer should take precedence in our next discussion. In computing, the meaning of words that a machine can understand is arbitrary and left to be decided by the designer of the machine. A machine has only two words in its vocabulary: on and off. It can be made to interpret electric current flow at its switches as on and no flow as off or vice-versa. Electrical voltage can also be used to signal the state of on or off. Worthwhile to note that the switches and actuators of the machine can be electrically decoupled in a sense that they can be powered by different lines of electrical power supply. In short, no current flow at the switches might not necessarily mean no power for the actuators. Bearing this in mind, we can see how a programmable low-voltage device is able to control a large and heavy machine.

Now, still on the topic of programming languages, suppose the metal shaping machine can produce square, triangular, and round shapes. To control mode of operation, the machine has three switches. The switches are labeled as B1, B2, and B3. If B1 is switched on, the machine will shape the metal into a square; if B2 into a triangle; and B3 into a circle. As our machine of short words (two to be exact) does not understand any of our languages, our first job is to find a suitable representation of the machine's state of being turned on or off that we can understand. As disagreeable as we might be, fortunately, we have agreed on the representation of the state of being turned on by a 1 and that of turned off by 0. If the machine is instructed to 1 switch B1, 0 switch B2, and 0 switch B3, it will know to turn off switches B2 and B3 and turn on switch B1. This particular combination of the state of the switches instructs the machine to be in a mode of production for a square shaped metal.

   B1      B2      B3     switch buttons
   1       0       0      mode for square production
   0       0       1      mode for circle production
   0       1       0      mode for triangle production

It really does boil down to zero's and one's as alluded in one of my favorite sitcoms “King of Queens”.

Bits and Bytes of Binary Digits

They were wrong if they told you that you can only count in decimal digits. The Arabs, probably, took note of our ten fingers to come up with a number system of base 10 or so called decimal. The Babylonians came up with the base 60 counting system that we use to measure time. You can also count in binary, octal, hexadecimal, or any other number system. In the decimal system of numbering, you can work with ten digits, 0-9. We will overrun our digits when we reach 9, and to get the number that is 1 more than a number whose last digit is 9 (like 129), we replace the 9 in the last digit with a 0 and add 1 to the digit on the right (130 is one more than 129). In contrast, the only two digits of binary numbering are 0 and 1, and, as a result, we will overrun our digits more frequently. Take a close look at the following numbers and understand the pattern as these numbers are represented by their decimal (base 10), binary (base 2) and hexadecimal (base 16). See that “A” in hexadecimal represents 10 in decimal, hexadecimal “B” represents decimal 11, and so on. Remember hexadecimal numbering with 16 digits of {0-9, A, B, C, D, E F} goes beyond the 10 digits of decimal numbering.

Decimal        Binary          Hexadecimal
   0           0000 0000           0 0
   1           0000 0001           0 1
   2           0000 0010           0 2
   3           0000 0011           0 3
   4           0000 0100           0 4
   5           0000 0101           0 5
   6           0000 0110           0 6
   7           0000 0111           0 7
   8           0000 1000           0 8
   9           0000 1001           0 9
  10           0000 1010           0 A
  11           0000 1011           0 B
  12           0000 1100           0 C
  13           0000 1101           0 D
  14           0000 1110           0 E
  15           0000 1111           0 F
  16           0001 0000           1 0

Wilma’s and Fred’s metal shaping machine is able to take in instructions in a batch. Suppose the couple get an order for 5 squares, 2 triangles, and 3 circles. The batch of instructions would look something like the following:

Line #   B1     B2     B3     Assembly      Binary    Decimal

  1      0      0      1      _circle         001        1
  2      0      0      1      _circle         001        1
  3      0      0      1      _circle         001        1
  4      0      1      0      _triangle       010        2
  5      0      1      0      _triangle       010        2
  6      1      0      0      _square         100        4
  7      1      0      0      _square         100        4
  8      1      0      0      _square         100        4
  9      1      0      0      _square         100        4
 10      1      0      0      _square         100        4

This machine should be made to remember; it must have memory. Otherwise, it would only be able to accept the last instruction, that is Line 10. Fortunately, the machine has something called a memory element that can latch in the value of 0 or 1 until it is replaced by another 0 or 1. In computing lingo, that memory element is known as a bit – short for binary digit. You can see from the table above that the tags of state for switches B1B2B3 (001, 010, 100) can fully and unambiguously determine the three modes. In fact, it suffices to have two bits to represent three states, but that would be a story for another day. The binary number of three digits mirrors the states of B1B2B3 and that binary number is translated into the equivalent decimal number for human consumption. Instructing the machine with a decimal number 4 would, consequently, be synonymous to inputting binary 100 which the machine interprets it as an instruction to make a square. Those binaries that the machine is able to understand are called machine code. Who knew mathematics was the language of the inanimate! It can be said that this machine has a word of length 3 bits because one instruction is 3 bits long. We find computer systems of 8, 16, 32, 64 bit words in existence today.

However, it is not possible to tag all the things in the world with just 3 bits. You can only have 7 combinations of 3 bits. But, with 8 bits, “yes, we can” describe the whole world. That magical length of 8 bits is known as a byte. With 8 bits it is possible to have 127 combinations which is more than enough to represent all of the alphanumeric characters and special characters such as punctuation marks and the symbols of arithmetic operations. By comparison, Shakespearean literature can be revised with only 26 letters of the alphabet. The binary and hexadecimal representations in the table are formatted as a byte with 8 digits in the binary and 2 digits in the hexadecimal. The importance of hexadecimal numbering to computing lies here. It is a compact form of the binary equivalent in the byte. The leftmost digit in the hexadecimal mirrors the four leftmost digits of the binary, and the rightmost digit in the hexadecimal mirrors the four rightmost digits in the binary. For example, binary 0101 1001 is hexadecimal 59 and binary 1001 0111 is hexadecimal 97. You can see that rightmost 1001 of the binary in the first example is mapped to the rightmost 9 of the hexadecimal and the leftmost 9 of the hexadecimal in the second example is mapped directly to the 1001 of the binary (four left most digits). The byte plays an important role in memory management. Amount of memory is measured in bytes and, most of the time, memory is byte addressable which just means that the memory space can be assigned an address for each byte (and not bit). Nowadays, some memory devices measure in the giga and tera bytes – billions upon billions.

Instruction and data can be committed to memory either on a Random Access Memory (RAM) or Read Only Memory (ROM). Data and instructions are many times written to and read from memory during normal processing operations. The RAM is suitable for this access, but, all memory in the RAM gets lost when the computer is turned off as there is no source of voltage to maintain the state of the bit. Therefore, some of the instructions for start-up (booting) are stored in the ROM and are activated as soon as power gets restored in the system. Information in the ROM is permanent as long as nothing gets written over it (read only). Besides the classification of ROM and RAM, much like a map of a place on earth, the RAM and ROM memory space can be mapped (or zoned in municipality parlance) for specified uses.

Both RAM and ROM constitute what is known as primary storage. Information that is to be kept in between power cycles should be put in the secondary storage. Examples of secondary storage include the hard drive, CDs, flash drive and so on. Data is loaded from secondary storage to be used in the primary storage. Primary storage is much faster than secondary storage in providing data to the central processor.

Assembly and Higher-level Languages

Software and hardware are on different levels. No one can argue on this statement as vague as it is. But, all this means is that we can conceptualize hardware as being the infrastructure that software can be built upon. We say that software is at a higher level than hardware.

Drawing yet more illustrations from our lovely couple's machine, the interpretation of the machine code words of 0s and 1s is the domain of the maker of the machine to decide. The instructions that drive the actuators to bend and cut metal could as well have been implemented on devices that read from a hard drive and displayed an image on a screen (like your regular laptop). The software would not know the difference of whether it is supposed to instruct a machine that cut shapes or a personal computer that drew the shapes. Since we have already established that software and hardware are on different levels, we will also claim that they can be developed independent of each other. At the end, what we have to do is create some sort of interface between the two.

Development efforts on software as well as hardware are further subdivided into more layers. With this kind of layering, developers can concentrate on the concerns relevant to their assigned layer, trusting the concerns in the other layers will be taken care by someone working on those layers and that the layers will be able to interface. To support this idea of development in layers, programming languages are hierarchically ordered from low to high level (you need the right tool for the job). You can compliment a programmer by the low level skills demonstrated (it would not be insulting). Considering human languages as high level, machine code would be found at the bottom low level. As it is hard for us to learn to speak machine language of 0s and 1s, we use something called assembly language at a level higher than machine code. Note the assembly instructions _square, _circle, and _triangle (the underscore in front is added to make them look like real assembly code).

Life is easy for Fred and Wilma considering the complexity of assembly code that programmers have to deal with from time to time. A typical assembly code would look something like:

ASM
mov    di,num2+digits-1
mov    si,num1+digits-1
mov    cx,digits
call    AddNumbers    ; num1 += num2

This internet copy-pasted snippet of assembly code is pretty unyielding to attempt to decipher. Take my word when I tell you all it is trying to do is add two numbers. Well, in a higher level language we could just say:

ASM
add num2 to num1

and have the statement translated into machine language.

The translation of program from higher level language to machine code is done via a program known as the compiler. As you can see, the one line of higher level language code was translated as four lines of assembly code (other instructions could have gotten more or less than four assembly instructions). But, the translation between assembly code and machine code is direct or verbatim.

Looking at the assembly code here, AddNumbers, num1, and num2 are called symbols. The compiler writes the assembly code by creating the symbols from the elements of the higher level language. A symbol indicates a specific addresses of instruction or data memory. It is just a handle to access an instruction or datum. After the compiler has completed translation, the assembler would then kick in converting the assembly code into object files of the machine code. The opposite procedure of converting object files into assembly code is called disassembly. This is useful in reverse engineering and debugging, but you will need the original symbol table to accomplish this task. Finally, a linker comes into play putting together the object files into executable files. Someone's purpose in life is to come up with an efficient, yet easy to understand, higher level language. For example, a standards committee sets the rules of the language for C++. Someone else makes a compiler and linker for the language. Vendors create compilers and linkers in the case of C++.

Recap

After all this discourse, a few final words to tie it all together seem in order. Considering a theoretical situation where you have a software application made up of a single instruction, we can define software as the thing that changes, as a response to input, the state or configuration of hardware. The change of state might be the result of a simple procedure as moving a block of memory from one location to another, but the changed state can have major effects based on how the manufacturer of the machine decides to interpret.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Engineer
United States United States
Zehaie is an avid learner of software development. He finds immense pleasure in acquiring and sharing grounds-up knowledge of the techniques and methods in software engineering. To contact, visit his LinkedIn profile.
https://www.linkedin.com/in/zehaie-hailu-77935519

Comments and Discussions

 
QuestionMy favourite 1 line utility/program Pin
Sean McPoland11-Aug-16 19:50
Sean McPoland11-Aug-16 19:50 
AnswerRe: My favourite 1 line utility/program Pin
Zehaie M. Hailu12-Aug-16 7:00
professionalZehaie M. Hailu12-Aug-16 7:00 
GeneralRe: My favourite 1 line utility/program Pin
Sean McPoland13-Aug-16 14:35
Sean McPoland13-Aug-16 14:35 
Quote:
Recap
After all this discourse, a few final words to tie it all together seem in order. Considering a theoretical situation where you have a software application made up of a single instruction, we can define software as the thing that changes, as a response to input, the state or configuration of hardware.


You make reference to the theoretical, however here is the actual true and practical implementation of said "
Quote:
a software application made up of a single instruction
"

So very relevant to the article. Smile | :)

IBM's first attempt at a do nothing program was a simple BR (branch to register) 14...it was beautiful, until someone realized the return code had to be set and a (minimum of) 100% modification had to be applied.

And on the eighth day change requests were invented.

regards
GeneralRe: My favourite 1 line utility/program Pin
Zehaie M. Hailu13-Aug-16 15:31
professionalZehaie M. Hailu13-Aug-16 15:31 
GeneralRe: My favourite 1 line utility/program Pin
Sean McPoland13-Aug-16 15:34
Sean McPoland13-Aug-16 15:34 
QuestionSimple Pin
AnotherKen11-Aug-16 9:40
professionalAnotherKen11-Aug-16 9:40 
AnswerRe: Simple Pin
Zehaie M. Hailu11-Aug-16 13:14
professionalZehaie M. Hailu11-Aug-16 13:14 
QuestionWhat is software Pin
rrotstein11-Aug-16 7:06
rrotstein11-Aug-16 7:06 
AnswerRe: What is software Pin
Zehaie M. Hailu11-Aug-16 7:11
professionalZehaie M. Hailu11-Aug-16 7:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.