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!