# fetch & execute

Discussion in 'Homework Help' started by zulfi100, Mar 22, 2013.

1. ### zulfi100 Thread Starter Member

Jun 7, 2012
320
0
Hi,
Kindly guide me with the following question:
My solution is based upon 8-bit data bus is:
1. get instruction (3 units time)
2. get operand A (1 unit of time)
3. get operand X (1 unit of time)
4. Store data (1 unit of time )

total time=6 units

Plz guide me with the correct answer.

Zulfi.

2. ### WBahn Moderator

Mar 31, 2012
17,715
4,788
Presumably the values are already stored in A and X from as a resiult of executing previous instructions. Thay are just sitting there ready to use.

Is this a von Neumann machine or a Harvard architecture?

3. ### zulfi100 Thread Starter Member

Jun 7, 2012
320
0
Hi,
Thanks for your interest in this question. I have written the entire question. It does not give any more information about the architecture. Kindly tell me about the correct answer.

Zulfi.

4. ### WBahn Moderator

Mar 31, 2012
17,715
4,788
With no further information, you have to assume it is a von Neumann architecture.

So use the hint I gave in my last post.

5. ### zulfi100 Thread Starter Member

Jun 7, 2012
320
0
Hi,
Thanks for guiding me. If its von Neumann architecture then we cant access the data and instruction at the same time.
I cant understand:

Plz guide me.

Zulfi.

6. ### absf Senior Member

Dec 29, 2010
1,490
371
Using 6502 MPU as an example:

Code ( (Unknown Language)):
1.
2. LDA #\$20        ;ACC = 20H
3. LDX #\$56        ;X REG = 56H
4. STA \$3000,X    ;20H -> MEMORY(3000H + 56H)
5.
The 1st and 2nd instruction would set up the Acc and X Reg for the 3rd instruction STA \$3000,X

HTH

Allen

7. ### WBahn Moderator

Mar 31, 2012
17,715
4,788
It's like the following statement in a high level language:

y = a + b;

This statement doesn't put values in either a or b, it merely uses the values that are already in them as a result of prior statements.

In most architectures, you don't have to spend time "getting" operands that are stored in registers. In some sense that's why the registers are there - to make their contens immediately available to the instruction being executed.

8. ### zulfi100 Thread Starter Member

Jun 7, 2012
320
0
Thanks. I did not pay attention to the fact that A and X are registers.

So now:
get inst (3 units)
store (1 unit)

So total time is 4.

Is it right now?

Zulfi.

9. ### WBahn Moderator

Mar 31, 2012
17,715
4,788
That would be my best guess.

10. ### zulfi100 Thread Starter Member

Jun 7, 2012
320
0
thanks for providing me insight in this question.

Zulfi.

11. ### WBahn Moderator

Mar 31, 2012
17,715
4,788
No problemo! Glad to see you getting a handle on some of these things.