首页 > > 详细

解析R编程、R设计辅导留学生、辅导R编程、R讲解、讲解R、R语言讲解留学生

CS-3330

Modify the Pep9 OS to support new traps. There are two options for the project:

Option 1: Implement 4 traps (as described in the problem set from Chapter 8) by choosing 1 problem from each
set below:

Set 1: Problem 26 or Problem 30.
Set 2: Problem 27 or Problem 32
Set 3: Problem 28 or Problem 31
Set 4: Problem 29

Option 2: Implement fully problem 33(a,b,c,d) from Chapter 8.

You should submit your revised OS along with suitable test program(s) to test your trap(s).

(There are at least 8 files required for option 1 and at least 2 files required for option 2.)
Here is the download link for Pep/9: http://computersystemsbook.com/5th-edition/pep9/
You should code on this Pep/9, and make sure your code works on it as well.
(Pep/9 has a big difference with pep/8 or pep/7.)

26. Implement a new unary instruction in place of NOP0 called ASL2 that does two left shifts on the accumulator.
NZC should should correlate with the new value in the accumulator from the second shift. V should be set if either
the first or the second shift produced an overflow. Use the test program provided in the Pep/9 app to test t he
features of the new instruction.

27. Implement a new nonunary instruction in place of NOP called ASLMANY whose operand is the number of times
the accumulator is shifted left. Allow only direct addressing. NZC should correlate with the new value in the
accumulator from the last shift. V should be set if any of the shifts produced an overflow. Use the test program
provided in the Pep/9 app to test the features of the new instruction.
28. Implement a new nonunary instruction in place of NOP called MULA that multiplies the operand by the
accumulator and puts the result in the accumulator. Allow only direct addressing. Use the interative shift -and-add
algorithm of Problem 6.24. NZC should should correlate with the new value in the accumulator from the last
addition. V should be set if any of the left shifts or additions produced an overflow. Use the test program provided in
the Pep/9 app to test the features of the new instruction.

29. Direct addressing is immediate addressing deferred. Indirect addressing is direct addressing deferred. You can
carry this concept one level further with double indirect addressing, which is indirect addressing deferred.
Implement a new instruction in place of NOP0 with mnemonic STWADI, which stands for store word accumulator
double indirect. It should store the accumulator using double indirect addressing. None of the status flags are
affected. NOP0 is a unary instruction as far as the assembler and CPU are concerned, but your program m ust
implement it as a nonunary instruction. You will need to increment the saved PC to skip over the operand specifier.
Use the test program provided in the Pep/9 app to test the features of the new instruction.


30. Implement a new nonunary instruction in place of NOP called BOOLO, which means Boolean output. It should
output false if the operand is zero and true otherwise. Allow immediate, direct, and stack -relative addressing. None
of the status flags are affected. Use the test program provided in the Pep/9 app to test the features of the new
instruction.

31. Implement a new unary instruction in place of NOP0 called STKADD. It should replace the two topmost items
on the stack with their sum. Set NZVC according to the results of the addition. Use the tes t program provided in the
Pep/9 app to test the features of the new instruction.

32. Implement a new nonunary instruction in place of NOP called XORA, which computes the bitwise exclusive OR
operation with the operand and the accumulator, placing the result in the accumulator. Allow only direct addressing.
Status bits NZ should be set according to the results of the operation, and VC should remain unchanged. Use the
test program provided in the Pep/9 app to test the features of the new instruction.

33. This problem is to implement new nonunary instructions to process floating point numbers. Assume that floating
point numbers are stored with all the special values of IEEE 754 but with a two-byte cell having one sign bit, six
exponent bits, nine significand bits, and a hidden bit. The exponent uses excess 31 notation except for
denormalized numbers, which use excess 30.
(a) Implement a new unary instruction in place of DECO called BINFO, which stands for binary floating point output.
Permit the same addressing modes as with DECO. The value 3540 (hex), which represents the normalized number
1.101 × 2–5, should be output as 1.101000000b011010, where the letter b stands for two raised to a power and the
bit sequence following the b is the excess 30 representation of –5. The value 0050 (hex), which represents the
denormalized number 0.00101 × 2–30, should be output as 0.001010000b-30, where the power will always be –30
for denormalized numbers. Output a NaN value as NaN, positive infinity as inf, and negative infinity as –inf.
(b) Implement a new unary instruction in place of DECI called BINFI, which stands for binary floating point input.
Permit the same addressing modes as with DECI. Assume that the input will be a normalized binary number. The
input 1.101000000b011010, which represents the normalized number 1.101 × 2–5, should be stored as 3540
(hex).
(c) Implement a new unary instruction in place of NOP called ADDFA, which stands for add floating point
accumulator. Permit the same addressing modes as with ADDA. For normalized and denormalized numbers, you
may assume that the exponent fields of the two numbers to add are identical, but the exponent field of the sum may
not be the same as the initial exponent fields. Your implementation will need to insert the hi dden bit before
performing the addition and remove it when storing the result. Take into account the possibility that one or both of
the operands may be a NaN or infinity.
(d) Work part (c) assuming the exponent fields of the normalized or denormalized numbers may not be identical.
 

联系我们
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp
热点标签

联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!