His123 Note 1
His123 Note 1
His123 Note 1
Think about some of the different ways that people use computers. In school, students use
computers for tasks such as writing papers, searching for articles, sending email, and
participating in online classes. In hospital, we can see the use of computers for, assessment,
Patient monitoring, Documentation telemedicine and Electronic Medical record
Computers are also used for several types of medical examination and procedures. For instance,
heart rate monitor is used in hospitals where patients with heart ailments come. Blood glucose
monitor is another computer-based system where diabetics are monitor.
At work, people use computers to analyze data, make presentations, conduct business
transactions, communicate with customers and coworkers, control machines in manufacturing
facilities, and do many other things. At home, people use computers for tasks such as paying
bills, shopping online, communicating with friends and family, and playing computer games.
And don’t forget that cell phones, iPods, Blackberries, car navigation systems, and many other
devices are computers too. The uses of computers are almost limitless in our everyday lives.
Computers can do such a wide variety of things because they can be programmed. This means
that computers are not designed to do just one job, but to do any job that their programs tell them
to do. A program is a set of instructions that a computer follows to perform a task. For example,
let’s take two commonly used programs, Microsoft Word and Adobe Photoshop. Microsoft
Word is a word processing program that allows you to create, edit, and print documents with
your computer. Adobe Photoshop is an image editing program that allows you to work with
graphic images, such as photos taken with your digital camera.
Programs are commonly referred to as software. Software is essential to a computer because it
controls everything the computer does. All of the software that we use to make our computers
useful is created by individuals working as programmers or software developers. A programmer,
or software developer, is a person with the training and skills necessary to design, create, and test
computer programs. Computer programming is an exciting and rewarding career. Today, you
will find programmers’ work used in business, medicine, government, law enforcement,
agriculture, academics, entertainment, and many other fields.
CONCEPT OF PROGRAMMING
Computer: is a tool used for processing data into information. The processing is controlled by a
set of detailed step by step instructions.
Program: The list of instructions that the computer must follow to be able to process data into
information. These instructions consist of statements written in a specific programming
language. When a program is written, we are basically solving a problem. To solve a problem,
we need to use our mind power or logic to develop the detailed instructions. OR
A program is a set of instructions that tells the computer what to do. Computer programming
(often shortened to programming or coding), is the process of writing, testing,
debugging/troubleshooting and maintaining act of instructions (source code) for solving a
problem with the computer. A source code is written in an acceptable computer programming
language. The code may be a modification of an existing source or something completely new.
Programming: The procedure of developing the detailed instructions for the computer.
PURPOSE OF PRGAMMING
The purpose of programming is to create a program that exhibits a certain described behavior
(customization). The process of writing source code requires expertise in many different
subjects,
including knowledge of the application domain. Alternatively. Programming is the craft of
transforming requirements into something that a computer can execute. Problem solving on
computer is a task of expressing the solution to the problem in terms of simple concepts,
operations and computer code (program) to obtain the results. To achieve this aim, you may
proceed as follows.
1 First, understand the problem clearly: - Decide what you want to be calculated by the
computer. What will be the input data required? (If any). This is the problem formulation.
2 Write the steps of computation that are necessary to arrive at the solution. This is setting
up the algorithm.
3 Prepare a flowchart corresponding to the algorithm.
4 Develop the computer program. Test and run it on the computer.
There is an ongoing debate on the extent to which the writing of programs is an art, a craft or an
engineering discipline. Good programming is generally considered to be the measured
application art, craft and engineering, with the goal of producing an efficient and maintainable
software (program) solution.
The discipline differs from many other technical professions in that programmers generally do
not need to be licensed or pass any standardized (or governmentally regulated) certification tests
in order to call themselves “programmers” or even “software engineers”.
COMPUTER LANGUAGES
All computers whether small or big cannot do anything on their own. They all require a series of
instructions (i.e., programs) before they can do any processing. It is these programs that will
direct the computer to carry out the required task. The programs have to be written out
comprehensively: to cover all possibilities: and in the right order before the control unit of the
CPU can use them effectively.
Programs can be written in several languages. Just as there are many spoken languages, there are
many computer languages. In this lecture we shall study the different levels of computer
languages and their forms.
Currently all computer languages can be grouped into three, namely, machine languages,
assembly
languages and high-level languages. Machine languages and assembly languages are together
referred to
as low-level languages. The detail characteristics of each group of languages are discussed
below.
CLASSIFICATION OF PROGRAMMING LANGUAGES ACCORDING TO LEVEL
MACHINE LANGUAGE
Machine Code or machine language is a low-level programming language that can be understood
directly by a computer’s central processing unit (CPU). Machine code consists of sequences of
binary numbers, or bits, which are usually represented by 1s and 0s, and which form the basic
instructions that guide the operation of a computer. The specific set of instructions that
constitutes a machine code depends on the make and model of the computer’s CPU. For
instance, the machine code for the Motorola 68000 microprocessor differs from that used in the
Intel Pentium microprocessor.
Writing programs in machine code is tedious and time-consuming since the programmer must
keep track of each specific bit in an instruction. Another difficulty with programming directly in
machine code is that errors are very hard to detect because the program is represented by rows
and columns of 1s and 0s.
Advantages of Machine Language
a. Less code is produced
b. Storage is saved
c. User has direct control of machine instruction
d. Execution is faster as no translation is needed
e. The programmer knows all the registers and instruction that use them.
Disadvantages of Machine Language
a. Cumbersome ie, tedious and difficult to learn
b. Programmer’s fluency is affected, thereby making the programs developed inefficient.
c. The developed programs are error prone and difficult to debug (correct)
d. The performance of the system is unreliable.
ASSEMBLY LANGUAGE
Assembly language is type of low-level computer programming language in which each
statement corresponds directly to a single machine instruction. Assembly languages are thus
specific to a given processor. After writing an assembly language program, the programmer must
use the assembler specific to the microprocessor to translate the assembly language into machine
code.
Assembly language provides precise control of the computer, but assembly language programs
written for one type of computer must be rewritten to operate on another type. Assembly
language might be used instead of a high-level language for any of three major reasons: speed,
control, and preference. Programs written in assembly language usually run faster than those
generated by a compiler; use of assembly language lets a programmer interact directly with the
hardware (processor, memory, display, and input/output ports).
Assembly language uses easy-to-remember commands that are more understandable to
programmers than machine-language commands. Each machine language instruction has an
equivalent command in assembly language. Assembly language makes programming much
easier, but an assembly language program must be translated into machine code before it can be
understood and run by the computer. Special utility programs called assemblers perform the
function of translating assembly language code into machine code.
Like machine code, the specific set of instructions that make up an assembly language depend on
the make and model of the computer’s CPU. Other programming languages such as Fortran,
BASIC, and C++, make programming even easier than with assembly language and are used to
write the majority of programs. These languages, called high-level languages, are closer in form
to natural languages and allow very complicated operations to be written in compact notation.
Advantages of Low Level Language
a. Program translation is easier than high level language
b. It affords the programmer the opportunity to understand the internal structure of
the hardware and its registers.
Disadvantages of Low Level Language
a. It is machine dependent, that is, cannot be transferred to another computer.
b. Program development is slow as the programmer must have detailed knowledge
of the hardware structure.
c. Program maintenance is slow and error prone.
HIGH LEVEL LANGUAGE
High-Level Language is a computer language that provides a certain level of abstraction from the
underlying machine language through the use of declarations, control statements, and other
syntactical structures. In practice, the term comprises every computer language above assembly
language. The next generation of language is called the 3 rd generation. The computer
programmers enjoy using this language because it gives them the fluency, the flexibility and the
opportunity to express their thought to the best of their ability. The languages of this generation
are called High level language. The high level languages are referred to as machine language and
assembly language.
Advantages of High Level Language
a. 2) It makes programming easier for the human being.
b. 3) High level instructions are easier to understand and faster to code.
c. 4) Error correction and resting of program is easier
d. 5) They are machine independent. That is, program written for computer can be
transferred to
e. another computer with little or no modification.
Disadvantages of High Level Languages
a. High level language tends to be inefficient in the use of CPU and other facilities.
b. Machine code instructions are produced and than requires more storage spaces.
c. More time is required to run the program as it has to be translated.
COMPARISON BETWEEN HIGH-LEVEL LANGUAGE AND LOW-LEVEL LANGUAGE
S High-Level Language Low-Level Language
N
1 It is a programming language in the sense that It is a type of language, which is machine-
it's user-friendly. friendly.
2 These languages are considered less memory These languages are considered high
efficient. memory efficient.
3 It is simple to comprehend. It's difficult to comprehend.
4 It's straightforward to troubleshoot. Comparatively, it is complex to debug.
5 It's easy to keep up with. In comparison, it is difficult to maintain.
6 High-level language is portable. Low-level language is non-portable.
7 It is compatible with all operating systems. It is entirely dependent on the machine.
8 For translation, a compiler or interpreter is For translation, it will need an assembler.
required.
9 It is commonly used in programming. It is no longer widely used in
programming.
Language Translators
These are the programs which are used for converting the programs in one language into
machine language instructions, so that they can be executed by the computer.
A program written in high-level language is called as source code. To convert the source code
into machine code, translators are needed.
A translator takes a program written in source language as input and converts it into a program in
target language as output.
It also detects and reports the error during translation.