Pipeline algorithm Problem (Threads?)

I need an algorithm that will simulate a processor executing instructions.

Each instruction is divided into 5 execution parts or stages (IF, ID, EX, MEM, WB)

Each of these parts or stages should be executed for each clock cycle.

And for each clock cycle, a new instruction (with the same 5 stages) should be activated and executed in the same manner.

Time-->Cycle1>Cycle2>Cycle3>Cycle4>Cycle5>Cycle6

Instruction1--> IF>ID>EX-->MEM-->WB

Instruction2->IF>ID>EX-->MEM- >WB

and so on.

I suspect I will use Threads on this one but I don't know how?

Any help? thanks.

[671 byte] By [onioa] at [2007-10-3 2:06:36]
# 1
Cross posted http://forum.java.sun.com/thread.jspa?threadID=758005&tstart=0
sabre150a at 2007-7-14 19:05:25 > top of Java-index,Other Topics,Algorithms...