Unit 1 - Practice Quiz

CSE211 61 Questions
0 Correct 0 Wrong 61 Left
0/61

1 What part of an instruction code specifies the operation to be performed?

instruction codes Easy
A. Opcode
B. Address
C. Mode bit
D. Operand

2 Which register holds the memory address of the next instruction to be fetched?

computer registers Easy
A. Data Register (DR)
B. Accumulator (AC)
C. Instruction Register (IR)
D. Program Counter (PC)

3 A group of parallel wires that connects several components in a computer system for communication is called a(n) __.

common bus system Easy
A. Bus
B. Port
C. Link
D. Channel

4 What are the two fundamental phases of the instruction cycle?

instruction cycle Easy
A. Fetch and Execute
B. Read and Write
C. Input and Output
D. Start and Stop

5 Which memory-reference instruction is typically used to load data from a memory location into the Accumulator (AC)?

memory reference instructions Easy
A. ADD (Add to Accumulator)
B. LDA (Load Accumulator)
C. BUN (Branch Unconditionally)
D. STA (Store Accumulator)

6 Which unit within the CPU is responsible for generating timing and control signals to manage instruction execution?

timing and control Easy
A. Arithmetic Logic Unit (ALU)
B. Control Unit (CU)
C. Memory Management Unit (MMU)
D. Register Array

7 What is an interrupt?

input-output and interrupt Easy
A. A memory access violation
B. A command to shut down the computer
C. A syntax error in a program
D. A signal from a device seeking the attention of the CPU

8 In the Little Man Computer (LMC) simulation, what is the function of the INP instruction?

lmc(simulation software) Easy
A. To print the value from the accumulator to the output
B. To halt the program
C. To take an input value and store it in the accumulator
D. To add a value from memory to the accumulator

9 In a basic computer, which register holds the instruction that is currently being executed?

computer registers Easy
A. Instruction Register (IR)
B. Program Counter (PC)
C. Accumulator (AC)
D. Address Register (AR)

10 An instruction that performs an operation on data stored in registers without accessing memory is called a(n) __.

computer instructions Easy
A. Input-Output instruction
B. Register-reference instruction
C. Data-transfer instruction
D. Memory-reference instruction

11 During the fetch phase of the instruction cycle, what action is performed?

instruction cycle Easy
A. The Program Counter is reset to zero
B. An instruction is read from memory into the IR
C. The operation specified by the instruction is performed
D. The result is written back to memory

12 A system bus is typically composed of which three types of lines?

common bus system Easy
A. CPU, Memory, and I/O lines
B. Serial, Parallel, and USB lines
C. Input, Output, and Power lines
D. Data, Address, and Control lines

13 The part of an instruction that specifies the address of the data or the data itself is called the __.

instruction codes Easy
A. Opcode
B. Control code
C. Fetch code
D. Operand

14 What is the primary function of the Accumulator (AC) register?

computer registers Easy
A. To store the next instruction's address
B. To hold the currently executing instruction
C. To hold intermediate arithmetic and logic results
D. To buffer data from the bus

15 What does the STA (Store Accumulator) instruction do?

memory reference instructions Easy
A. Stops the computer's execution
B. Loads the Accumulator from a memory location
C. Stores the content of the Accumulator into a memory location
D. Adds a value from memory to the Accumulator

16 A single, discrete pulse of a processor's clock, which acts as a fundamental unit of time for CPU operations, is known as a __.

timing and control Easy
A. Instruction cycle
B. Machine cycle
C. Fetch cycle
D. Clock cycle

17 Instructions that are used to communicate between the computer and its peripheral devices are known as __.

computer instructions Easy
A. Logic instructions
B. Memory-reference instructions
C. Input-Output instructions
D. Register-reference instructions

18 Immediately after an instruction is fetched from memory, what is the next step performed by the Control Unit?

instruction cycle Easy
A. Store the result
B. Decode the instruction
C. Fetch the operands
D. Execute the instruction

19 In the Little Man Computer (LMC) analogy, which component is responsible for keeping track of the next instruction to be executed?

lmc(simulation software) Easy
A. Program Counter
B. Calculator
C. In-basket
D. Mailboxes

20 When an interrupt occurs, the processor typically saves its current state and executes a special routine called a(n) __.

input-output and interrupt Easy
A. Interrupt Service Routine (ISR)
B. Main Program Routine (MPR)
C. System Call Routine (SCR)
D. Hardware Check Routine (HCR)

21 A computer's instruction format is 16 bits long. It has 4 bits for the opcode. What is the maximum number of directly addressable memory locations and the maximum number of operations this computer can support?

instruction codes Medium
A. 4096 memory locations, 4 operations
B. 12 memory locations, 4 operations
C. 4096 memory locations, 16 operations
D. 65536 memory locations, 16 operations

22 A CPU has 64 registers and an instruction set of 120 different operations. For an instruction with the format OP R1, Address, where R1 is a register and Address refers to a memory space of 8192 words, what is the minimum number of bits required for this instruction?

instruction codes Medium
A. 25 bits
B. 26 bits
C. 27 bits
D. 32 bits

23 During the execution of an instruction ADD R1, [100H], which involves fetching an operand from memory, which two registers are critically involved in the memory read operation?

computer registers Medium
A. Accumulator (AC) and Program Counter (PC)
B. Program Counter (PC) and Instruction Register (IR)
C. Instruction Register (IR) and Memory Address Register (MAR)
D. Memory Address Register (MAR) and Memory Data Register (MDR)

24 After an arithmetic operation, such as SUB R2, R3, completes, which special-purpose register would be updated to reflect conditions like whether the result was zero, negative, or caused an overflow?

computer registers Medium
A. Program Counter (PC)
B. Status Register / Flag Register
C. Memory Address Register (MAR)
D. Instruction Register (IR)

25 A common bus system is designed to connect 32 registers, each 16 bits wide, using multiplexers. What is the size (number of inputs) of each multiplexer and how many total multiplexers are required?

common bus system Medium
A. 5x1 multiplexers, 16 are required
B. 32x1 multiplexers, 16 are required
C. 32x1 multiplexers, 32 are required
D. 16x1 multiplexers, 32 are required

26 In a bus system using tri-state buffers, what must be true for a device to successfully place data onto the bus?

common bus system Medium
A. The bus arbitration logic must grant it priority over all other devices
B. Its chip select signal must be low, regardless of other devices
C. Its clock signal must be synchronized with the bus clock
D. Its output enable signal must be asserted (active), and all other devices' output enables must be de-asserted

27 An instruction ADD R1, (R2)+ is found in a processor's instruction set. This instruction adds the content of the memory location pointed to by R2 to R1, and then increments R2. This is an example of which addressing mode?

computer instructions Medium
A. Auto-increment addressing
B. Immediate addressing
C. Indirect addressing
D. Indexed addressing

28 For a zero-address (stack-based) architecture, which of the following instruction sequences correctly evaluates the expression X = (A - B) * C?

computer instructions Medium
A. PUSH A; PUSH B; SUB; PUSH C; MUL; POP X
B. LOAD A; SUB B; MUL C; STORE X
C. POP X; PUSH C; MUL; PUSH B; SUB; PUSH A
D. PUSH A; PUSH B; PUSH C; SUB; MUL; POP X

29 In a micro-programmed control unit, where is the logic for generating control signals for each instruction stored?

timing and control Medium
A. In a special memory called the Control Memory (or Control Store)
B. Directly within the Instruction Register (IR)
C. In the Arithmetic Logic Unit (ALU)
D. In a complex combinational logic circuit (decoder/encoder)

30 A processor with a 4 GHz clock executes a program in which the average instruction takes 5 clock cycles to complete. What is the average instruction execution time?

timing and control Medium
A. 5 nanoseconds
B. 1.25 microseconds
C. 0.8 nanoseconds
D. 1.25 nanoseconds

31 During which phase of the instruction cycle is the content of the Program Counter (PC) placed into the Memory Address Register (MAR)?

instruction cycle Medium
A. Write-back
B. Decode
C. Fetch
D. Execute

32 An indirect memory reference instruction like LDA @ADDR requires an additional step compared to a direct reference. What occurs during this extra step within the instruction cycle?

instruction cycle Medium
A. The instruction is fetched from the cache instead of main memory
B. The Program Counter is incremented a second time
C. The effective address of the operand is fetched from memory
D. The ALU performs a preliminary calculation

33 Consider a conditional branch instruction like BNE (Branch if Not Equal). The decision to actually change the Program Counter (PC) to the branch target address is made during which phase of the instruction cycle?

instruction cycle Medium
A. Fetch
B. Execute
C. Interrupt
D. Decode

34 The BSA (Branch and Save Address) instruction is fundamental for implementing which high-level programming construct?

memory reference instructions Medium
A. For loops
B. If-else statements
C. Array declarations
D. Subroutine/Function calls

35 The ISZ X (Increment and Skip if Zero) instruction is executed. The initial value at memory location X is -1. What is the value at location X and what happens to the Program Counter (PC) after the instruction completes?

memory reference instructions Medium
A. Value at X becomes 0, and the PC is incremented once (not skipped)
B. Value at X remains -1, and the PC is incremented once (not skipped)
C. Value at X becomes -2, and the PC is incremented once (not skipped)
D. Value at X becomes 0, and the PC is incremented twice (skipped)

36 What is the primary advantage of using Direct Memory Access (DMA) for data transfer over interrupt-driven I/O?

input-output and interrupt Medium
A. It transfers large blocks of data without continuous CPU intervention, freeing the CPU for other tasks.
B. It is simpler to implement in hardware.
C. It provides a faster response time to I/O events.
D. It eliminates the need for a system bus.

37 When a CPU receives an interrupt signal, what is the most critical information that the hardware must save automatically before jumping to the Interrupt Service Routine (ISR)?

input-output and interrupt Medium
A. The address of the I/O device
B. The contents of all general-purpose registers
C. The data from the I/O device that caused the interrupt
D. The Program Counter (PC) and the current state of the processor (Status Register)

38 An LMC program has these instructions in mailboxes 00, 01, and 02: LDA 99, SUB 98, STA 97. If mailbox 99 contains 015 and mailbox 98 contains 008, what are the final values in the Accumulator and mailbox 97 after the program runs?

lmc(simulation software) Medium
A. Accumulator: 007, Mailbox 97: 008
B. Accumulator: 023, Mailbox 97: 023
C. Accumulator: 015, Mailbox 97: 007
D. Accumulator: 007, Mailbox 97: 007

39 In the Little Man Computer (LMC), an instruction BRA 50 is located at mailbox 20. What is the direct effect of this instruction on the Program Counter (PC)?

lmc(simulation software) Medium
A. The PC is set to 50
B. The PC is incremented by 50
C. The PC is set to 21
D. The PC is set to 49

40 A RISC (Reduced Instruction Set Computer) architecture primarily differs from a CISC (Complex Instruction Set Computer) architecture in that:

computer instructions Medium
A. RISC architectures have more addressing modes than CISC.
B. RISC instructions are of fixed length and most can be executed in a single clock cycle.
C. RISC instructions perform more memory-to-memory operations than CISC.
D. RISC uses micro-programming for its control unit, whereas CISC is hardwired.

41 A 32-bit computer architecture uses an expanding opcode scheme. It supports 60 instructions with two register operands and 250 instructions with one register operand. The machine has 64 registers. A 6-bit primary opcode is used. If 60 of the primary opcodes are assigned to two-register instructions, and one of the remaining four primary opcodes is used as an escape prefix for a secondary opcode field, what is the maximum number of zero-operand instructions possible if the 1-operand and 0-operand instructions must be differentiated within a shared 14-bit secondary opcode space, and the 1-operand instructions are allocated a block of 256 slots in that space for implementation simplicity?

instruction codes Hard
A. 16,074
B. 65,280
C. 16,128
D. 16,384

42 A CPU and a DMA controller are connected to a synchronous bus operating at 100 MHz. A memory read or write operation takes 3 clock cycles. The DMA controller uses cycle stealing to transfer 8 KB of data from a device to memory. During the DMA transfer, the CPU is executing a program that, without interference, would take 1 millisecond. Assuming the DMA controller can transfer one 32-bit word per memory operation, what is the percentage slowdown of the CPU program due to DMA activity?

common bus system Hard
A. 6.14%
B. 1.23%
C. 0.61%
D. 2.05%

43 An interrupt occurs during the execution phase of a multi-cycle BSA M (Branch and Save Address) instruction, precisely after the program counter (PC) has been stored at the effective address M, but before the PC is updated with M+1. Assuming the hardware automatically saves only the PC and status register to the stack upon an interrupt, what is the most critical issue the Interrupt Service Routine (ISR) must address before executing an IRET (Interrupt Return)?

instruction cycle Hard
A. The content of the accumulator might be corrupted and must be restored from a predefined memory location.
B. The memory location M now contains the wrong return address, and the ISR must fetch the correct address from the instruction register (IR), which still holds the BSA instruction.
C. The ISR must manually increment the saved PC on the stack to point to M+1 before returning.
D. The value pushed to the stack as the return address is M, not the address of the instruction following the BSA, leading to an incorrect program flow upon return.

44 Consider a computer that adds a new instruction: SWPM R1, (R2). This instruction swaps the content of register R1 with the content of the memory location whose address is in register R2. Which of the following sequence of micro-operations, using a temporary register TEMP, correctly implements the execution phase of this instruction on a single-bus architecture?

computer registers Hard
A. 1. MAR <- R2, 2. MBR <- R1, 3. TEMP <- M[MAR], 4. M[MAR] <- MBR, 5. R1 <- TEMP
B. 1. TEMP <- R1, 2. MAR <- R2, 3. MBR <- M[MAR], 4. R1 <- MBR, 5. MBR <- TEMP, 6. M[MAR] <- MBR
C. 1. MAR <- R2, 2. TEMP <- M[MAR], 3. MBR <- R1, 4. M[MAR] <- MBR, 5. R1 <- TEMP
D. 1. MAR <- R2, 2. Memory Read, 3. TEMP <- MBR, 4. MBR <- R1, 5. Memory Write, 6. R1 <- TEMP

45 To compute X = (A - B) / (C * D), how many more memory access cycles (for both instructions and data) are required on a 1-address (accumulator-based) machine compared to a 2-address (register-memory) machine? Assume all variables (A, B, C, D, X) are in memory, opcodes are 1 byte, addresses are 2 bytes, and data values are 1 word. A memory access reads or writes one word.

computer instructions Hard
A. 3
B. 9
C. 7
D. 5

46 A CPU has a 16-bit instruction format and 32 general-purpose registers. The instruction set is divided into two formats: a register-to-register format (two register operands) and a register-memory format (one register operand, one memory address). If the designers have already created 28 register-to-register instructions, what is the theoretical maximum number of register-memory instructions that can be added to the instruction set, assuming the memory address field for this format uses all available bits after the opcode and register fields?

instruction codes Hard
A. 1,024
B. 2,020
C. 1,152
D. 7,168

47 A system uses a synchronous bus operating at 100 MHz where a memory read/write operation takes 3 clock cycles. A DMA controller using cycle stealing needs to transfer 8 KB of data. Concurrently, a CPU is executing a program that involves 1 million instructions with an average CPI of 1.5, and 30% of these instructions are memory load/store operations. What is the total time (in milliseconds) to complete both the DMA transfer and the CPU program?

common bus system Hard
A. 1.500 ms
B. 1.614 ms
C. 1.561 ms
D. 1.592 ms

48 A CPU's hardwired control unit is being modified to add a BCZ R1, R2, Addr instruction (Branch to Addr if R1 equals R2, else continue). The comparison is performed by the ALU by calculating R1 - R2. Which logic expression correctly represents the condition to load the Addr into the PC at the end of the execution cycle (e.g., at time T5)? Let Z be the zero flag from the ALU, IR[op] be the decoded opcode for BCZ, and T5 be the timing signal.

timing and control Hard
A. PC \leftarrow Addr \text{ if } (IR[op] \land Z \land T5)
B. PC \leftarrow Addr \text{ if } (IR[op] \land Z) \lor T5
C. PC \leftarrow PC + 1 \text{ if } (IR[op] \land \neg Z \land T5)
D. PC \leftarrow Addr \text{ if } (IR[op] \lor Z) \land T5

49 A 16-bit computer has an instruction LDA ADDR where the opcode is 4 bits and ADDR is a 12-bit field. The instruction supports auto-increment indirect addressing, denoted as LDA @(ADDR)+. This means the effective address is the content of M[ADDR], and after fetching the operand, the value at M[ADDR] is incremented. Given the initial state: PC=0x100, AC=0, M[0x100]=0x7300 (LDA @(300)+), M[0x300]=0x550, M[0x550]=0xABCD. What are the contents of AC and M[0x300] after the instruction at 0x100 is executed?

memory reference instructions Hard
A. AC = 0x0300, M[0x300] = 0x0551
B. AC = 0x0550, M[0x300] = 0x0301
C. AC = 0xABCD, M[0x300] = 0x0551
D. AC = 0xABCD, M[0x300] = 0x0550

50 A system uses daisy-chain interrupt arbitration. Three devices, D1, D2, and D3, are connected in that physical order. The priority is intended to be D3 (highest), D1 (middle), D2 (lowest). Which statement accurately describes the required wiring and a potential major drawback of this specific non-standard priority configuration?

input-output and interrupt Hard
A. The connections must be D3->D1->D2. A drawback is that this scheme increases the interrupt latency for D3 compared to a standard physical priority setup.
B. The connections must be D3->D1->D2. A drawback is that if device D1 fails, D2 cannot raise an interrupt.
C. The connections must be Arbiter->D3->D1->D2. A drawback is that if D3 is busy, it cannot pass the grant signal to D1 or D2.
D. The connections must be Arbiter->D2->D1->D3. This is impossible as priority is determined by physical location in a daisy chain.

51 Consider the following Little Man Computer (LMC) program loaded starting at mailbox 00. If the Program Counter is erroneously initialized to 03 instead of 00, and the user inputs the value 7, what will be the final value in the accumulator when the program halts?

lmc(simulation software) Hard
A. 0
B. The program will enter an infinite loop.
C. 14
D. 49

52 A processor is executing an instruction ADD R1, [R2]. During the execute phase, a page fault interrupt occurs when trying to read the memory location pointed to by R2. The micro-operations for a memory read are: T1: MAR <- R2, T2: MBR <- M[MAR], Control Signal READ. The page fault is detected at the end of T2. If the instruction is to be restartable, what is the state of R1, R2, MAR, MBR and the PC just before the interrupt service routine begins?

computer registers Hard
A. PC points to the ADD instruction, R1 holds its original value, R2 is unchanged, MAR holds the faulting address, MBR contains invalid data.
B. PC points to the next instruction, R1 holds its original value, R2 is unchanged, MAR holds the faulting address, MBR contains invalid data.
C. PC points to the next instruction, R1 has been overwritten, R2 is unchanged, MAR holds the faulting address, MBR is cleared.
D. PC points to the ADD instruction, R1 holds its original value, R2 has been incremented, MAR is cleared, MBR is cleared.

53 A 32-bit wide, non-multiplexed asynchronous bus uses a full handshake protocol (assertion of MSYN, followed by SSYN, de-assertion of MSYN, de-assertion of SSYN). The memory access time is 50 ns, and the propagation delay on the bus is 5 ns. The master and slave devices have internal processing delays of 10 ns for any signal change. What is the approximate data transfer rate for read operations?

common bus system Hard
A. ~23.5 MB/s
B. ~18.2 MB/s
C. ~30.8 MB/s
D. ~40.0 MB/s

54 In a microprogrammed control unit, a branch microinstruction needs to perform a 4-way branch based on the state of two status bits (e.g., Zero and Negative flags). To implement this in a single clock cycle, what is the most efficient architectural approach?

timing and control Hard
A. Use a bit-masking technique where the status bits are directly OR-ed with the base address field of the microinstruction to generate the final target address.
B. Execute four sequential conditional branch microinstructions, each testing one of the four possible flag combinations.
C. Use a variable-format microinstruction where the address field is expanded to accommodate four potential target addresses.
D. Use a dedicated 4x1 multiplexer controlled by the status bits to select one of four fixed addresses stored in a special ROM.

55 A system is being designed with a 12-bit address bus and a 16-bit data bus. The designers want to have an instruction format that includes a 3-bit opcode, a 2-bit addressing mode specifier, and a direct memory address. What is the primary architectural conflict or limitation imposed by these design choices?

instruction codes Hard
A. The 16-bit data bus is underutilized as instructions are only 12 bits wide.
B. The memory address space (4 KB) cannot be fully utilized by the instruction's address field.
C. The number of possible instructions (8) is insufficient for a general-purpose computer.
D. The instruction format itself requires more than 16 bits, making it impossible to fetch in a single memory read.

56 A computer uses a 16-bit word length. Its ISZ M (Increment and Skip if Zero) instruction increments the value at memory location M and skips the next instruction if the new value is zero. A programmer writes a loop to clear a 10-byte region of memory from address 0x200 to 0x209. They use location CTR (at address 0x100) as a counter. What initial value must be stored in CTR for the loop to execute exactly 10 times?

memory reference instructions Hard
A. -10 (in two's complement, 0xFFF6)
B. 10 (0x000A)
C. 255 (0x00FF)
D. -9 (in two's complement, 0xFFF7)

57 A DMA controller is transferring data from an I/O device to memory at 4 MB/s in burst mode. The CPU can execute instructions at 200 MIPS. The DMA setup takes 1000 CPU instructions, and handling the interrupt upon completion takes another 500 instructions. If data is transferred in 16 KB blocks, what percentage of the CPU's time is consumed by managing the DMA transfer (including setup, interrupt handling, and bus contention)?

input-output and interrupt Hard
A. ~0.23%
B. ~0.04%
C. ~1.88%
D. ~2.00%

58 A 3-address instruction SUB X, A, B is executed on a processor. The values of A, B, and X are all in memory. The processor first loads operands into registers R1 and R2, performs the operation, and then stores the result from a register R3 back to memory. How many memory accesses are required in total to execute this single instruction?

computer instructions Hard
A. 3
B. 4
C. 6
D. 5

59 Which of the following scenarios represents a situation where an indirect cycle would be required in an instruction cycle?

instruction cycle Hard
A. Executing JMP 0x1000 where the program counter is loaded with the address 0x1000.
B. Executing ADD @0x1000 where the value at address 0x1000 is the address of the operand.
C. Executing ADD (0x1000) where the value at address 0x1000 is the operand.
D. Executing ADD R1, 0x1000(R2) where the operand's address is calculated by adding an offset to a register.

60 A processor's control unit is comparing the implementation of a complex, multi-cycle instruction using a hardwired approach versus a microprogrammed approach. A last-minute change requires adding a new state transition from state T5 directly to T2 under a specific condition. What is the primary implication of this change for the two design approaches?

timing and control Hard
A. Microprogrammed: Requires adding one new microinstruction with a conditional branch. Hardwired: Requires complex changes to the combinational logic of the sequence counter and state decoders.
B. Microprogrammed: Requires redesigning the microsequencer's logic. Hardwired: Requires changing a single entry in the control memory.
C. Both approaches would require a complete redesign of the control unit's state machine.
D. Microprogrammed: Impossible to implement without increasing clock cycle time. Hardwired: Can be easily implemented by adding a new flip-flop.

61 Which of the following correctly pairs a computer component with its primary function during the instruction fetch phase?

computer organization Hard
A. Program Counter (PC): Stores the instruction that is currently being executed.
B. Memory Buffer Register (MBR): Receives the instruction word from the memory unit.
C. Instruction Register (IR): Holds the address of the next instruction to be fetched.
D. Memory Address Register (MAR): Is loaded with the content of the MBR to specify the memory location.