Computer Systems

?
  • Created by: kreselle
  • Created on: 02-06-21 10:27

1. How does a programmer finish a program in Hack Assembler?

  • By specifying a label followed by an instruction that unconditionally jumps to itself.
  • By setting the address of the A register to zero.
  • By using a halt instruction
  • By including an instruction that is all zero bits at the end of the code and then jumping conditionally to that instruction.
1 of 12

Other questions in this quiz

2. In the Hack machine there is an A register to hold the contents of the A-instruction but there is no equivalent register to hold the values of the C-instruction. Why not?

  • The fact that instruction memory is ROM in the hack machine design means that a C register is not necessary. If the instruction memory were RAM then there would be a need to store the instruction in a C-register.
  • The C register is not needed because we make use of the A-register to hold the C-instruction while decoding takes place.
  • Because it is possible to wire up the hack CPU so that the wires holding the instruction can be routed directly to the chips controlling the CPU without the need for an intervening C-register.
  • The premise of the question is wrong - there is a C register in the hack machine.

3. Consider the following diagram for a DMUX

dmux.png

where the unselected output wires are set to zero. Would a dmux still be a useful chip if these values were always set to 1? Explain your answer.

  • Yes. You might have to invert this signal or change the expected interpretation of this signal.
  • Yes. It doesn't matter what is on these inputs.
  • No. The ones make the output of the dmux unpredictable.
  • No. It would render the dmux useless because all of the rest of the machine would be expecting a zero in this place rather than a one and there is nothing we could do to fix it.

4. Which of the following statements is not true?



A. SRAM is used in cache and is faster than DRAM.

B. Read operations on RAM and ROM are not controlled by a clock.

C. SRAM and DRAM do not need power to maintain data.

D. The width of a word could vary

  • C
  • A
  • B
  • C

5. Why is the following instruction - which is valid hack assembler - unlikely to be useful when run on the Hack machine?

D=M;JMP

  • Because it implicitly overwrites the A register and then jumps to that overwritten location.
  • Because it accesses the data memory at M using A and then also jumps to that same A address in ROM. It is very unlikely that this address is useful in both memories at the same time.
  • The a register gets used and reset by its use in accessing M leaving it set to zero for the jump which returns it to the start of the program which is very rarely what you want.
  • Because we can't combine jumps with other instructions in C-instructions.

Comments

No comments have yet been made

Similar Computing resources:

See all Computing resources »See all Computer Systems resources »