< previous page page_61 next page >

Page 61
9. Represent the decimal numbers (i) +123, (ii) -4321, and (iii) 00000 (zero is represented as a positive number) as:
d87111c01013bcda00bb8640fdff6754.gif
(a) Packed decimal format (in hex).
d87111c01013bcda00bb8640fdff6754.gif
(b) Unpacked decimal format (in hex).
d87111c01013bcda00bb8640fdff6754.gif
Assume a length indicator (in bytes) is specified in the instruction. Show lengths for each case.
10. The roots of a quadratic equation are:
0061-01.gif
d87111c01013bcda00bb8640fdff6754.gif
Write the assembly code for finding the two roots. The initial values of a, b, and c are stored in Addr [R1], Bddr [R1] , Cddr [R1], where R1 contains a base value that must be loaded. The results are to be stored in ROOT1[R1] and ROOT2[R1]. You may assume a square root instruction (SQRT). Using the general mnemonics presented in this chapter,
d87111c01013bcda00bb8640fdff6754.gif
(a) Write the R/M code.
d87111c01013bcda00bb8640fdff6754.gif
(b) Write the L/S code.
11. Compute T-4ac with a hardware square-root instruction using L/S and R/M instruction sets. Find the number of cycles, assuming: (a) all instructions and arguments are in memory with access time of five cycles, and (b) all instructions are in memory with access time of one cycle. Assume arithmetic operations take a single cycle. Discuss the sensitivity of each architecture to memory access time. Use study 1.1 as a guide.
12. One can use a vertical microinstruction to point to a horizontal microinstruction (sometimes called a nanoinstruction). The vertical microinstruction consists of a pointer into the horizontal microstorage. Discuss the space-time tradeoff for such a system. Create a model and evaluate.

 
< previous page page_61 next page >