Journey Of Code - Machine Level

In the last article of this series, Sandy explained, how at the processor level, everything is orchestrated to make the machine perform actions. The particular actions among the many that can be performed by the processor is determined by the code.

The machine code is the lowest level of abstraction in software terms. It is the bridge between the software and the hardware.

Technology StackThe machine code are patterns of bits that carries the information on what the processor should be doing. Every processor model will have its own set of machine code. (And that is the reason why programs written in machine level are very hard to port from one model of processor to another).

The machine code, as mentioned earlier are patterns of bits. A set of machine code is called a program and it performs a higher level task. The programs in machine codes are represented as ‘0’s and ‘1’s; they are more conveniently written down as hexadecimal codes (or hex codes).

Another level of abstraction is the ‘Assembly Language’. These are mnemonics that refer to the machine code on a one to one basis. What that means is that every pattern of code would have a assembly language word (English) to represent it.

The codes usually contain to parts - the operator and the operand. Some of the codes have no operands and the word itself holds the information of the task to be performed. An example of a two operand code in the 8086 series of processors is the MOV operation.

MOV A B

That simple code instructs the processor to move the data held in one register to another. (Register is on-processor word-sized memory).

There are other codes that would instruct the processor to add, subtract, multiply, or perform logic operations like AND, OR, XOR on data held in two or more registers and store it in another register. There would be even jumps and other flow control codes that would allow a small program to perform relatively complex tasks.

The actual set of codes, would differ from one processor model to another. It also depends on the type of processor architecture like MISC, RISC or CISC.

The machine level programs allow the interface between the processor and the higher levels. It frees the software designers (to some extent) from the intricate micro-operations that are required to be performed by the processors and focus on the higher level tasks.

In the next post, we will look at the proverbial end of the journey into the realm of software. This may be the end of journey for the hardware, but opens up a large realm where the design of software seems to break through paradigms every now and then.

Journey Of Code - Processors

In earlier posts we have seen the circuit level components. Now if we put all of them together, we get a system. A system can be designed to perform a specific task or to perform task as per user requests.

A general purpose processor is a system where in the user tells the processor what needs to be done. A processor system generally consists of a computing unit (ALU/FPU), control unit and storage unit(registers/cache/RAMs). The user tells the processor what needs to be done by means of something called “op-code”. A op-code or operation-code is a set of byte/bytes which the control unit of the processor understands. Processor systems can be classified into 3 categories based on their op-code types.

Technology Stack

  • MISC
  • RISC
  • CISC

MISC or Minimal Instruction Set Computer is the most basic of the lot. This processor architecture uses a stack for storage. And the requested operation is performed on the contents of top of the stack. Because of the stack based architecture, the applications of this architecture was very limited. So this architecture did not have large fan followers.

RISC or Reduced Instruction Set Computer is the next step. This processor architecture is based on registers. All the operations are based on these registers. This architecture is actually the most popular, and unknown to many; this is the highly used architecture. This architecture gives a lot of benefits due to small footprint and high execution speed due to reduced complexity. These have very small op-codes and executed them very fast. The most famous processors using this architecture are from ARM.

CISC or Complex Instruction Set Computer is the most complex of the lot. This architecture can do almost everything the other two can do, plus few more things. This architecture can do complex things with a single op-code. This is the most famous architecture among the three. All the processors found in PCs/servers these days follow this architecture.
Read the rest of this entry »

Journey Of Code - Intermission

Technology Stack

We have had several extensive articles on each levels of the technology stack that makes up the abstract system of computer and internet.  We had a basic overview of it, and mildly in depth view on different levels from transistor to chip level units.

For the next level - the processor level - I thought I should let some one with more expertise in the field talk about it.  Tomorrow, you will see the next part of the series, Journey Of Code, by Sundeep Prabhu.

Stay Updated Through Email

For some time now, Splat has been providing feeds for you keep yourself updated.  As of now, there is another option - email subscription - if you are not using any feed readers.

Just pop your email address into subscription form in the sidebar, and confirm it by clicking the link that comes in your email.  (If the email does not show up in few mintues, check your spam folder).

Enter your email address:
Delivered by FeedBurner

The email would be solely used for the purpose of sending you updates and would not be sold to any one. Rest assured that the email address would not be mis-used.

Posted in Blog. 2 Comments »

Journey Of Code - Chip Level Units

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.

Technology StackThere are basically the following categories of chip level units.

  • Memory units
  • Arithmetic units
  • Logic units
  • Control units

Read the rest of this entry »