DEV Community

Cover image for One Commit at a Time ! Series - 32
Annapoorani Kadhiravan
Annapoorani Kadhiravan

Posted on Edited on

One Commit at a Time ! Series - 32

MACHINE LANGUAGE

What is Machine Language?

Machine Language (or machine code) is the lowest-level programming language consisting exclusively of binary digits—0s and 1s. It is the native tongue of a computer's central processing unit (CPU). Every software program, operating system, or game must ultimately be translated into machine language before the hardware can execute it. [1, 2, 3, 4]


Binary vs. Decimal Format

  • Binary Format (Base-2):
  • Uses only two digits: 0 and 1.
    • Each 0 or 1 is called a bit (8 bits make 1 byte).
    • It relies on powers of 2 ($2^0, 2^1, 2^2, \dots$). For example, the binary number 1101 converts to decimal as: [5, 6] $$(1 \times 2^3) + (1 \times 2^2) + (0 \times 2^1) + (1 \times 2^0) = 8 + 4 + 0 + 1 = 13$$
  • Decimal Format (Base-10):
  • Uses ten digits: 0 through 9.
    • This is the standard counting system used by humans in everyday life.
    • It relies on powers of 10 ($10^0, 10^1, 10^2, \dots$). For example, the decimal number 13 means $(1 \times 10^1) + (3 \times 10^0)$. [6]

How Does a Machine Understand It?

Computers are built out of digital electronic circuits containing billions of microscopic switches called transistors. [4, 6, 7]

  • 0 (Off): Represents low or no electrical voltage.
  • 1 (On): Represents high or positive electrical voltage. [2, 6, 8]

When machine code flows into the CPU, these electrical signals trigger physical gates and logic operations directly. The CPU reads these bit sequences (divided into opcodes for the command and operands for the data) and executes the hardware action immediately without needing a translator. [2, 8, 9, 10]


What is Human-Readable Language?

Human-readable language refers to high-level programming languages (like Python, Java, or C++) or intermediate languages like Assembly language. [1, 8, 11]

  • These use familiar English words, logical structures, mathematical symbols, or readable mnemonics (e.g., ADD, MOV, PRINT) rather than strings of raw numbers.
  • Because computers cannot execute these directly, they must be processed by a compiler, interpreter, or assembler to turn them into machine language. [1, 8, 9, 12, 13]

Key Differences Between Machine Language and Human-Readable Language

Feature Machine Language (Binary/Machine Code) Human-Readable Language (High-Level / Source Code)
Primary Audience Understood exclusively by the CPU/Hardware. Designed for humans to write, read, and maintain.
Format Consists strictly of 0s and 1s (binary). Uses English-like words, variables, and functions.
Translation Need No translator needed; executed natively by hardware. Requires a compiler, interpreter, or assembler.
Portability Hardware-dependent (tied to a specific CPU architecture). Mostly portable across different computer systems with minor changes.
Ease of Use Extremely hard, error-prone, and unmemorable for humans. Easy to learn, write, debug, and scale.
Execution Speed Fastest execution (runs directly on the processor). Slightly slower (must be translated or managed at runtime).

SQL

DATA DEFINITION LANGUAGE [ DDL ]

  1. CREATE - mention datatypes as well here

CREATE TABLE Persons (
id INT NOT NULL,
name VARCHAR NOT NULL,
birth-date DATE,
phone VARCHAR NOT NULL,
CONSTRAINT pk-persons PRIMARY KEY (id)
)
SELECT * FROM Persons

Top comments (0)