The journey of code now brings us to the realm of chip level units that are made up of gates and would make up processors at large.
The gates that you looked at in the previous post, operate at a binary level. There are two signal levels - high and low - that usually corresponds to '1' and '0'. You can string them together to form bytes - to be precise, 8 bits form a byte.
The byte and the stream of bytes are not yet ready to go to the abstract level of code, because they need to be stored somewhere. They need to be manipulated in someway. This is done using the chip level units.
There are basically the following categories of chip level units.
The bytes that we talked about, need to be stored - either on the chip or off the chip. The on chip memory may serve as registers and caches. The RAM is an example of the memory that resides outside of a processor. Any of these memory units are made up of gates, and at the core, they are sequential circuits.
When the technology was at its infancy, they just had adders and subtracters These combinational circuits made using the gates could take two bytes, add them up (or subtract them) and provide the result. Multiplication and division were performed with a method called as 'repetitive additions'. As technology advanced, multipliers and divisors could be built using combinational circuits. (This gave a boost in the performance - how it did that is a bit advanced topic).
You saw that gates performed logical operations like NOT, AND, OR, XOR. They gates performed this at a bit level. These gates, when placed as particular combinational circuits could perform the same operations on byte sized (or greater) inputs. And when we look at byte sized data, other operations like shift (left shift or right shift) can be performed. These operations are wired with gates as a combinational circuit, to form the logic unit.
If the other units are the grunts of the army, then the control unit can be called the commander. It does as the name suggests - it controls other units. It streams the data from the memory units to different arithmetic and logic unit, gets the result, and puts it back into the memory.
The exact location of where the input data is taken from, the exact operation to be performed, and the exact location where the result should be stored, is decided by the code. The code is also stored in the memory.
It will become more clear, when we proceed to the processor level, where all these units would be working in coordination.
Add new comment