EASY Processor design - MIPS Q.1 What happens when a register is loaded? 1. The bits of the register are set to all ones. 2. The bit pattern in the register is copied to a location in memory. 3. A bit pattern at a memory location is copied to the register. The memory is set to all zeros. 4. A bit pattern at a memory location is copied to the register. Memory is not changed. Q.2 What happens when a register is stored? 1. The bits of the register are set to all ones. 2. The bit pattern in the register is copied to a location in memory. 3. A bit pattern at a memory location is copied to the register. The memory is set to all zeros. 4. A bit pattern at a memory location is copied to the register. Memory is not changed. Q.3 By software convention, the machine instructions of a program are put in a designated section of memory. What is this section called? 1. Data segment. 2. Stack segment. 3. Program segment. 4. Text segment. Q.4 What general purpose register is permanently set to thirty-two zero bits? 1. $0 2. $1 3. $31 4. $32
Q.5 What part of the processor chip performs arithmetic and logical operations? 1. CPU 2. ALU 3. ROM 4. PCI Q.6 Where do the operands for an arithmetic machine instruction come from? 1. Both operands are registers. 2. Both operands come from memory. 3. One operands must be a register, the other one may be memory or a register. 4. One operand must be a register, the other may be a register or may be part of the machine instruction. Q.7 What is an opcode? 1. The part of a machine instruction that designates the data to be used. 2. A bit field, part of a machine instruction that designates a machine operation. 3. The part of the processor chip that performs decoding operations. 4. The part of a machine instruction that is used as data in an operation. Q.8 So what size bit field must a machine instruction use to designate a register? 1. 3 2. 4 3. 5 4. 16 MEDIUM Q.9 What is the mnemonic name of a register? 1. A register number like $0 or $31.
2. A name that helps you remember the hardware characteristics of the register. 3. The bit pattern that designates the register in a machine instruction. 4. A name like $s0 that helps you remember the conventional software uses for the register. Q.10 In what order should be the three steps of the machine cycle? 1. fetch, increment, execute. 2. Execute, fetch, increment. 3. Fetch, execute, increment. 4. increment, fetch, execute. Q.11 PC should be incremented by how many bytes to read the next instruction in sequence? 1. 2 2. 4 3. 5 4. 8 Q.12 Which format does arithmetic expression use? 1. R-type 2. J-type 3. B-type 4. I-type Q.13 What are the four bytes immediately following a jump instruction called? 1. fetch delay slot 2. pipeline delay slot 3. branch delay slot 4. PC advance slot Q.14 What is a pipeline?
1. Several words of data from memory are moved into the processor before instructions need them. 2. Several sequential instructions are simultaneously prepared for execution while one instruction finishes its execution. 3. A single instruction is divided into four phases and each phase is executed in one machine cycle. 4. Multiple items of data are sent down the system bus like water in a pipe. Q.15 Say that a sll instruction is located in memory at address 0x400100, and an add instruction is located in memory at address 0x400104. After the add instruction executes, what value will be in the PC? 1. 0x400100 2. 0x400104 3. 0x400105 4. 0x400108 Q.16 Say that a j (jump) instruction is located in memory at address 0x400100, and a sll instruction is located in memory at address 0x400104. After the j instruction executes, what value will be in the PC? 1. 0x400100 2. 0x400101 3. 0x400102 4. 0x400104 Q.17 Here is a schematic program loop.
What numbers go into the two blanks? 1. 14, 08 2. 14, 00 3. 00, 08 4. 14, 18 HARD Q.18 Here is a 32-bit j instruction. The first 6 bits are the op-code. 000010 00 0001 0000 0000 0000 0000 1000 Here is the value of the PC while the target address is being constructed: 0000 1000 0001 0000 0000 1100 0110 1000 What address does the j put into the PC? 1. 0000 00 0001 0000 0000 0000 0000 1000 00 2. 0000 1000 0001 0000 0000 1100 0110 1000 3. 0000 10 0001 0000 0000 1100 0110 1000 00 4. 1000 00 0001 0000 0000 0000 0000 1000 00 Q.19 Examine the following program fragment. The program is to add $5 and $6 together only if they are not equal. Pick instructions to fill the blanks. 1. beq ; addu 2. bne ; sll 3. bne ; addu
4. beq ; sll Q.20 Here is an if-then-else structure. The code is to compare $10 and $11. If these registers contain the same bit pattern, set register $7 to 1. Otherwise set $7 to 0. Which choices should fill the blanks? 1. bne ; equal ; join 2. beq ; join ; equal 3. beq ; equal ; join 4. bne ; join ; equal Q.21 Say that registers $5 and $6 each contain an ASCII character in the low order byte. Can the beq instruction be used to compare the characters? 1. Yes, because beq will recognize the character data and do a character comparison. 2. No, because beq only works with two's complement integers. 3. No, because beq only works with full 32-bit data. 4. Yes, because beq compares bit patterns regardless of what they represent. Q.22 What operation copies data from main memory into a general purpose register?
1. load 2. store 3. move 4. add Q.23 Which one of the following addresses is word aligned? 1. 0x01234567 2. 0x00FA0700 3. 0x77000003 4. 0x00000042 Q.24 Say that four bytes in main storage contain (bits that represent) a 32-bit integer. What is the address used for this integer? 1. The address of the byte with the highest address of the four. 2. The address of each byte is used. 3. Only one byte at a time can be addressed. 4. The address of the byte with the lowest address of the four. Q.25 Here is a 32-bit pattern: 0x00224477. This pattern is to be stored in main memory using bytes at addresses 0x10000000, 0x10000001, 0x10000002, and 0x10000003. On a big endian processor, what bit pattern is contained in address 0x10000000? 1. 0x00 2. 0x22 3. 0x44 4. 0x77 Q.26 A lw is to load register $5 from location 0x0040000C in memory. Register $10 contains 0x00400000. Write the assembly language instruction: 1. lw $10, 0x0C($10) 2. lw $10, 0x0C($5) 3. lw $5, 0x0C($10)
4. lw $5, 0x0C(400000) Q.27 Register $10 contains 0x100000000. Beginning at that address there are five integers in a row. Write the instruction that loads the last integer into register $7. 1. lw $7, 50($10) 2. lw $7, 20($10) 3. lw $7, 16($10) 4. lw $7, 40($10) Q.28 Register $5 contains the address 0x10000100. Write the instruction that loads the four bytes that precede this address into register $7. 1. lw $7, 4($5) 2. lw $7, -4($5) 3. lw $5, 4(-$5) 4. lw $7, 0($5-4) Q.29 Write the assembly instruction that fills register $10 with 0x10000000 1. lui $10, 0x1000 2. lui $10, 0x10000000 3. ori $10, $0, 0x10000000 4. ori $10, $10, 0x1000 Q.30 Say that somehow register $10 has been loaded with the address 0x10000000. Write the instruction that alters $10 so that it contains 0x100000F0. 1. ori $10, $0, 0x00F0 2. or $10, $10, 0x00F0 3. ori $10, $10, 0x00F0 4. andi $10, $10, 0x00F0 Answered:- 1. 4
2. 2 3. 4 4. 1 5. 2 6. 4 7. 2 8. 3 9. 4 10. 1 11. 2 12. 1 13. 3 14. 2 15. 4 16. 4 17. 1 18. 1 19. 4 20. 3 21. 4 22. 1 23. 2 24. 4 25. 1 26. 3 27. 3 28. 2 29. 1 30. 3