What is Machine Language?

Introduction

Let’s understand machine language with an example:

  • As a human, If we add two numbers, we will add it like this: “Add 5 and 3”.
  • However, computers can only understand machine language, which consists of binary code.
Let's see an example instruction
What is Human Language?
What is Machine Language?
Instruction: ADD
Operand 1: 5
Operand 2: 3
    
Instruction: 0001
Operand 1: 00000101
Operand 2: 00000011
    

In this example,

  • Human want the instruction to be “ADD” but computer understand it as “0001”.
  • Similarly, human provides operands as 5 and 3 but computer understand it as “00000101” and “00000011” respectively.
What is Machine Language?
  • Computer is an electronic device works on switch which can either be ‘ON’ or ‘OFF’.
  • This state of switches is denoted as ‘0 as OFF’ or ‘1 as ON.
  • Machine language is all about the state of a electronic switch i.e., 0’s or 1’s.
  • In other words, it’s the instructions and data that are all in 0’s and 1’s.
How do we measure the size of data in computer? (0's and 1's)

When everything in computer is 0’s or 1’s, then how do we calculate the size of data in computer?

  • In computer, the smallest unit of data can either be 0 or 1.
  • We denote it as bit i.e., 1-bit is either 0 or 1 which is the state of switch (either on or off).
  • As we denote the data with 2 digits only. We call it as binary (2 digits i.e., 0 or 1).

bit is the smallest unit of data which is measured based on the state of electronic switch.

  • Similarly, 2-bit can either of 00 or 01 or 10 or 11.