Computer Algorithms  «Prev  Next»
Lesson 6Machine language
ObjectiveExplain what machine language is.

Describe Machine Language

When you follow a recipe to prepare a food dish, it's a good idea if the recipe is written in a language you understand.
Likewise, the instructions in a computer program must be in a language that the computer understands.
In a computer, all instructions and data are represented by a series of electronic switches that can be in one of two states: on or off.
The binary digits 1 (on) and 0 (off) represent these two states. Thus, the language that a computer understands is made up of patterns of 1s and 0s.

History of Machine Language

Machine language, the most fundamental level of programming language, has a rich history closely intertwined with the evolution of computers. In the early days of computing, machine language was the only way to instruct computers. It consists of binary code — sequences of 0s and 1s — that directly represent the basic operations of the computer's processor. The inception of machine language dates back to the 1940s with the development of the first electronic computers. Pioneers like Konrad Zuse and Alan Turing contributed significantly to early machine coding systems. Zuse's work on the Z3, considered the first functional programmable computer, utilized a form of machine code, while Turing's work laid foundational concepts. As technology advanced, the limitations of machine language became apparent. Its complexity and the need for precise, error-free coding led to the development of assembly language in the 1950s. Assembly language, a slight abstraction of machine language, uses mnemonic codes and labels to represent machine-level instructions, making programming more accessible.
The advent of higher-level programming languages, starting with FORTRAN in the 1950s, further abstracted the programming process, allowing for more complex and efficient software development. Despite these advancements, machine language remains a cornerstone of computer operation. At the lowest level, all software, from operating systems to application programs, eventually translates to machine language for execution by the CPU. In modern computer science, machine language underpins the understanding of how software interacts with hardware. It is essential for systems programming, hardware design, and performance optimization. While not commonly used for everyday programming due to its complexity and the availability of higher-level languages, machine language offers unparalleled control and efficiency, making it crucial for specific applications in areas like embedded systems and device drivers.
Thus, machine language, with its historical significance and ongoing relevance, continues to be an integral part of computer science, embodying the primal interface between human logic and electronic computation.

These are referred to as binary code, or machine language. Machine language: 'The language understood by the computer is also known as machine code or binary code.
Each type of CPU has its own machine language that it understands.
A single binary digit is called a bit , and a sequence of 8 bits is referred to as a byte.
  1. Bit:A single binary digit.
  2. Byte:A sequence of 8 bits.

To a computer with a 32-bit (or 4-byte) instruction set, a computer program might look like the following:
10101000 11010110 01011101 11101100
10111100 00111000 01001101 00000111
11001000 00110110 10110101 00101000
As you can imagine, writing programs in the language of the computer is not much fun. Decades ago, when computer programming was in its infancy, this is exactly what had to be done. Today it's much easier to write programs, as we will begin to see in the next lesson.

Programming Process

A program (also referred to as an application) is a set of instructions targeted to solve a particular problem that can be unambiguously understood by a computer. To this end, the computer will translate the program to the language it understands, which is machine language consisting of 0s and 1s. Computers execute a program literally as it was programmed, nothing more and nothing less. Programming is the activity of writing or coding a program in a particular programming language. This is a language that has strict grammar and syntax rules, symbols, and special keywords. People who write programs are commonly referred to as programmers or application developers. The term software then refers to a set of programs within a particular business context.