We have just surveyed the architectural details of the transputer circuit, and one example of how a manufacturer designed a multiprocessing module around it. This may be more hardware than we really want to know about!.. Be reassured, though, this was not in vain! We are now prepared to start learning how to prepare, design, and write parallel programs. The success of our approach will depend on a large part on our understanding the parallel concepts that have been added to the C compiler. These concepts directly reflect the hardware capability and limitations of the transputer.
With this in mind, let's move on to the next chapter, where we will generate our first parallel program.
| 2-3 |
Using the same pseudo assembly language used in Section 2-2, write a program that evaluates the expression below with a 3-register stack:
y = (a * x * x) + (b * x) + c
Use instructions such as MULT to represent the multiply instruction. Show the contents of the stack after each instruction. |
| 2-4 |
Write the 8086 assembly program equivalent to the code given in Section 2-2. Compare the code to that given in the text, and discuss the advantages/disadvantages of a processor with a stack-based register set. How does the stack affect the execution of instructions? |
| 2-6 |
Write the program fragment in 8086 assembly language for the same
expression as in Exercise 2-1.
|
| 2-7 |
Assume that we have four concurrent tasks running on a single
transputer. T1 is high priority, and schedules itself through the timer to run
every 5 ms for exactly 100 s. T2, T3 and T4 are low priority tasks and keep
running in a round-robin fashion for 1 s, running for full quantums of 2 ms
every time they gain access to the processor. Show the status of the four
tasks during the first 10 ms of time, assuming that T1 starts at time 0, and
that the low-priority queue contains T2, T3, and T4.
|