Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The function F is defined as F(1) = F(2) = F(3) = 1 and for n ? 3, F(n + 1) = F(n) + (F(n

The function F is defined as F(1) = F(2) = F(3) = 1 and for n ? 3, F(n + 1) = F(n) + (F(n ? 1) F(n ? 2)) i.e., the (n + 1)th value is given by the sum of the nth value and the product of the (n ? 1)th and (n ? 2)th values. (a) Write an assembly program for computing the kth value F(k), where k is an integer bigger than 3 read from a memory location M, and storing F(k) at memory location M.

Use the instruction set in the Instruction Set Architecture below:

LOAD a, b a <- b

STOR a, b a <- b

ADD a, b, c a <- b + c

SUB a, b, c a <- b - c

MUL a, b, c a <- b * c

DIV a, b, c a <- b / c

AND a, b, c a <- b & c

OR a, b, c a <- b | c

NOT a, b a <- !b

ASH a, b, c r <- b (arithmetically) shifted by c positions

LSH a, b, c a <- b (logically) shifted by c positions

BR a PC <- a

BEQ a, b, c PC <- a if b is equal to c

BNE a, b, c PC <- a if b is not equal to c

BLT a, b, c PC <- a if b is less than c

BGT a, b, c PC <- a if b is greater than c

BLE a, b, c PC <- a if b is less than or equal to c

BGE a, b, c PC <- a if b is greater than or equal to c

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Hands-On Database

Authors: Steve Conger

2nd Edition

0133024415, 978-0133024418

More Books

Students also viewed these Databases questions

Question

Calculate Cohens d^ for the data in Exercise 14.15.

Answered: 1 week ago

Question

Explain the global implications for recruitment.

Answered: 1 week ago

Question

Describe what competencies and competency modeling are.

Answered: 1 week ago

Question

Summarize job design concepts.

Answered: 1 week ago