The Assembly Language

Image result for the assembly language

What is assembly language?

The assembly language is a low level programming language which is use by microprocessor and memory. It is a also called as assembly code and denoted by asm. The extension of assembly code is .s. Each assembly language is a specific to a particular computer architecture and sometime to an operating system.

The assembly language is still use for Hardware manipulation, access to a specialised processor instruction and to understand processes going inside the processor. The C and C++ are mid level languages which is used for application in real world but to understand the process going on while running c program, assembly language is required and it is fantastic language.

Is there any need to learn this language?

Basically assembly language is not needed but if you want to be a good programmer and want to know what is going behind the program, in processor and memory assembly language is for you.

Basic Syntax of Assembly language

section .text
global_start ;must be declared for linker (ld)
_start: ;tells linker entry point
mov edx,len ;message length
mov ecx,msg ;message to write
mov ebx,1 ;file descriptor (stdout)
mov eax,4 ;system call number (sys_write)
int 0x80 ;call kernel
mov eax,1 ;system call number (sys_exit)
int 0x80 ;call kernel
section .data
msg db ‘Hello, world!’, 0xa ;our dear string
len equ $ – msg ;length of our dear string

The output is : Hello, world!

Understanding the Syntax

The Syntax contains basically 3 parts

  1. data
  2. bss
  3. text

The data section

Here you can declare values like variables in C

The variables are as follow :- .ascii for strings, .int for 32 bit integer, .short for 16 bit integers, .float for floating point.

The processor supports the following data size:-

  • Word: a 2-byte data item
  • Doubleword: a 4-byte (32 bit) data item
  • Quadword: an 8-byte (64 bit) data item
  • Paragraph: a 16-byte (128 bit) area
  • Kilobyte: 1024 bytes
  • Megabyte: 1,048,576 bytes

The bss section

The bss section is used for declaring variables.

The text section

The text section is used for keeping the actual code. This section must begin with the declaration global _start, which tells the kernel where the program execution begins.

Comment

Using comments are helpful:- # is used to comment

The Registers:- The processor is for processing the data. Reading data and storing into the memory slows down the speed of processor so it uses location of internal memory called as Registers

Image result for registers in assembly language

The Pointer Register:-

  • Instruction Pointer (IP) − The 16-bit IP register stores the offset address of the next instruction to be executed. IP in association with the CS register (as CS:IP) gives the complete address of the current instruction in the code segment.
  • Stack Pointer (SP) − The 16-bit SP register provides the offset value within the program stack. SP in association with the SS register (SS:SP) refers to be current position of data or address within the program stack.
  • Base Pointer (BP) − The 16-bit BP register mainly helps in referencing the parameter variables passed to a subroutine. The address in SS register is combined with the offset in BP to get the location of the parameter. BP can also be combined with DI and SI as base register for special addressing.

The Index Register:-

  • Source Index (SI) − It is used as source index for string operations.
  • Destination Index (DI) − It is used as destination index for string operations.

QUANTUM COMPUTING

quantum-computing

What is Quantum Computing?

Quantum computer is a new Technology in field of computing like classical computers it performs tasks like Arithmetic and Logical operation but in entirely different way.
 Quantum computer uses Quantum-mechanical Phenomenon like Superposition and Entanglement.


All computing systems rely on a fundamental ability to store and manipulate information. Current computers manipulate individual bits, which store information as binary 0 and 1 states. Quantum computers leverage quantum mechanical phenomena to manipulate information. To do this, they rely on quantum bits, or qubits.

Limitation of Classical Computing

The Transistors are getting smaller nowadays transistors are almost 14 nm small. What transistors do it Controls the flow of current through it, let’s assume transistors reach at atomic level in which blocking of electrons become impossible (the phenomenon of quantum tunneling ) then it will hard to measure anything in such computer since bits depends on the the value of High Voltage and Low voltage this phenomenon will leave our computers useless.

Tunnel FETs Back Or Through, transistors
Reference:IEEE

What is Qubits and how it differs from bits ?

Qubit or Quantum bit is a measurement of storage in Quantum computers like bits in classical. Qubits are different from bits, In bits the value will be either 1 or 0 but in case of Qubits it exist between 0 and 1 (remember the phenomenon of Quantum Superposition ). Qubits exist as a spectrum between 0 and 1.  It is possible to fully encode one bit in one Qubit. However, a Qubit can hold more information, e.g. up to two bits using superdense coding.For a system of n components, a complete description of its state in classical physics requires only n bits, whereas in quantum physics it requires 2n−1 complex numbers

Qubit State

A Qubit state is a superposition of basis states. A single Qubit can be describe by Linear combination. Let the probability of getting ‘0’ as outcome is |a|*|a| and probability of getting outcome ‘1’ is |b|*|b| then |a|*|a|+|b|*|b|=1

Image result for qubits

Building Quantum computer with superconducting Qubits

Reference:Tensorflow google

Potentials in Quantum computing

Timeline

Timeline of quantum computing milestones.
Reference: Research gate

If Quantum Computers are this much useful then why we aren’t using them?

The reason behind this is Decoherence problem. It is the phenomenon in which a quantum system retains classical values when it interacts with environment. For example assume a qubit as Rotating coin if we observe it either it will give head or tail or a physical phenomenon or interaction will make that coin still showing either head or tail.  Radiation, light, sound, vibrations, heat, magnetic fields or even the act of measuring a qubit are all examples of decoherence.

Due to the Phenomenon of Entanglement we can increase the computational power two fold by adding an extra Qubit. So just imagine using kilo qubits we can store as much as data we want to but there is a limitation here as we increase number of Qubits we are willing to expose it to environment and here the Decoherence Theory start playing.

Coherence Length is the time a qubit can survive its quantum properties. World’s longest lasting qubit holds the record of 39 minutes in superposition state, it may seem short but that amount of time could calculate more than 200 million operations .

Types of Quantum Computers

Quantum Annealer

Reference : Hackernoon

Analog Quantum

Reference : Hackernoon blog

Universal Quantum

Reference : Hackernoon

References

Wikipedia, IEEE, IBM Q, FutureLearn, Hackernoon, TED-Ed, TED Talks-> Quantum computing, Nutshell, Singularity Hub, Stack Exchange, Research Gate, Autodesk