0% found this document useful (0 votes)
3 views7 pages

Survey of Programming Language Midsemsters - Copy

The document is a test for the course CSC 423, focusing on programming languages and computer architecture. It includes questions on computer generations, programming language concepts, the fetch/decode cycle, Von Neumann architecture, and various programming languages. The answers provide detailed explanations of key concepts in computer science, including the significance of programming languages and their features.

Uploaded by

ojdavid2018
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views7 pages

Survey of Programming Language Midsemsters - Copy

The document is a test for the course CSC 423, focusing on programming languages and computer architecture. It includes questions on computer generations, programming language concepts, the fetch/decode cycle, Von Neumann architecture, and various programming languages. The answers provide detailed explanations of key concepts in computer science, including the significance of programming languages and their features.

Uploaded by

ojdavid2018
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 7

FACULTY OF SCIENCES

DEPARTMENT OF COMPUTER SCIENCE

COURSE CODE: CSC 423 TEST

COURSE TITLE: SURVEY OF PROGRAMMING LANGUAGE

BY
Dr. T.T. Chiagunye
No1
Q1a. List the major component of computer generation
1b. Itemize the reasons responsible for program language concept.
1c. Discuss four (4) out of the reasons mentioned in 1b above.
Answer
1A) The five generations of computers are characterized by the electrical current flowing through the processing
mechanisms listed below:
i) The first is within vacuum tubes
ii) Transistors
iii) Integrated circuits
iv) Microprocessors
v) Artificial intelligence
1B) Mentioned and explained in 1C below.
1C)i) Increased ability to express ideas/algorithms:
In Natural language, the depth at which people think is influenced by the expressive power of the language they use. In
programming language, the complexity of the algorithms that people Implement is influenced by the set of constructs
available in the programming language. The language in which they develop software places limits on the kinds of control
structures, data structures, and abstractions they can use; thus, limiting the forms of algorithms they can construct.
Awareness of a wider variety of programming language features can reduce such limitations in software development.
Programmers can increase the range of their software development thought processes by learning new language
ii) Improved background for choosing appropriate Languages:
Many programmers use the language with which they are most familiar, even though poorly suited for their new project. It
is ideal to use the most appropriate language. If these programmers were familiar with a wider range of languages and
language constructs, they would be better able to choose the language with the features that best address the problem.
However, it is preferable to use a feature whose design has been integrated into a language than to use a simulation of that
feature, which is often less elegant, more cumbersome, and less safe.

iii) Increased ability to learn new languages:


For instance, knowing the concept s of object oriented programming OOP makes learning Java significantly easier and also,
knowing the grammar of one‘s native language makes it easier to learn another language. If thorough understanding of the
fundamental concepts of languages is acquired, it becomes far easier to see how these concepts are incorporated into the
design of the language being learned therefore it is essential that practicing programmers know the vocabulary and
fundamental concepts of programming languages so they can read and understand programming language descriptions
and evaluations, as well as promotional literature for languages and compilers.

iv) Better Understanding of Significance of implementation:


This leads to understanding of why languages are designed the way they are. This is an ability to use a language more
intellectually, as it was designed to be used. We can become better programmers by understanding the choices among
programming language constructs and the consequences of those choices. Certain kinds of program bugs can be found and
fixed only by a programmer who knows some related implementation details. It allows visualization of how a computer
executes various language constructs.
It provides hints about the relative efficiency of alternative constructs that may be chosen for a program. For example,
programmers who know little about the complexity of the implementation of subprogram calls often do not realize that a small
subprogram that is frequently called can be a highly inefficient design choice.

v) Better use of languages that are already known:


Many contemporary programming languages are large and complex. It is uncommon for a programmer to be familiar with and
use all of the features of a language uses. By studying the concepts of programming languages, programmers can learn about
previously unknown and unused parts of the languages they already use and begin to use those features.

vi) The overall advancement of computing:


The study of programming language concepts should be justified and the choose languages should be well informed so that
better languages would eventually squeeze out poorer ones.

No 2
Q2a. Describe the fetch/decode part of the fetch/decode/execute/reset cycle, explaining the purpose of any special registers
that you have mentioned.
2b.Explain what is meant by the term Von Neumann architecture.
2c. Describe two ways in which the program counter can change during the normal execution of a program, explaining in each
case how this change is initiated.
Answer
2A) The following is an algorithm that shows the steps in the cycle. At the end the cycle is reset and the algorithm repeated.

i) Load the address that is in the program counter (PC) into the memory address register (MAR). 2. Increment the PC by 1.
ii) Load the instruction that is in the memory address given by the MAR into the memory data register (MDR)
iii) Load the instruction that is now in the MDR into the current instruction register (CIR).
iv) Decode the instruction that is in the CIR.
v) If the instruction is a jump instruction, then a. Load the address part of the instruction into the PC b. Reset by going to step
1.
vi) Execute the instruction.
vii) Reset by going to step
Steps 1 to 4 are the fetch part of the cycle
Step 1 simply places the address of the next instruction into the memory address register so that the control unit can fetch the
instruction from the right part of the memory. The program counter is then incremented by 1 so that it contains the address of
the next instruction, assuming that the instructions are in consecutive locations. The memory data register is used whenever
anything is to go from the central processing unit to main memory, or vice versa. Thus the next instruction is copied from
memory into the MDR and is then copied into the current instruction register. Now that the instruction has been fetched the
control unit can decode it and decide what has to be done.
2B) Von Neumann architecture describes a design architecture for an electronic digital computer with subdivisions of a central
arithmetic part, a central control part, a memory to store both data and instructions, external storage, and input and output
mechanisms. The meaning of the phrase has evolved to mean a stored-program computer. A stored-program digital computer is
one that keeps its programmed instructions, as well as its data, in read-write, random-access memory (RAM). So he introduced
the idea of the stored program. Previously data and programs were stored in separate memories. Von Neumann realized that
data and programs are indistinguishable and can, therefore, use the same memory. On a large scale, the ability to treat
instructions as data is what makes assemblers, compilers and other automated programming tools possible. One can "write
programs which write programs". This led to the introduction of compilers which accepted high level language source code as
2C) The program counter keeps track of where to find the next instruction so that a copy of the instruction can be placed in the
current instruction register. Sometimes the program counter is called the Sequence Control Register (SCR) as it controls the
sequence in which instructions are executed. However, if the instruction involves jumping to an instruction that is not the next
one in order, the PC has to be loaded with the address of the instruction that is to be executed next.

No 3
Q3a. Name three languages in each of the following categories: Von Neumann, functional, object oriented.
3b. Name two widely used concurrent language.
3c. What language used othogonality as a primary design criterion.
Answer
3A) i) For Von Neumann we have; FORTRAN Algol, Pascal, C/C++, C#, Java, Perl, JavaScript, Visual BASIC.NET.
ii) For functional language; LISP, Scala, Haskell, Python, Clojure, Erlang. It may also include OO (Object Oriented) concepts.
iii) for object oriented; SIMULA 67, SMALLTALK, C++, Java, Python, C#, Perl, Lisp or EIFFEL.

You might also like