Subscribe To Robotics | IntroDuction | History | Home


Friends Dont Forget To check the archieve at the left end of the page



Make Your Own Robot Tutoials



Simple Beetle Bot | Wired Robot | Combat Robot | Solar Engine |



Beam Symet | Photopopper | Beam Trimet | Line Follower |

Latest Updates
Driver Less Car | I-Sobot | MotherBoard | MicroController | Artificial Brain |

Camera Sensors Hardware | Remote Control Working

Google

Wednesday, July 23, 2008

LINEAR PROGRAM EXECUTION

Modern computer systems, regardless of their sophistication, are really nothing more than electronic circuits that read instructions from their memory in order and execute them as they are received. This may fly in the face of your perception of how a computer program works; especially when you are familiar with working on a PC in which different dialog boxes can be brought up at different times and different buttons or controls can be accessed randomly and not in any predefined sequence.

By saying that a computer program is a sequence of instructions that are read and executed may seem to belittle the amount of work that goes into them along with the sophistication of the operations they perform, but this is really all they are.
A sequence of instructions to latch data from a storage location into an external register using two I/O registers (one for data and one for the register clock line) could be:

Address Instruction

1 I/O Port 1 = All Output
2 I/O Port 2 = 1 Clock Output Bit
3 I/O Port 2 Clock Output Bit = Low
4 Holding Register = Storage Location "A"
5 I/O Port 1 = Holding Register
6 I/O Port 2 Clock Output Bit = High
7 I/O Port 2 Clock Output Bit = Low

In this sequence of instructions, the address each instruction is stored in has been included to show that each incrementing address holds the next instruction in sequence for the program. The first computers could only execute the sequence of instructions as-is and not modify the execution in any way. Modern computers have been given the ability to change which section of instruction sequence is to be executed, either always or conditionally.

The following sequence of instructions will latch the values of one to five into the external register by conditionally changing the section of the instruction sequence to be executed, based on the current value.

Address Instruction
1........................................... Holding Register = 1
2........................................... Storage Location "A" = Holding Register
3........................................... I/O Port 1 = All Output
4........................................... I/O Port 2 = 1 Clock Output Bit
5........................................... I/O Port 2 Clock Output Bit = Low
6........................................... Holding Register = Storage Location "A"
7........................................... I/O Port 1 = Holding Register
8........................................... I/O Port 2 Clock Output Bit = High
9........................................... I/O Port 2 Clock Output Bit = Low
10........................................... Holding Register = Storage Location "A"
11........................................... Holding Register = Holding Register + 1
12........................................... Storage Location "A" = Holding Register
13........................................... Holding Register = Holding Register - 5
14 If Holding Register Does Not Equal 0, Next Execution Step is 6

In the second program, after the contents of ‘Holding Register “A” ’ have 1 added to them, the value has 5 subtracted from it and if the result is not equal to zero, execution continues at address 6 rather than ending after address 14. Note that data from a “Storage Location” cannot pass directly to an output port nor can mathematical operations be performed on it without storing the contents in the “Holding Register” first.

In this simple program, you can see many of the programming concepts listed in operation, and while they will seem unfamiliar to you, the operation of the program should be reasonably easy to understand. The sequential execution of different instructions is known as linear program execution and is the basis for program execution in computers.

To simplify the creation of instruction sequences, you will be writing your software in what is known as a high-level language or, more colloquially, a programming language. The programming language is designed for
you to write your software (or code) in a format similar to the English language, and a computer program known as a compiler will convert it into the sequence of instructions needed to carry out the program.

No comments: