0% found this document useful (0 votes)
17 views4 pages

2023 Software

Software notes computer

Uploaded by

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

2023 Software

Software notes computer

Uploaded by

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

COMPUTER SCIENCE (0478) Grade – 10

Programming Languages
In this chapter, you will learn about:
 types of programming language, translators and IDEs
o advantages and disadvantages of high-level and low-level languages
o assembly language is a low-level language that uses mnemonics and assemblers
o the operation of compilers and interpreters for high-level languages
o advantages and disadvantages of compilers and interpreters
o the role and functions of integrated development environment (IDEs) when writing
code.
The very first computers (developed in forties) could not be programmed in today's sense.
Term software did not exist. Programmers manually set a number of jumpers (switches)
ON/OFF to perform a task.

Low Level Languages (Machine Source Code (Problem


Dependent) Oriented)
Machine Assembly Level High Level
Language Language Language
(0’s and 1’s) (Mnemonic codes) (English like
statements)

Assembler Compiler Interpreter


(Converts each mnemonic (Converts the (Runs line by
code to its corresponding entire program line)
machine code) in 1 go)
 Types of Programming languages
Low Level Languages: Programming languages that are dependent on computer
Machine
hardware, both machine code/ and
Object
assembly language are LLL’s
Code
Machine Language: It is and
(0’s a binary
1’s) programming language. Programs written in machine
code can be loaded and executed without translation. E g: 10101011. First real software
was developed in machine language. That is the only language that computer really
understands.
A typical machine language program looks like this:
Hexa
Binary
decimal
Memo Memo
ry Dat ry
Data
Addre a Addre
ss ss
0001001
1 12 0001
0
0001001
4 13 0100
1
0001101
0 1A 0000
0

Disadvantages
1. Programming in machine language was very hard and error-prone.
2. Programmers had to memorize that, E.g, 10001100 means "add", 11010101 means
"subtract" etc.
3. It is used to program a specific machine (machine dependent) and it works only in
that specific machine.
4. Difficult to check for errors in a program (debugging).
Assembly Level Language: Program language which uses mnemonic codes in which
each instruction corresponds to one machine code instruction. E g: Operating System,
Device Drivers, Games ect. ALL’s were developed to make programming easier. Obviously,

Page 1
COMPUTER SCIENCE (0478) Grade – 10
it is much easier to remember “ADD” rather than 10001100 denotes addition. The only
problem is that the computer doesn't have any idea what ADD means. That is why we
have to have a translator that translates mnemonic commands into binary codes. That
translator is just another program called “assembler”.
Here's a set of assembly language instructions with their meanings:
Instructio Meaning
n
LDA First LDA means load value of the variable (in this case, First) into the
accumulator
ADD ADD means add value of variable (in this case, Second) to the value
Second stored in the accumulator
STO Sum STO replace the value of the variable (in this case, Sum) by the value
stored in the accumulator
Fewer programmers write programs in an assembly language. Those programmers who
do, do so for the following reasons:
» to make use of special hardware
» to make use of special machine-dependent instructions
» to write code that doesn’t take up much space in primary memory
» to write code that performs a task very quickly
Advantages Disadvantages
Gain knowledge of how a computer Difficult to check for error in a program
works (debugging).
More control over how registers are Programmed for a specific machine (machine
accessed dependent)
Can access registers directly
Can write code that runs very fast takes a longer time to write a programs
Can write code that occupies less programs are difficult to understand
memory

High Level Languages: Programming language where instructions are very similar to
English. It is independent of computer hardware. Programs written in a HLL needs to be
translated into machine code before it is executed. E g: VISUAL BASIC, PYTHON, C++,
JAVA.
Each language has a unique set of keywords (words that it understands) and a special
syntax for organizing program instructions.
Advantages Disadvantages
Easy for the programmer to read/write as it is similar programs can take longer to
to English. execute
Easy to check for error in a program (debugging).
Programs can run on any machines (machine programs can be larger
independent). Occupies large memory
No need to understand registers/computer
architecture
Can write a program in a short period of time programs may not be able
Easy to maintain once in use. make use of special hardware
 Translation Programs
“These programs are part of the systems software and are used to convert a
program from one language to other”.E g: Assembler, Compiler, Interpreter
Assembler: “Program that converts assembly language into machine code”.

Page 2
COMPUTER SCIENCE (0478) Grade – 10
Interpreter: “Program which runs high level language statement by statement”.
Compiler: “Program which converts the whole of high level language into
machine code in one go”.
Compiler Interpreter Assembler
Converts a high-level Runs a high-level language Translates a low level
language program into program one statement at a assembly language
machine code. time program into machine
code.
An executable file of No executable file of An executable file of
machine code is produced. machine code is produced. machine code is produced.
One high-level language One high-level language One low-level language
statement can be program statement may statement is usually
translated into several require several machine translated into one
machine code instructions. code instructions to be machine code instruction.
executed.
Compiled programs are Interpreted programs Assembled programs are
run without the compiler. cannot be run without the used without the
interpreter assembler
A compiled program is An interpreter is often used An assembled program is
usually distributed for when a program is being usually distributed for
general use. developed. general use.

Advantages and Disadvantages of compilers and interpreters


Translat Advantages Disadvantages
ors
easier and quicker to debug and test programs cannot be run
Interpret programs during development without the interpreter
er easier to edit programs during development programs can take longer
to execute
a compiled program can be stored ready for it takes a longer time to
use write, test and debug
a compiled program can be executed without programs during
the compiler development
Compiler
a compiled program takes up less space in
memory when it is executed
a compiled program is executed in a shorter
time
 Integrated Development Environment (IDE)
A collection of programs used to write and test a computer program written in a high-level
language. An IDE is used by programmers to aid the writing and development of programs.
There are many different IDEs available; some just support one programming language,
others can be used for several different programming languages.
Features of IDE:
 code editors. A code editor allows a program to be written and edited without the need
to use a separate text editor. This speeds up the program development process, as
editing can be done without changing to a different piece of software each time the
program needs correcting or adding to
 a translator. Most IDEs usually provide a translator, this can be a compiler and/or an
interpreter, to enable the program to be executed. The interpreter is often used for
developing the program and the compiler to produce the final version of the program to
be used.
 a runtime environment with a debugger. A debugger is a program that runs the program
under development and allows the programmer to step through the program a line at a
time (single stepping) or to set a breakpoint to stop the execution of the program at a

Page 3
COMPUTER SCIENCE (0478) Grade – 10
certain point in the source code. A report window then shows the contents of the
variables and expressions evaluated at that point in the program. This allows the
programmer to see if there are any logic errors in the program and check that the
program works as intended.
 error diagnostics & auto-correction. Dynamic error checking finds possible errors as the
program code is being typed, alerts the programmer at the time and provides a
suggested correction. Many errors can therefore be found and corrected during program
writing and editing before the program is run.
 auto-completion. Code editors can offer context-sensitive prompts with text completion
for variable names and reserved words.
 an auto-documenter and prettyprinting. IDEs can provide an auto-documenter to explain
the function and purpose of programming code. Most code editors colour code the words
in the program and lay out the program in a meaningful way – this is called
prettyprinting.

 Activity 1
1. Tick () the appropriate column in the following table to indicate whether the
statement about the translator is True or False.
Tru Fals
e e
An assembler translates a high-level language program.
It is more difficult to write a program in a low-level language.
Java is an assembly language.
It is quicker to develop a program using a high-level language.
You always need a compiler to run a compiled program.
A program that is interpreted takes a longer time to run than a compiled
program.
Low-level languages are machine dependent.
 Activity 2
1. Suki is writing a program in a high-level language.
a. Describe three features of an IDE that she would find helpful.
b. Describe three differences between a compiler and an interpreter.
c.Explain why a programmer would choose to write a program in assembly language.

Page 4

You might also like