|
|
|
|
|
|
|
9. Represent the decimal numbers (i) +123, (ii) -4321, and (iii) 00000 (zero is represented as a positive number) as: |
|
|
|
 |
|
|
|
|
(a) Packed decimal format (in hex). |
|
|
|
 |
|
|
|
|
(b) Unpacked decimal format (in hex). |
|
|
|
 |
|
|
|
|
Assume a length indicator (in bytes) is specified in the instruction. Show lengths for each case. |
|
|
|
|
|
|
|
|
10. The roots of a quadratic equation are: |
|
|
|
 |
|
|
|
|
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, |
|
|
|
 |
|
|
|
|
(a) Write the R/M code. |
|
|
|
 |
|
|
|
|
(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. |
|
|
|
|
|