TWiki> Main Web>ComputerOrganizationandArchitecture2014>ArchHW122014 (2014-11-12, JimSkon) EditAttach

1. Design an expanding opcode to allow all the following to be encoded in a 32-bit instruction:

- 15 instructions with two 12-bit addresses and one 4-bit register number
- 650 instructions with one 12-bit address and one 4-bit register number
- 80 instructions with no addresses or registers

- word 20 contains 40
- word 30 contains 50
- word 40 contains 60
- word 50 contains 70

- LOAD IMMEDIATE 20
- LOAD DIRECT 20
- LOAD INDIRECT 20
- LOAD IMMEDIATE 30
- LOAD DIRECT 30
- LOAD INDIRECT 30

X = (A + B × C) / (D − E × F)

for each of the four machines. The instructions available for use are as follows:

0 Address | 1 Address | 2 Address | 3 Address |
---|---|---|---|

PUSH M | LOAD M | MOV X,Y (X = Y) | MOV X,Y (X = Y) |

POP M | STORE M | ADD X,Y (X = X+Y) | ADD X,Y,Z (X = Y+Z) |

ADD | ADD M | SUB X,Y (X = X−Y) | SUB X,Y,Z (X = Y−Z) |

SUB | SUB M | MUL X,Y (X = X∗Y) | MUL X,Y,Z (X = Y∗Z) |

MUL | MUL M | DIV X,Y (X = X/Y) | DIV X,Y,Z (X = Y/Z) |

DIV | DIV M |

M is a 16-bit memory address, and X, Y , and Z are either 16-bit addresses or 4-bit registers. The 0-address machine uses a stack, the 1-address machine uses an accumulator, and the other two have 16 registers and instructions operating on all combinations of memory locations and registers. SUB X,Y subtracts Y from X and SUB X,Y,Z subtracts Z from Y and puts the result in X. With 8-bit opcodes and instruction lengths that are multiples of 4 bits, how many bits does each machine need to compute X?

4. Compute the Boolean expression ( A AND B) OR C for

- A = 1101 0000 1010 0011
- B = 1111 1111 0000 1111
- C = 0000 0000 0010 0000

Edit | Attach | Print version | History: r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions

Topic revision: r2 - 2014-11-12 - JimSkon

Copyright &Â© by the contributing authors. All material on this collaboration platform is the property of the contributing authors.

Ideas, requests, problems regarding TWiki? Send feedback

Ideas, requests, problems regarding TWiki? Send feedback