answersLogoWhite

0

The process requires an understanding of the problem, understanding the tool, then the implementation in edit/test cycles.

For example, you would want to understand the task first. Are you required to "write a Fibonacci number sequence" as a series of Fibonacci numbers in a range from A to B (e.g. 0, 1, 1, 2, 3, 5, 8), or are you required to create a tool that can create fib(N) for any argument N? What are the value constraints for N? Is the implementation of fib() required to support any number of N, including very large numbers or even infinity?

The next step would be the selection of a suitable tool and algorithm. For example, one would want to use an assembly language based on its theoretically superior processing speed. (One might want to chose a higher-level programming language, for example in order to support portability of code to other processors.)

The selection of the algorithm is also important. The mathematical definition of the Fibonacci number can be written as fib(N) = fib(N-1) + fib(N-2). These instructions naturally suggest a recursive algorithm, however, recursive algorithms are not suitable for very large arguments due to the resulting recursion depth. Since every recursive algorithm has an iterative equivalent, an iterative approach might be a better solution.

Neither recursive nor iterative "brute force" implementations are suitable for very large arguments N, as the processing time is a function of N itself. Therefore, depending on the exact understanding of the problem, a different algorithm may need inventing.

Once the problem and its preconditions are understood, the algorithm and programming language is chosen, the solution is implemented in edit/test cycles. This process is the same whether an assembly or a higher-level language is chosen.

The exact sequence of the instructions in the chosen language depends on the choice of language, algorithm and the exact understanding of the problem. For assembly languages, the exact sequence of instructions further depend on the choice of one specific assembly language, given that each processor family has its own assembly language.

User Avatar

Wiki User

12y ago

What else can I help you with?

Continue Learning about Engineering

Write a program to print the Fibonacci series in php upto input value using recursive function?

The Fibonacci sequence uses recursion to derive answers. It is defined as: F0 = 0 F1 = 1 Fn = F(n - 1) + F(n -2) To have this sequence printed by a php script use the following: function fibonacci($n) { if($n 1) return 1; //F1 else return fibonacci($n - 1) + fibonacci($n - 2); //Fn } This recursive function will print out the Fibonacci number for the integer n. To make it print out all the numbers in a particular set add this to your script. for($i = 0; $i < 15; $i++) { echo fibonacci($i) . "<br />"; } So your final result would look like. <?php function fibonacci($n) { if($n 1) return 1; else return fibonacci($n - 1) + fibonacci($n - 2); } for($i = 0; $i < 15; $i++) { echo fibonacci($i) . "<br />"; } ?>


Is Assembly-language programs are written using binary codes?

Assembly language allows the developer to have almost total control over what the sequence of instructions will be when a program executes. A compiler tries to translate a high level language such as C++ into a series of instructions, but a good assembly language programmer may be able to optimize the sequence when a compiler cannot. Primarily assembly language is used for speed and optimal machine code.


How do you check whether a given number n is a Fibonacci number or not?

In a Fibonacci sequence, sum of two successive terms gives the third term.... here is the Fibonacci sequence: 0,1,1,2,3,5,8,13,21,34,55,89,144........ General formula to generate a Fibonacci sequence is """Fn= Fn-1 + Fn-2""" To check whether a number is Fibonacci or not follow the following steps: 1) Get the number as input from user. 2) Fix the first two numbers of sequence as 0 and 1. 3) put a sentinel loop with upper limit being the input number. 4)in the body of loop generate the next number in sequence in each iteration and continue swapping the values as follows: a=0 b=1 next=a+b while (next< input) a=b b=next next=a+b wend 5) lastly when program exits the loop compare the last number of sequence with the input number if they are equal then number is Fibonacci otherwise not. otherwise the last term of sequence will be less than the input number.


Describe the sequence of events that takes place when an interrupt is raised?

Interrupt Handling 1. Hardware stacks program counter, etc. 2. Hardware loads new program counter from interrupt vector. 3. Assembly language procedure saves registers. 4. Assembly language procedure sets up new stack. 5. C interrupt service runs (typically reads and buffers input). 6. Scheduler decides which process is to run next. 7. C procedure returns to the assembly code. 8. Assembly language procedure starts up new current process.


Where function execution ends in c language?

In C, function execution ends with the return statement or when execution encounters the last brace, }, that matches the opening brace, {. If the function is typed, such as int myfunc(), then encountering the last brace is considered an error, because that sequence returns no value.

Related Questions

Why is the Fibonacci sequence named after Fibonacci?

Leonardo Fibonacci discovered the number sequence which is named after him.


Febbonic series in assembly?

The Fibonacci series in assembly language involves generating a sequence where each number is the sum of the two preceding ones, typically starting with 0 and 1. In assembly, this can be implemented using loops and registers to store the current and previous Fibonacci numbers. The program iteratively calculates the next number in the series until a specified limit is reached. The exact implementation can vary depending on the specific assembly language syntax and architecture, such as x86 or ARM.


What are the ninth and tenth numbers in the Fibonacci sequence?

The 9th number in the Fibonacci Sequence is 34, and the 10th number in the Fibonacci sequence is 89.


Why did Fibonacci think of the Fibonacci code?

There is the Fibonacci sequence but what is the Fibonacci code?


Who was Leonardo Fibonacci?

Leonardo Fibonacci was the father and creator of the fibonacci sequence a very famous mathematic sequence


What is the 20th Fibonacci number in the sequence?

The 20th Fibonacci number in the sequence is 6,765.


What is the 16th number of the Fibonacci sequence?

The 16th number of the Fibonacci sequence is 987.


What is a Fibonacci sequence using 84?

The Fibonacci sequence requires two numbers as "seeds".


How old was Fibonacci when he discovered the Fibonacci sequence?

42


Is the Fibonacci Sequence named after Leonardo Fibonacci?

Yes.


What is the ninth term in the Fibonacci sequence?

The 9th term of the Fibonacci Sequence is 34Fibonacci Sequence up to the 15th term:1123581321345589144233377610


How do you get the Fibonacci sequence?

Start with 1 and 2. Then each number in the Fibonacci sequence is the sum of the previous two numbers in the sequence.