BE/B Eng Bachelor of Engineering Computer Engineering 1 — Questions and Answers
Question 1: What is the primary function of the ALU (Arithmetic Logic Unit) in a CPU?
- To perform arithmetic and logical operations on data (Correct answer)
- To store program instructions
- To manage memory addressing
- To control input/output operations
Correct answer: To perform arithmetic and logical operations on data
The ALU performs all arithmetic (addition, subtraction) and logical (AND, OR, NOT) operations on binary data as directed by the control unit.
Question 2: In computer architecture, what is cache memory?
- A small, fast memory close to the CPU that stores frequently accessed data (Correct answer)
- A large magnetic storage device for long-term data
- The main RAM used for running programs
- A virtual memory space on the hard disk
Correct answer: A small, fast memory close to the CPU that stores frequently accessed data
Cache memory is a small, high-speed SRAM buffer between the CPU and main memory that reduces latency by storing frequently or recently accessed data and instructions.
Question 3: What does pipelining in a CPU refer to?
- Overlapping the execution of multiple instructions by dividing processing into stages (Correct answer)
- Running multiple CPUs simultaneously
- Storing instructions in a queue before execution
- Caching frequently used instructions
Correct answer: Overlapping the execution of multiple instructions by dividing processing into stages
CPU pipelining divides instruction execution into discrete stages (fetch, decode, execute, writeback) so multiple instructions can be in different stages simultaneously, improving throughput.
Question 4: In binary arithmetic, what is the two's complement of 0110 (representing +6)?
- 1010 (Correct answer)
- 1001
- 0110
- 1110
Correct answer: 1010
Two's complement of 0110: invert all bits to get 1001, then add 1 to get 1010, which represents -6 in two's complement notation.
Question 5: What is virtual memory in an operating system?
- A technique that allows programs to use more memory than physically available by using disk space (Correct answer)
- Memory dedicated to graphics processing
- The CPU's internal register set
- Encrypted memory for secure storage
Correct answer: A technique that allows programs to use more memory than physically available by using disk space
Virtual memory abstracts physical RAM by using a page file on disk, giving each process the illusion of a large contiguous address space regardless of actual RAM size.
Question 6: Which data structure uses LIFO (Last In, First Out) order?
- Stack (Correct answer)
- Queue
- Linked List
- Hash Table
Correct answer: Stack
A stack follows LIFO order, where the last element pushed onto the stack is the first one popped off, used in function call management and expression evaluation.
What is the primary function of the ALU (Arithmetic Logic Unit) in a CPU?