Converting of Electricity to Computer Data

As we all know current passes through conductors like metals and semi conductors. Metals and semi conductors consist of matter and matter is composed of atoms. Atoms have electrons and flow of these electrons is defined as current or electricity. In a computer and any other electronic gadgets have circuit board, Engineer's build circuit board's using transistors NPN, PNP (which are high level technical terms). Simply in a circuit board there are thousands of transistors. To make use of these electrons, we create transistors which can store or free electricity as needed. They are stored in units of 1 (5Volts) and 0 (0 Volts).

    So, We have a simple knowledge about computer that it's understand 0 and 1. This is the 0 and 1 came from. A decimal number is converted to binary number to make understand by a computer. To do so we use transistors. An 8-bit number is then represented with 8 transistors, So 8-bit representation of the number 3 will be : 0000 0011. How is that achieved in hardware? Keep 8 transistors side-by-side (called registers and memory units). Make the first 6 transistors hold 0V and the next 2 transistors hold 5V. So 0V means 0 and 5V means 1.
    Now let’s combine 8 of these circuits. We now have a sequence of 8 bits, which we call a byte. If we interpret it as a number in base 2, it can take values from 0 to 255. We can combine more bytes to represent larger numbers, and perform operations on them using boolean algebra.
Registers and memory units makes Central Processing Unit (CPU) and Random Access Memory (RAM). A register is one of a small set of data holding places that are part of the computer processor. A register may hold an instruction, a storage address, or any kind of data. Sometimes an instruction may specify that the contents of two defined registers be added together and then placed in a specified register. RAM is a volatile memory and requires power to keep the data accessible. If the computer is turned off, all data contained in RAM is lost. (RAM, ROM are described in details in the next post).
   To make it easy to compute using the CPU, we developed machine code. This language is what essentially runs on the CPU. What do I mean by "run"? It means, keep flipping bits. If I want to perform 2+3, in machine, I would store 2 in one register and 3 in another register. Then I would take these values to an Adder unit which would do a mathematical add and give me the reply in another register. This is what a sample machine code would look like:
             80 02 F3     
             80 03 F4         
             88 F3 F4 F5   

Obviously, no one understood anything with this. So we came up with an ingenuous system to make it human readable. This is called assembly language. The following piece of code represents the above mentioned numbers:
where MOVI = 80

ADD REG A, REG B, REG C (add A and B and store in C)

          REG A = F3
          REG B = F4
          REG C = F5
          ADD = 88 

No comments:

Post a Comment