- Type
- Quiz
- Course
- CS101 Introduction to Computing
- Size
- PDF 7.3 MB
- Updated
- 23 Oct 2026
You get 3 free files a day on the website. Add the Chrome extensionSign in with the extension for 30 a day.
Preview text
Text from pages 2, 3, 4 of 29. Download the file for all 29 pages.
Programs for modern computers consist of sequences of instructions that are encoded as numeric digits. Such an encoding system is known as a machine language. Unfortunately, writing programs in a machine language is a tedious task that often leads to errors that must be located and corrected (a process known as debugging) before the job is finished.
Using Mnemonics and descriptive names
In the 1940s, researchers simplified the programming process by developing notational systems by which instructions could be represented in mnemonic rather than numeric form.
For example, the instruction Move the contents of register 5 to register 6
4056 using the machine language introduced,
Whereas in a mnemonic system it might appear as MOV R5, R6
As a more extensive example, the machine language routine
Which adds the contents of memory cells 6C and 6D and stores the result at location 6E
Note: 156C loads register 5 with bit pattern found in memory cell at address 6C
using mnemonics. (Here we have used LD, ADDI, ST, and HLT to represent load, add, store, and halt.
Moreover, we have used the descriptive names Price, ShippingCharge, and TotalCost to refer to the memory cells at locations 6C, 6D, and 6E, respectively. Such descriptive names are often called program variables or identifiers.) Note that the mnemonic form, although still lacking, does a better job of representing the meaning of the routine than does the numeric form.
Machine Language
156C LD R5, Price 166D LD R6, ShippingCharge 5056 ADDI R0, R5 R6 306E ST R0, TotalCost C000
Load Store Move Add
Assemblers
Once such a mnemonic system was established, programs called assemblers were developed to convert mnemonic expressions into machine language instructions. Thus, rather than being forced to develop a program directly in machine language, a human could develop a program in mnemonic form and then have it converted into machine language by means of an assembler.
MOV R5, R6 to 4056
A mnemonic system for representing programs is collectively called an assembly language. At the time assembly languages were first developed, they represented a giant step forward in the search for better programming techniques. In fact, assembly languages were so revolutionary that they became known as second-generation languages, the first generation being the machine languages themselves.
Assembly language disadvantages
Although assembly languages have many advantages over their machine language counterparts, they still fall short of providing the ultimate programming environment. After all, the primitives used in an assembly language are essentially the same as those found in the corresponding machine language. The difference is simply in the syntax used to represent them. Thus, a program written in an assembly language is inherently machine dependent – that is, the instructions within the program are expressed in terms of a particular machine’s attributes. In turn, a program written in assembly language cannot be easily transported to another computer design because it must be rewritten to conform to the new computer’s register configuration and instruction set.
Another disadvantage of an assembly language is that a programmer, although not required to code instructions in numeric form, is still forced to think in terms of the small, incremental steps of the machine’s language. (Low level primitives) The situation is analogous to designing a house in terms of boards, nails, bricks, and so on. It is true that the actual construction of the house ultimately requires a description based on these elementary pieces, but the design process is easier if we think in terms of larger units such as rooms, windows, doors, and so on.
In short, the elementary primitives in which a product must ultimately be constructed are not necessarily the primitives that should be used during the product’s design. The design process is better suited to the use of high-level primitives, each representing a concept associated with a major feature of the product. Once the design is complete, these primitives can be translated to lower-level concepts relating to the details of implementation.
Machine Independent
Following this philosophy, computer scientists began developing programming languages that were more conducive to software development than were the low-level assembly languages. The result was the emergence of a third generation of programming languages that differed from previous generations in that their primitives were both higher level (in that they expressed instructions in larger increments) and machine independent (in that they did not rely on the characteristics of a particular machine). The best known early examples are FORTRAN (FORmula TRANslator), which was developed for scientific and engineering applications, and COBOL (COmmon Business-Oriented Language), which was developed by the U.S. Navy for business applications.
In general, the approach to third-generation programming languages was to identify a collection of high level primitives in which software could be developed. Each of these primitives was designed so that it could be implemented as a sequence of the low-level primitives available in machine languages. For example, the statement
TotalCost = Price + ShippingCharge
expresses a high-level activity without reference to how a particular machine should perform the task, yet it can be implemented by the sequence of machine instructions discussed earlier. Thus, our pseudocode structure
identifier = expression is a potential high-level primitive.
Translators
Once this collection of high-level primitives had been identified, a program, called a translator, was written that translated programs expressed in these high-level primitives into machine-language programs. Such a translator was similar to the second-generation assemblers, except that it often had to compile several machine instructions into short sequences to simulate the activity requested by a single high-level primitive.
Compilers
Translators, which compile several machine instructions into short sequences to simulate the activity requested by a single high-level primitive. Such Translation programs were often called compilers.
Interpreters
An alternative to translators, called interpreters, emerged as another means of implementing third generation languages. These programs were similar to translators except that they executed the instructions as they were translated instead of recording the translated version for future use. That is, rather than producing a machine-language copy of a program that would be executed later, an interpreter actually executed a program from its high-level form.
As a side issue, we should note that the task of promoting third-generation programming languages was not as easy as might be imagined. The thought of writing programs in a form similar to a natural language was so revolutionary that many in managerial positions fought the notion at first. Grace Hopper, who is recognized as the developer of the first compiler, often told the story of demonstrating a translator for a third-generation language in which German terms, rather than English, were used. The point was that the programming language was constructed around a small set of primitives that could be expressed in a variety of natural languages with only simple modifications to the translator. But she was surprised to find that many in the audience were shocked that, in the years surrounding World War II, she would be teaching a computer to “understand” German.
Natural languages and formal languages
Today we know that understanding a natural language involves much more than responding to a few rigorously defined primitives. Indeed, natural languages (such as English, German, and Latin) evolved over time without formal grammatical analysis.
Formal languages (such as programming languages) are precisely defined by grammars.
Goal of machine independence
With the development of third-generation languages, the goal of machine independence was largely achieved. Since the statements in a third-generation language did not refer to the attributes of any particular machine, they could be compiled as easily for one machine as for another.
- A program written in a third generation language could theoretically be used on any machine simply by applying the appropriate compiler.
When a compiler is designed, particular characteristics of the underlying machine are sometimes reflected as conditions on the language being translated.
- The different ways in which machines handle I/O operations have historically caused the “same” language to have different characteristics, or dialects, on different machines.
- Consequently, it is often necessary to make at least minor modifications to a program to move it from one machine to another.
Compounding this problem of portability is the lack of agreement in some cases as to what constitutes the correct definition of a particular language.
Standardization
- To aid in this regard, the American National Standards Institute and the International Organization for Standardization have adopted and published standards for many of the popular languages.
Related CS101 files
All CS101 files →- CS101 Highlighted Handouts According to New Pattern by Study with BRD Highlighted PDF 27.1 MB
- CS101 Final Term MCQs Modules 162-214 Final term PDF 12.1 MB
- CS101 Quiz 9 2020 Quiz PDF 1.1 MB
- CS101 Quiz Modules 109-220 by Orange Monkey Quiz PDF 187 KB
- CS101 Solved Grand Quiz 2020 Quiz PDF 161 KB
- CS101 Quiz Quiz PDF 2.8 MB
Get more out of VUBuddy, for free
- Unlimited downloads
- The explanation behind every MCQ answer
- Study offline on slow data
- 30 downloads a day instead of 3
- Sign in and buy Pro Semester here
One Pro Semester membership works in both the extension and the app.