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

Computer Languages

Uploaded by

rdanny
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Computer Languages

Uploaded by

rdanny
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Introduction to Computer Languages

• Computer languages are used to communicate instructions to


a computer.
• These languages enable programmers to write code that the
computer hardware can understand and execute.
• Computer languages can be divided into several categories
based on their level of abstraction from machine hardware.
Machine Language (Low-Level
Language)
• The most basic language a computer understands, consisting of binary
code (0s and 1s). Instructions written in machine language are executed
directly by the computer's CPU.
• Characteristics:
• Hardware-specific (depends on the computer’s architecture).
• Fast and efficient but difficult to write and understand.
• Error-prone since it requires precise sequences of binary bits.
• Advantages:
• High performance as instructions are executed directly by the hardware.
• Low-level control over hardware resources.
Machine Language (Low-Level
Language)
• Disadvantages:
• Difficult to learn and debug.
• Non-portable: Code written for one type of processor won’t
run on another without modification.
• Example:
• An instruction in binary form for an Intel processor might look
like:10110000 01100001
Assembly Language (Low-Level
Language)
• Definition:
• A low-level language that uses mnemonics (human-readable symbols) to represent
machine-level instructions.
• Each assembly language instruction corresponds to a specific machine code instruction.
• Characteristics:
• Assembly languages are hardware-specific (one assembly language per type of CPU).
• Easier to read and write than machine language, but still requires technical knowledge.
• Requires an assembler to translate the code into machine language.
• Advantages:
• Easier to write than machine code.
• Provides direct control over hardware.
• Suitable for performance-critical applications, such as device drivers or embedded
systems.
Assembly Language (Low-Level
Language)
• Disadvantages:
• Still complex and harder to debug than high-level languages.
• Non-portable across different architectures.
• Example:
• An assembly instruction for an x86 CPU might look like:
• MOV AL, 61h ; Move hexadecimal value 61 into the AL
register
High-Level Languages (HLL)
• Definition:
• High-level languages are more abstract and closer to human languages, making them easier
to read, write, and maintain.
• They need to be translated (compiled or interpreted) into machine code for execution.
• Characteristics:
• Platform-independent (can run on multiple architectures with minimal changes).
• Require compilers or interpreters to convert code into machine language.
• Abstract away hardware-level details, focusing more on logic and functionality.
• Advantages:
• Easier to learn and use.
• Portable: Programs can run on different hardware with minimal changes.
• Supports complex data structures and libraries.
High-Level Languages (HLL)

• Disadvantages:
• Less efficient compared to low-level languages.
• Limited control over hardware resources.
• Examples:
• Compiled languages: C, C++, Java
• Interpreted languages: Python, JavaScript
• Domain-specific languages: SQL for databases
• Example Code in Python:
• print("Hello, World!")
Comparison of Computer Languages
Feature Machine Language Assembly High-Level
Language Language
Abstraction Level No abstraction (binary Low-level abstraction High-level abstraction
instructions)

Ease of Use Very difficult Moderate Easy


Performance Very fast Fast May be slower
Portability Not portable Not portable Highly portable
Translation No (direct execution) Assembler required Compiler or
Required interpreter required

Usage Microcontrollers, Device drivers, Web applications,


firmware embedded systems software development

You might also like