Week 8 Flashcards
(35 cards)
Draw out truth tables for And, Or or Xor
See 8.1 at 5 min
What is a bitwise boolean operation?
A bitwise boolean operation is applied separately to every bit of a binary codeword.
What do shift left (shiftl) and shift right (shiftr) do?
If we have Ra, Rb, Rc: shiftl shifts Rb left by Rc places and stores in Ra. We add zeroes to the end of Ra for the spaces that we’ve shifted and on the other side, the bits are shifted out and dropped off.
Similarly for shiftr, except for the other side.
What kind of number will MUL, DIV, CMPGT, CMPLT work with?
Two’s complement
What kind of number will ADD, SUB work with?
Unsigned or two’s complement
What kind of number will CMPEQ work with?
Any codewords, including non-numeric ones
What happens in R15 when we DIV?
The remainder will go into R15. It will override what is already in R15.
What is an instruction cycle?
An instruction cycle is what it takes to completely process an instruction (fetch it, then execute it!)
What is the memory cycle?
The time involved in reading or writing a single word from/to a single memory location. Memory cycle will take a fixed amount of time.
How many memory cycles does an RRR instruction use?
1 (to fetch the operation word)
How many memory cycles does a JUMP take?
To fetch it, it has two words of machine code.
So two memory cycles
What does the control unit maintain?
Information about the current and next instruction.
What two registers will you find always in a CPU?
1) instruction register: contains the operation word of the instruction being executed
2) Program counter: contains the address of the next instruction to be executed.
What are the two machine specific control registers in Sigma 16?
1) The Address Register: contains the effective address specified in an RX or X instruction. It is used to hold initially any base address that’s contained in an indexing mode.
2) The Data Register holds temporary data.
Does the number of memory cycles required to fetch the whole instruction affect the time?
Yes, the more memory cycles, the slower the instruction takes to execute/run.
Memory cycles are much slower than internal operations.
What questions do we need to ask when examining the machine code instructions on a new CPU?
1) how many memory cycles are needed to fetch the whole instruction?
2) How many cycles are needed to fetch or store data?
3) How many independent memory locations can the instruction access?
Why can’t we have multiple types of instructions in a CPU?
Many complex instructions mean a long operation word and a complex control unit.
A complex control unit with many instruction types is slower than a simple one with few types
What is RISC?
A reduced instruction set computer.
What is CISC?
Conventional machines with complex instructions.
What is a virtual machine?
it’s a software model of a machine that may or may not exist as hardware.
What is a hypervisor used for?
It’s a software that is often run on the host to create and manage new guests that can be complete copies of real machines.
Why are virtual machines useful?
They allow a certain amount of protection. It allows us to do certain experiments that might be dangerous to do on our own comp.
Confine sensitive activities.
What happens if a VM crashes?
The host will usually be fine and so will the hypervisor.
What is a subroutine?
The low level structure (assembly level structure) that support HLL functions. Rather than repeating instructions in memory, we can split the repeated instruction into a subroutine and say JUMP when the subroutine should be called and then once this is run, it returns back to the instruction.