0% found this document useful (0 votes)
4 views

Levels of code

The document outlines the hierarchy of programming languages, starting from machine code, which is binary and hardware-dependent, to low-level code like assembly language that is more readable but still close to hardware. It then describes high-level languages, such as Python and Java, which are human-readable and portable across platforms. Each category has its pros and cons, with low-level languages offering fast execution and high-level languages providing ease of use and maintenance.

Uploaded by

vidhikapoor1298
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)
4 views

Levels of code

The document outlines the hierarchy of programming languages, starting from machine code, which is binary and hardware-dependent, to low-level code like assembly language that is more readable but still close to hardware. It then describes high-level languages, such as Python and Java, which are human-readable and portable across platforms. Each category has its pros and cons, with low-level languages offering fast execution and high-level languages providing ease of use and maintenance.

Uploaded by

vidhikapoor1298
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/ 2

1.

Machine Code (Lowest Level)

 Machine code consists of binary instruc ons (0s and 1s) that the CPU directly
understands and executes.

 It is hardware-dependent and difficult for humans to read or write.

 Example (binary representa on of an instruc on):

 10110000 01100001

 Assembly language is one step above machine code but s ll low-level.

2. Low-Level Code

 Low-level languages are close to machine code but slightly more readable.

 They provide direct control over hardware (e.g., memory, CPU registers).

 Example: Assembly Language (uses mnemonics instead of binary):

 MOV AL, 61h ; Move hex value 61 into AL register

 ADD AL, 02h ; Add 2 to AL

Pros:

 Fast execu on (since it runs close to hardware).

 More efficient for system programming (e.g., opera ng systems, drivers).

Cons:

 Hard to read and write.

 Not portable (depends on CPU architecture).

3. High-Level Code (Human-Readable)

 High-level languages (HLL) use English-like syntax, making programming easier.

 They are independent of hardware, unlike machine or low-level languages.

 Examples: Python, Java, C, C++, JavaScript

Example (Python - High-Level Language):

a = 10
b = 20

sum = a + b

print("Sum:", sum)

Pros:

 Easier to write, debug, and maintain.

 Portable across different pla orms.

Cons:

 Slower than low-level languages because it requires compila on or interpreta on.

Hierarchy Summary

1. Machine Code (Binary) → Lowest Level

2. Low-Level Code (Assembly) → Slightly readable, close to hardware

3. High-Level Code (Python, Java, C++) → Human-readable, portable

Let me know if you need more clarity!

You might also like