Microprogrammed control and programming the basic computer: machine and assembly language, assemblers, loops, subroutines and I-O programming. - Question Bank

1. Which of the following best describes the relationship between machine language, assembly language, and microprogramming?
A) Machine language is a subset of assembly language; microprogramming controls the execution of machine instructions.
B) Assembly language is a subset of machine language; microprogramming translates assembly to machine code.
C) Microprogramming controls the CPU's hardware to execute machine language instructions, which assembly language represents symbolically.
D) Machine language is compiled from microprogramming; assembly language is used for I/O.
2. What is the outcome of a 'jump' instruction in assembly language?
A) It performs an arithmetic operation.
B) It causes the program execution to transfer to a different location in the code.
C) It stores data in a register.
D) It terminates the program.
3. In the context of I/O programming, a 'device driver' is:
A) A hardware component that controls the I/O device.
B) A software program that allows the operating system to communicate with an I/O device.
C) A set of machine instructions for data transfer.
D) A special type of CPU register.
4. Which of the following is NOT a typical component of a basic assembly language instruction?
A) Opcode (operation code)
B) Operands (data or addresses)
C) Microinstruction bits
D) Labels (optional)
5. What is the primary difference between microprogramming and hardwired control?
A) Microprogramming uses software (microinstructions), while hardwired control uses dedicated logic gates.
B) Hardwired control is always faster than microprogramming.
C) Microprogramming is only used for complex instructions.
D) Hardwired control is easier to modify.
6. The term 'Basic Computer' in the context of this topic typically refers to a simplified model of a computer used for educational purposes, often with a fixed instruction set.
A) True
B) False
C) Partially True
D) Depends on the specific model
7. I/O programming often involves interacting with:
A) Memory management units.
B) Input/Output controllers and device registers.
C) Floating-point units.
D) Instruction decoders.
8. When a subroutine is called, local variables are often stored on the:
A) CPU registers.
B) Hard drive.
C) Stack.
D) Cache memory.
9. Which of the following is a common way to represent conditional branching in assembly language?
A) Using the 'ADD' instruction.
B) Using comparison instructions (e.g., CMP) followed by conditional jump instructions (e.g., JE, JNE).
C) Using the 'CALL' instruction.
D) Using the 'RET' instruction.
10. A 'control word' in microprogramming typically contains:
A) User data.
B) A sequence of machine instructions.
C) Bits that directly control the data path and operations of the CPU.
D) The operating system kernel.
11. What is the primary purpose of the 'micro-operations' defined in microprogramming?
A) To represent high-level programming constructs.
B) To define the fundamental steps of CPU operation at the hardware level.
C) To manage file system operations.
D) To translate assembly code to machine code.
12. An I/O instruction in assembly language might be used to:
A) Perform floating-point arithmetic.
B) Load data from an input device or send data to an output device.
C) Define a new subroutine.
D) Manage the operating system kernel.
13. In the context of I/O programming, 'polling' refers to:
A) The device signaling the CPU when ready.
B) The CPU repeatedly checking the status of an I/O device.
C) Direct data transfer between I/O and memory.
D) The CPU executing a subroutine.
14. The main advantage of using subroutines is:
A) Increased program size.
B) Code reusability and modularity.
C) Slower execution speed.
D) Difficulty in debugging.
15. Which of the following is a typical component of a subroutine's implementation?
A) A central processing unit
B) A stack pointer
C) A graphics card
D) A hard disk drive
16. A common characteristic of loops is that they require a condition for:
A) Immediate termination.
B) Starting the loop.
C) Continuing or exiting the loop.
D) Defining variables.
17. The process of converting assembly language into machine language is called:
A) Compilation
B) Interpretation
C) Assembling
D) Linking
18. Assembly language uses mnemonics to represent:
A) Memory addresses.
B) Machine instructions and data.
C) Control signals.
D) Bus protocols.
19. Machine language is:
A) A high-level programming language.
B) A set of binary codes understood directly by the CPU.
C) A symbolic representation of instructions.
D) A human-readable programming language.
20. When programming the Basic Computer, the instruction set determines:
A) The physical size of the computer.
B) The operations the computer can perform.
C) The type of keyboard used.
D) The color of the monitor.
21. What is the role of the instruction set architecture (ISA) in microprogramming?
A) To define the physical layout of the CPU components.
B) To specify the set of machine instructions that the CPU can execute.
C) To manage the operating system's kernel.
D) To determine the clock speed of the processor.
22. Which component is essential for implementing DMA?
A) A Program Counter
B) A DMA Controller
C) An Arithmetic Logic Unit (ALU)
D) A Control Memory
23. Direct Memory Access (DMA) allows I/O devices to:
A) Execute programs independently of the CPU.
B) Communicate directly with main memory without CPU intervention for each data transfer.
C) Control the CPU's clock speed.
D) Generate their own interrupts.
24. Interrupt-driven I/O is generally more efficient than Programmed I/O because:
A) The CPU does not waste time polling devices.
B) It allows for direct memory access.
C) It is simpler to implement.
D) It can transfer larger blocks of data at once.
25. What is an 'interrupt' in the context of I/O programming?
A) A signal from an I/O device to the CPU indicating it needs attention or has completed an operation.
B) A mechanism for the CPU to continuously check the status of devices.
C) A way to directly access memory from an I/O device.
D) A command to halt all CPU operations.
26. In Programmed I/O (PIO), how does the CPU handle data transfer with an I/O device?
A) The device interrupts the CPU when ready.
B) The CPU continuously polls the status of the I/O device.
C) Data is transferred directly between the device and memory without CPU intervention.
D) The CPU sends a single command to transfer a large block of data.
27. Which mechanism is commonly used to transfer data between the CPU and I/O devices?
A) Direct Memory Access (DMA)
B) Interrupt-driven I/O
C) Programmed I/O
D) All of the above
28. I/O programming refers to:
A) Writing programs that only perform calculations.
B) Writing programs that interact with input and output devices.
C) Designing the internal architecture of the CPU.
D) Managing memory allocation.
29. What is the role of the stack in subroutine calls?
A) To store the subroutine's code.
B) To hold temporary variables used by the subroutine.
C) To save the return address so the program can resume after the subroutine finishes.
D) To store the results of calculations.
30. The 'RET' instruction at the end of a subroutine typically:
A) Performs an arithmetic calculation.
B) Pushes the return address from the stack back into the program counter.
C) Stores data in memory.
D) Terminates the entire program.
31. The 'CALL' instruction in assembly language typically performs two main actions:
A) Fetches data and stores it in a register.
B) Pushes the return address onto the stack and jumps to the subroutine.
C) Executes an arithmetic operation and stores the result.
D) Clears the stack and returns to the main program.
32. Which instructions are typically used to manage subroutine calls and returns?
A) JMP and NOP
B) CALL and RET
C) MOV and ADD
D) CMP and JZ
33. What is the primary purpose of a subroutine?
A) To store data permanently.
B) To execute a block of code multiple times from different parts of the program.
C) To manage the operating system.
D) To perform complex arithmetic calculations.
34. A 'subroutine' in assembly programming is analogous to a ______ in high-level languages.
A) Variable
B) Loop
C) Function or Procedure
D) Conditional statement
35. Which assembly language construct is commonly used to implement a loop?
A) Conditional jump instructions (e.g., JZ, JNZ)
B) Procedure calls (e.g., CALL)
C) Data definition directives (e.g., DB, DW)
D) Arithmetic instructions (e.g., ADD, SUB)
36. What is the purpose of a 'loop' in programming?
A) To terminate program execution.
B) To perform a set of instructions repeatedly.
C) To handle input/output operations.
D) To define new functions.
37. In assembly programming, what is a 'register'?
A) A small, fast storage location within the CPU.
B) A permanent storage device like a hard drive.
C) A part of the main memory.
D) A control signal line.
38. Which of the following represents a common mnemonic for an addition operation in assembly language?
A) MOV
B) SUB
C) ADD
D) JMP
39. What is the primary function of an assembler?
A) To link multiple object files together.
B) To load programs into memory.
C) To convert symbolic assembly code into binary machine code.
D) To manage system resources.
40. An assembler is a program that translates:
A) High-level language code into machine language.
B) Assembly language code into machine language.
C) Machine language code into assembly language.
D) Source code into object code.
41. Which of the following is an example of a machine language instruction?
A) ADD R1, R2
B) MOV AX, 05H
C) 1011000100000101
D) PRINT 'Hello'
42. What is the main difference between machine language and assembly language?
A) Machine language is binary, while assembly language uses mnemonics.
B) Machine language is human-readable, while assembly language is not.
C) Assembly language is directly executed by the CPU, while machine language requires translation.
D) Machine language is used for high-level programming, while assembly is for low-level.
43. A 'horizontal microinstruction' format is characterized by:
A) High degree of encoding, leading to compact microinstructions.
B) Each bit in the microinstruction directly controls a specific CPU component or signal.
C) Fewer control signals can be managed simultaneously.
D) Slower execution due to the need for decoding.
44. A 'vertical microinstruction' format typically has:
A) A large number of bits, with each bit controlling a specific control line.
B) A smaller number of bits, using encoding to represent control signals.
C) A fixed format for all instructions.
D) No specific format and is determined by the user.
45. What is a disadvantage of microprogramming?
A) Slower instruction fetch cycle.
B) Increased complexity of the instruction set.
C) Potentially slower execution of instructions compared to hardwired control.
D) Limited ability to add new instructions.
46. Which of the following is an advantage of using microprogramming?
A) Faster execution speed compared to hardwired control.
B) Simpler design for complex instruction sets.
C) Easier modification and updating of the control unit's functionality.
D) Lower cost of implementation.
47. In microprogramming, what is the purpose of the Control Memory (CM)?
A) To store user application programs.
B) To store the microprogram that controls the CPU's operations.
C) To hold temporary data during computation.
D) To manage the operating system kernel.
48. A sequence of microinstructions stored in control memory that dictates the operation of the CPU is called a:
A) Machine instruction
B) Assembly instruction
C) Microprogram
D) Macroinstruction
49. What is the primary role of a microprogrammed control unit in a CPU?
A) To execute arithmetic and logic operations directly.
B) To generate control signals based on a sequence of microinstructions.
C) To manage the flow of data between the CPU and main memory.
D) To handle input and output operations.