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

POP Unit 3

Principal of programming

Uploaded by

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

POP Unit 3

Principal of programming

Uploaded by

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

How we communicate?

Ans: We have our own language to communicate.


The speaker and listener should know the same language to communicate.

What is language?
Ans: It is a medium to communicate or transfer the thoughts and message.
ex: English – English communication
sign language – for deaf people
braille language – for blind people
binary numbers – for computers

What is Binary?
Ans: Binary is a number system used in mathematics and computing. It consists of only two
digits ‘0’ and ‘1’.
Each and every single digit is known as “bit”, which is short form of “Binary digiT”.
Computers use binary because it is easy to implement with electronic circuit, where ‘0’ means
off/false and ‘1’ means on/true.
All complex data including text, images and sounds can be encoded in binary and processed
by computer.
Ex:
for human for computer
Hello → 1010100010011001010010101010101010101010
NSU → 10101001010010101010100101010101010
Programming Languages
Programming language is a system of communication that allows humans to instruct
computers to perform specific tasks. Developers used programming languages to write
programs to develop application, scripts etc.

Types of programming languages:


1. Low level language
Low level language is divided into 2 categories:
a. Machine level language
b. Assembly level language

2. High level language

Low Level Language


Low level languages are closer to hardware. These languages offer high performance and
control over system resources but are more challenging to learn and use.

Machine level language


The lowest level programming language, consisting entirely of binary digits (0 and 1). It
directly controls the computer’s hardware and is executed by CPU without any translation.
Characteristics:
• Direct Execution: Machine code is directly executed by CPU.
• CPU specific: Code is linked to the specific architecture (32-bit, 64-bit) of the CPU. It
makes it non-portable across different hardware.
• Binary format: Instruction is given in binary format (0 and 1) which is difficult to read
and write for humans.
• Fast execution: It does not require additional processing that’s why it provides high
execution speed.
Advantages:
• Maximum efficiency: Execution speed is very fast because it runs directly on hardware.
• Full control: It provides more control to the system resources. Beneficial for
performance priority tasks.
Limitations:
• Difficult to learn and use
• Non-portability: Programs written in machine code are tied to specific CPU
architecture.

Assembly level language


A low-level language that uses mnemonics and symbolic names to represent machine-level
instruction. It is one step above machine code and require an assembler to translate it into
machine code (0 and 1).
Characteristics:
• Symbolic representation: Uses symbol and mnemonics (e.g., ‘MOV’, ‘ADD’, ‘SUB’) to
represent operations. It is easier to read and understand as compared to machine code.
• Assembler required: An assembler converts assembly code into machine code
according to the CPU architecture.
• Efficient execution: Provides fast execution similar to machine code, but slightly less
efficient due to the assembly process.
Advantages:

• High performance: Provides high execution speed, close to the machine code.
• Fine-Grained control: Allow detailed control over hardware, making it suitable for
system programming and performance-critical applications.
• Easier debugging: It is easy to debug and modify as compared to machine code due to
its symbolic representations.
Limitations:

• Complexity: Complex to learn and remember mnemonics. And also required


detailed knowledge of the hardware.
• Non-portability: Programs written in assembly language are not portable across
different CPU architecture.
High level language
High level languages are programming languages that are much closer to human languages
and abstract away most of the computer’s hardware.
To write programs in high level language there is no need know about internal architecture
of computer.
High level language are easily understandable by human because programs written in these
languages are simple English.
Characteristics:
• Human readable syntax: Uses syntax that is closer to human languages with clear and
simple instructions.
• Portability: Program written in HLL can be run on different types of hardware with
minimal modification.
• Compiled or interpreted: Requires a compiler or interpreter to translate the high-level
code into machine code that the CPU can execute.
Ex:
• C : Known for its efficiency and control.
• Java : platform-independent language with OOPS concept.
• Python: Known for its easy readability and easy use.
Advantage:
• Easy: Easy to learn and use.
• Portability: Code can be run across different platforms.
• Faster development: Higher level of abstraction allows for fast development and
debugging.
Limitations:
• Lower performance: Due to conversion into machine code using compiler/interpreter.
• Less Control: Provide less control over hardware and system resources.
• Dependency on Compilers/Interpreters: Requires additional tools to translate into
machine code.

You might also like