Sampath Balivada
Sampath Balivada

Sampath Balivada

Machine Language and Memory - Nand2Tetris

Machine Language and Memory - Nand2Tetris

The language of computer gods.

Sampath Balivada's photo
Sampath Balivada

Published on Oct 27, 2021

2 min read

Some of the quotes and information are part of the Nand2Tetris course available on Coursera.

Machine Language

The Machine Language is the most important interface of a computer. It specifies the interaction between the hardware and the software of the computer. Wasn't this the kernel? Well theoretically yes but the Linux kernel is written in C and Assembly which is converted to Machine Language.

Machine Language is in Binary and they directly correspond to the hardware implemented in the computer. For instance, if the hardware has an implementation for Addition, there is a binary code for that operation.

Because Machine Language directly corresponds to the hardware implementation of a computer, so there are two things that can change in a Machine Language:

  1. Set of operations available. (Division, Bulk Copy, etc.)
  2. Data Types (Register Width, Floating Point, etc.)

Memory Hierarchy

Fast memory is expensive, large memory is slow. For this reason, we have a memory hierarchy. We arrange faster and small memory close to the CPU and slow and large memory farther from the CPU.

This solves 2 problems:

  1. Need to supply long memory address
  2. Getting the memory contents of the CPU

Flow Control

Computers execute commands and operations in a sequence. To control the sequence in which operations are performed or to repeat the same operations again and again, we use Conditional and Unconditional jumps.

 
Share this