Getting ready for the midterm of CS101 (Introduction to Computing)? Here is everything in one place: 263 solved MCQs and 61 subjective questions with model answers, gathered from past papers and files shared by students. Duplicates are removed, and wherever a shared answer key turned out to be wrong it has been corrected, so you can trust what you revise. Use the Objective and Subjective buttons above to switch between the two sections, and tap Show answer only after you have tried the question yourself. Best of luck with your exam!
Part 1: MCQs
Q1. What is the main focus of Computer Science?
- Software
- Hardware
- Algorithms
- Telecommunication
Show answer
Answer: (c) Algorithms
Q2. What does computer hardware encompass?
- Only external components
- Only internal components
- Both external and internal components
- Only the motherboard
Show answer
Answer: (c) Both external and internal components
Q3. What is the role of computer software?
- To perform physical tasks
- To manage hardware components
- To provide instructions to the computer
- To maintain data records
Show answer
Answer: (c) To provide instructions to the computer
Q4. Which field of Computer Science involves designing executable computer programs?
- Networking
- Graphics
- Robotics
- Programming
Show answer
Answer: (d) Programming
Q5. In which domain is computer graphics a core technology?
- Healthcare
- Telecommunications
- Entertainment
- Banking
Show answer
Answer: (c) Entertainment
Q6. What is a robot's defining characteristic?
- It is programmable by a computer.
- It is capable of complex actions.
- It is controlled externally.
- It generates computer graphics.
Show answer
Answer: (a) It is programmable by a computer.
Q7. What is the purpose of a database management system (DBMS)?
- Generating computer graphics
- Storing data for retrieval
- Securing computer systems
- Performing complex actions
Show answer
Answer: (b) Storing data for retrieval
Q8. What does "security" in Computer Science primarily aim to provide?
- Speed and efficiency
- Confidentiality, integrity, and availability
- Hardware components
- Firmware updates
Show answer
Answer: (b) Confidentiality, integrity, and availability
Q9. In which industries can Computer Science find applications?
- Telecom, Banks, and Hospitals
- Education and Agriculture
- Manufacturing and Construction
- Arts and Culture
Show answer
Answer: (a) Telecom, Banks, and Hospitals
Note: Computer Science is used in almost every industry; the lecture's example list is telecom, banks and hospitals.
Q10. According to Forbes magazine, which job was ranked Number 1 in the US?
- Quality Assurance Expert
- IT Manager
- Software Developer
- Full-Stack Engineer
Show answer
Answer: (c) Software Developer
Note: As stated in the lecture. Such rankings change from year to year.
Q11. What is the primary focus of Breadth First Learning in this course?
- Covering one particular course in detail
- Providing a basic introduction to all Computer Science courses
- Focusing on advanced operators in computer science
- Exploring the history of computing
Show answer
Answer: (b) Providing a basic introduction to all Computer Science courses
Q12. In the course, what does the term "Data Abstraction" refer to?
- Storing data in hardware
- Performing arithmetic operations in computer science
- Hiding complexities in large system design
- Communicating over the internet
Show answer
Answer: (c) Hiding complexities in large system design
Q13. What will be covered in the "Software Engineering" section of the course?
- Advanced programming in C++
- Designing, implementation, and testing of software
- Operating system functionalities
- Data manipulation techniques
Show answer
Answer: (b) Designing, implementation, and testing of software
Q14. How is an algorithm defined in Computer Science?
- A set of steps to perform a certain task
- A sequence of data manipulation operations
- A complex system design
- A tool for database management
Show answer
Answer: (a) A set of steps to perform a certain task
Q15. Which search engine does this course focus on?
- Yahoo
- MSN
- Bing
Show answer
Answer: (c) Google
Q16. How does Google find relevant pages when a user types a query?
- It finds pages containing all the terms given in the query
- It finds pages containing any of the terms in the query
- It finds pages based on alphabetical order
- It finds pages containing only the exact phrase in double quotes
Show answer
Answer: (a) It finds pages containing all the terms given in the query
Q17. What is the purpose of the microphone icon in the Google search box?
- To perform calculations
- To search by speaking
- To flip a coin
- To convert currency
Show answer
Answer: (b) To search by speaking
Q18. How should queries be formulated to account for upper and lower case letters in Google?
- Capitalize all letters in the query
- Use lowercase letters in the query
- It doesn't matter; Google ignores capitalization
- Use the proper case for each word in the query
Show answer
Answer: (c) It doesn't matter; Google ignores capitalization
Note: Google is case-insensitive. The source printed this option as "Google recognizes capitalization", which contradicts the correct answer, so the wording was corrected.
Q19. What is the correct query to find the tallest building in Pakistan as an exact phrase?
- "Tallest Building in Pakistan"
- Tallest Building in Pakistan
- Tallest, Building, Pakistan
- Tallest Pakistan Building
Show answer
Answer: (a) "Tallest Building in Pakistan"
Q20. What is the query format to perform calculations on Google?
- Type the mathematical operation like 12*391
- Use a calculator app
- Type numbers with a plus sign, like 12+391
- Use double quotes for calculations
Show answer
Answer: (a) Type the mathematical operation like 12*391
Q21. How can you see the latest currency conversion on Google?
- Type "Currency Conversion" and choose a currency
- Add "pkr" in front of a number
- Type "Currency" followed by the amount and the currency code
- Search for "Exchange Rate" on Google
Show answer
Answer: (b) Add "pkr" in front of a number
Note: This is the technique taught in the lecture (a currency code in front of a number).
Q22. What is the query format to search for a specific file type like PDF?
- "Virtual University" file:pdf
- "Virtual University" filetype:pdf
- "Virtual University" ext:pdf
- "Virtual University" format:pdf
Show answer
Answer: (b) "Virtual University" filetype:pdf
Note: filetype:pdf is the standard Google operator (ext:pdf also works, but filetype: is the one taught).
Q23. How can you search for a specific query within a social media platform like Facebook?
- Add "@" symbol before the query, e.g., "Fifa World cup @facebook"
- Use double quotes around the query, e.g., "Fifa World cup"
- Type the query in all caps, e.g., "FIFA WORLD CUP"
- Add "social:" before the query, e.g., "social:Fifa World cup"
Show answer
Answer: (a) Add "@" symbol before the query, e.g., "Fifa World cup @facebook"
Q24. How can you exclude specific words from a query?
- Use double quotes around the words to exclude
- Use the "-" symbol before the words to exclude
- Add "not" before the words to exclude
- Use a question mark before the words to exclude
Show answer
Answer: (b) Use the "-" symbol before the words to exclude
Q25. What is the purpose of enclosing a query in double quotes?
- To find pages with any of the words in the query
- To perform calculations on Google
- To search for an exact phrase as it is
- To search with a specific site
Show answer
Answer: (c) To search for an exact phrase as it is
Q26. How can you search for a phrase when you don't know what word comes before it?
- Use a wildcard (*) before the phrase
- Use a question mark before the phrase
- Use double quotes around the phrase
- Use a dollar sign before the phrase
Show answer
Answer: (a) Use a wildcard (*) before the phrase
Q27. How can you search for a range of numbers using Google?
- Use double dots (..) between the numbers, e.g., "pkr25000..pkr35000"
- Use the "+" symbol between the numbers, e.g., "pkr25000+pkr35000"
- Use the "to" keyword between the numbers, e.g., "pkr25000 to pkr35000"
- Use the "#" symbol between the numbers, e.g., "pkr25000#pkr35000"
Show answer
Answer: (a) Use double dots (..) between the numbers, e.g., "pkr25000..pkr35000"
Q28. Which of the following is one of the earliest computing devices?
- Transistor
- Abacus
- ENIAC
- Punch cards
Show answer
Answer: (b) Abacus
Q29. Which inventors experimented with gear-based computing machines?
- Steve Jobs and Stephen Wozniak
- Blaise Pascal, Gottfried Wilhelm Leibniz, and Charles Babbage
- Herman Hollerith and John Mauchly
- George Stibitz and Howard Aiken
Show answer
Answer: (b) Blaise Pascal, Gottfried Wilhelm Leibniz, and Charles Babbage
Q30. What technology did Herman Hollerith use to speed up the tabulation of the 1890 U.S. census?
- Vacuum tubes
- Transistors
- Punch cards
- Gears
Show answer
Answer: (c) Punch cards
Q31. What is the full form of ENIAC?
- Electronic Numerical Integrator and Calculator
- Electronic Network Integrator and Calculator
- Electrical Numeric Integrator and Computer
- Electronic Numeric Integrated Analysis Calculator
Show answer
Answer: (a) Electronic Numerical Integrator and Calculator
Note: This is the wording used in the course text (many other books write "Integrator and Computer").
Q32. How much electricity did the ENIAC consume?
- 20 Kilowatts
- 200 Kilowatts
- 2 Kilowatts
- 10 Kilowatts
Show answer
Answer: (b) 200 Kilowatts
Note: Figure used in the course text. Other sources quote about 150 kW.
Q33. What is the basic unit of storage in a computer?
- Byte
- Bit
- Word
- Kilobyte
Show answer
Answer: (b) Bit
Q34. How is information coded in bits?
- Using a combination of letters and numbers
- As patterns of 0 or 1
- Using hexadecimal values
- Using a combination of 1 and 2
Show answer
Answer: (b) As patterns of 0 or 1
Q35. What do 1-bit units represent in a chip?
- Electric charge
- Magnetic fields
- Radio waves
- Heat energy
Show answer
Answer: (a) Electric charge
Note: As given in the lecture: a bit is held as an electric charge (state) in the chip's circuitry.
Q36. How many patterns can be represented with 2 bits?
- 2
- 3
- 4
- 5
Show answer
Answer: (c) 4
Q37. What is used to represent the different characters in ASCII codes?
- Hexadecimal values
- Decimal numbers
- Octal values
- Bit patterns
Show answer
Answer: (d) Bit patterns
Q38. What is George Boole known for?
- Inventing the abacus
- Pioneer in computer graphics
- Pioneer in Boolean operations
- Creating the first computer mouse
Show answer
Answer: (c) Pioneer in Boolean operations
Q39. Which of the following is NOT a Boolean operation?
- AND
- OR
- XOR
- ADD
Show answer
Answer: (d) ADD
Q40. In Boolean operations, what does the bit 0 represent?
- True
- False
- 1
- -1
Show answer
Answer: (b) False
Q41. Why is hexadecimal notation used in computer systems?
- To confuse users
- To simplify the representation of bit patterns
- To make bit patterns longer
- To reduce the number of bits
Show answer
Answer: (b) To simplify the representation of bit patterns
Q42. How many bits does each hexadecimal symbol represent?
- 1 bit
- 2 bits
- 3 bits
- 4 bits
Show answer
Answer: (d) 4 bits
Q43. What is the hexadecimal representation of the bit pattern 111010000101010100010111?
- E8A517
- E85517
- E810A5
- E10111
Show answer
Answer: (b) E85517
Note: Group in fours: 1110 1000 0101 0101 0001 0111 = E 8 5 5 1 7.
Q44. What is the main purpose of a computer's main memory?
- To store mass storage devices
- To store data in binary form
- To perform calculations
- To store individual bits
Show answer
Answer: (b) To store data in binary form
Q45. What is the name for a computer's main memory that allows independent access to its cells?
- ROM
- RAM
- DRAM
- SDRAM
Show answer
Answer: (b) RAM
Q46. What does "RAM" stand for?
- Random Access Memory
- Read-Only Memory
- Rapid Access Memory
- Remote Access Memory
Show answer
Answer: (a) Random Access Memory
Q47. Which mass storage system uses optical technology?
- Magnetic disks
- CDs
- Magnetic tapes
- Solid-state disks
Show answer
Answer: (b) CDs
Q48. What is the capacity of a typical CD sector?
- 1 KB
- 2 KB
- 512 bytes
- 1 MB
Show answer
Answer: (b) 2 KB
Note: Corrected: a sector on a CD holds 2 KB. The shared key said 512 bytes, which is the usual sector size of a magnetic disk.
Q49. Which optical system is best suited for long continuous strings of data?
- CDs
- DVDs
- BDs
- Flash drives
Show answer
Answer: (a) CDs
Note: According to the lecture: a CD stores data on one spiral track, which suits long continuous data such as music.
Q50. How are bits stored in flash drives?
- By using lasers
- By sending electronic signals
- By using magnetic coatings
- By physically moving read/write heads
Show answer
Answer: (b) By sending electronic signals
Q51. How many bits are typically used to store each textual symbol?
- 4 bits
- 6 bits
- 8 bits
- 16 bits
Show answer
Answer: (c) 8 bits
Note: ASCII itself defines 7-bit patterns, but each symbol is normally stored in one 8-bit byte.
Q52. Which organization designed the American Standard Code for Information Interchange (ASCII)?
- ISO
- ANSI
- Unicode Consortium
- IEEE
Show answer
Answer: (b) ANSI
Q53. How many combinations can be represented using 7 bits in ASCII?
- 64
- 128
- 256
- 512
Show answer
Answer: (b) 128
Q54. What is the maximum number of characters that can be represented using 8 bits (1 byte)?
- 64
- 128
- 256
- 512
Show answer
Answer: (c) 256
Q55. Which code standard supports thousands of character sets, including Chinese, Hebrew, and Japanese?
- ASCII
- ANSI
- Unicode
- ISO
Show answer
Answer: (c) Unicode
Q56. What is binary notation primarily composed of?
- Digits 0 to 9
- Digits 0 and 1
- Digits 0 to 7
- Digits 0 to 15
Show answer
Answer: (b) Digits 0 and 1
Q57. How many values can be represented using 4 bits in binary notation?
- 4
- 8
- 16
- 32
Show answer
Answer: (c) 16
Note: Corrected: 2^4 = 16. The shared key said 8.
Q58. How many numeric values can be represented using 16 bits in binary notation?
- 256
- 512
- 65536
- 131,072
Show answer
Answer: (c) 65536
Q59. What is the name for the smallest unit in an image?
- Vector
- Pixel
- Byte
- Dot
Show answer
Answer: (b) Pixel
Q60. How are black and white images typically represented using pixels?
- 8 bits per pixel
- 4 bits per pixel
- 2 bits per pixel
- 1 bit per pixel
Show answer
Answer: (d) 1 bit per pixel
Q61. How many bytes are used to represent one pixel in RGB encoding?
- 1 byte
- 2 bytes
- 3 bytes
- 4 bytes
Show answer
Answer: (c) 3 bytes
Q62. What does MIDI stand for in the context of sound representation?
- Musical Instrument Digital Interface
- Music In Digital Information
- Musical Instrument Data Integration
- Music In Digital Interface
Show answer
Answer: (a) Musical Instrument Digital Interface
Q63. How many bits are used to record each sample in today's CDs?
- 8 bits
- 16 bits
- 24 bits
- 32 bits
Show answer
Answer: (b) 16 bits
Q64. What is the primary advantage of MIDI over traditional sound encoding methods?
- Smaller file size
- Higher fidelity
- Greater accuracy
- Wider compatibility
Show answer
Answer: (a) Smaller file size
Q65. How is binary addition carried out when both bits are 1?
- It results in a carry-over
- It produces a 0 with no carry-over
- It produces a 1 with no carry-over
- It is not possible
Show answer
Answer: (a) It results in a carry-over
Note: 1 + 1 = 10 in binary: the digit is 0 and a 1 is carried.
Q66. How many possibilities are there when adding two bits in binary notation?
- 2
- 3
- 4
- 5
Show answer
Answer: (c) 4
Q67. In binary fraction representation, what does the radix point signify?
- It separates positive and negative values.
- It indicates the position of the exponent.
- It separates the whole number part from the fractional part.
- It represents the sign of the number.
Show answer
Answer: (c) It separates the whole number part from the fractional part.
Q68. In 2's complement notation, how are negative integers represented?
- Starting with all 0's and counting upwards
- Starting with all 1's and counting upwards
- Starting with all 1's and counting downwards
- Starting with all 0's and counting downwards
Show answer
Answer: (c) Starting with all 1's and counting downwards
Q69. What is the primary purpose of the sign bit in 2's complement notation?
- To indicate the position of the radix point
- To separate the whole number and fractional part
- To represent the magnitude of the number
- To indicate the sign of the number (positive or negative)
Show answer
Answer: (d) To indicate the sign of the number (positive or negative)
Q70. What is the maximum positive value that can be represented using 4 bits in 2's complement notation?
- 7
- 8
- 15
- 16
Show answer
Answer: (a) 7
Q71. In Excess notation, which bit pattern is used to represent zero?
- The pattern with the highest significant bit set to 1
- The pattern with all bits set to 0
- The pattern with all bits set to 1
- The pattern with the highest significant bit set to 0
Show answer
Answer: (a) The pattern with the highest significant bit set to 1
Note: Zero is the pattern that starts with a 1 followed by all 0s (for example 1000 with 4 bits).
Q72. How are positive numbers represented in Excess notation?
- By adding a fixed number to their binary representation
- By subtracting a fixed number from their binary representation
- By using the original binary representation
- By inverting all the bits in their binary representation
Show answer
Answer: (a) By adding a fixed number to their binary representation
Note: Judgment call: in Excess notation the stored pattern is the value plus a fixed excess, which is the closest option.
Q73. What is the role of the exponent field in floating-point notation?
- It stores the sign of the number.
- It determines the position of the radix point.
- It represents the magnitude of the number.
- It indicates the number of bits used for storage.
Show answer
Answer: (b) It determines the position of the radix point.
Q74. In normalized floating-point notation, where do you start copying the bit pattern when filling the mantissa field?
- From the rightmost bit
- From the leftmost 1 in the binary representation
- From the leftmost bit
- From the sign bit
Show answer
Answer: (b) From the leftmost 1 in the binary representation
Q75. What does the sign bit in floating-point notation indicate?
- The position of the radix point
- The sign of the exponent
- The sign of the mantissa
- The sign of the value (positive or negative)
Show answer
Answer: (d) The sign of the value (positive or negative)
Q76. Which notation is commonly used to represent integers in today's computers?
- Excess Notation
- Floating Point Notation
- 2's Complement Notation
- Binary Notation
Show answer
Answer: (c) 2's Complement Notation
Q77. Which field in floating-point notation holds the fractional part (significant bits) of the number?
- Sign bit
- Exponent field
- Mantissa field
- Radix field
Show answer
Answer: (c) Mantissa field
Q78. What is the maximum positive value in 2's complement notation when 32 bits are used?
- 2,147,483,648
- 2,147,483,647
- 2,000,000,000
- 32,768
Show answer
Answer: (b) 2,147,483,647
Note: 2^31 - 1 = 2,147,483,647.
Q79. In floating-point notation, how is the exponent field interpreted?
- As an integer using the excess method
- As a floating-point value
- As a binary representation of the mantissa
- As a sign of the value
Show answer
Answer: (a) As an integer using the excess method
Q80. Which method eliminates the possibility of multiple representations for the same value in floating-point notation?
- Using a different number of bits
- Using floating-point notation
- Using normalized form
- Using the same bit pattern for all values
Show answer
Answer: (c) Using normalized form
Q81. What is the result of trying to store the value 2 5/8 in a one-byte floating-point system?
- Accurate representation
- Truncation error
- Round-off error
- Overflow error
Show answer
Answer: (b) Truncation error
Note: The source printed the value as "25/8"; it is 2 5/8 (binary 10.101), which needs five mantissa bits when only four are available.
Q82. When 2 5/8 is copied into the mantissa field, which part of the value is lost?
- The integer part
- The fractional part
- The leftmost 1/8
- The rightmost 1/8
Show answer
Answer: (d) The rightmost 1/8
Q83. What is the term for the loss of part of a value because of the size limit of the mantissa field?
- Truncation error
- Round-off error
- Overflow error
- Precision error
Show answer
Answer: (a) Truncation error
Q84. How can the significance of truncation errors be reduced?
- By using a longer exponent field
- By using a longer sign bit
- By using a longer mantissa field
- By using a longer radix point
Show answer
Answer: (c) By using a longer mantissa field
Q85. What is the main drawback of the GIF compression system when used for arbitrary images?
- It requires a large palette
- It produces lossless compression
- It limits the number of colors to 256
- It does not work well with text documents
Show answer
Answer: (c) It limits the number of colors to 256
Q86. Which compression technique replaces sequences of identical data elements with a code indicating the element and the number of times it occurs?
- Lossless encoding
- Frequency-dependent encoding
- Run-length encoding
- Relative encoding
Show answer
Answer: (c) Run-length encoding
Q87. What is the primary advantage of dictionary encoding systems in data compression?
- Lossy compression
- Fixed-length codes
- High precision
- Elimination of redundancy
Show answer
Answer: (d) Elimination of redundancy
Q88. What is adaptive dictionary encoding?
- It allows the dictionary to change during the encoding process.
- It uses fixed-length codes for dictionary entries.
- It relies on lossy compression techniques.
- It does not use dictionaries for encoding.
Show answer
Answer: (a) It allows the dictionary to change during the encoding process.
Q89. What does the term "I-frames" refer to in video compression?
- Frames with incomplete data
- Frames with high precision
- Frames with lossless compression
- Frames encoded in their entirety
Show answer
Answer: (d) Frames encoded in their entirety
Q90. What is the primary advantage of MP3 audio compression?
- Lossless compression
- High precision sound
- Removal of perceptually irrelevant audio details
- Loss of audio quality
Show answer
Answer: (c) Removal of perceptually irrelevant audio details
Q91. What are the common units used to measure transmission speeds for audio and video data?
- Bps, Gbps, and Tbps
- Kbps, Mbps, and Gbps
- Mbps, Tbps, and Pbps
- Kbps, Gbps, and Pbps
Show answer
Answer: (b) Kbps, Mbps, and Gbps
Q92. Which organization developed the MPEG standards for encoding and compressing audio and video?
- ISO
- GIF
- TIFF
- JPEG
Show answer
Answer: (a) ISO
Note: MPEG (Motion Picture Experts Group) is a working group of ISO.
Q93. What is the acronym "MP3" short for?
- MPEG layer 3
- Multimedia Programming 3
- Motion Picture Experts Group 3
- Music and Podcast 3
Show answer
Answer: (a) MPEG layer 3
Q94. What is the purpose of averaging chrominance values over two-by-two-pixel squares in image compression?
- To reduce image resolution
- To increase image quality
- To reduce chrominance information
- To preserve color accuracy
Show answer
Answer: (c) To reduce chrominance information
Q95. What are the three main parts of a CPU?
- Input, Output, Storage
- ALU, RAM, Control Unit
- Arithmetic/Logic Unit, Control Unit, Register Unit
- CPU Core, Cache, Main Memory
Show answer
Answer: (c) Arithmetic/Logic Unit, Control Unit, Register Unit
Q96. How does the CPU perform operations on data stored in main memory?
- It directly operates on the memory cells.
- It transfers the data to general-purpose registers.
- It communicates with the storage devices.
- It uses the control unit to modify the memory cells.
Show answer
Answer: (b) It transfers the data to general-purpose registers.
Q97. What connects the CPU and main memory for data transfer?
- Wires
- Buses
- Cables
- Fiber optics
Show answer
Answer: (b) Buses
Q98. How does the CPU read data from main memory?
- By directly accessing the memory cells
- By sending an electronic signal to the memory circuitry
- By transferring the data to the control unit
- By activating the arithmetic/logic unit
Show answer
Answer: (b) By sending an electronic signal to the memory circuitry
Q99. What is the term for changing the contents of a computer's memory (its program) to modify its operation?
- Rewiring
- Rebooting
- Reprogramming
- Refactoring
Show answer
Answer: (c) Reprogramming
Q100. Which concept allows programs to be encoded and stored in main memory, so they can be changed without rewiring the CPU?
- Stored-program concept
- Programmatic memory
- CPU reconfiguration
- Memory reprogramming
Show answer
Answer: (a) Stored-program concept
Q101. What is the collection of instructions encoded as bit patterns called?
- Bytecode
- Assembly language
- Machine language
- Binary code
Show answer
Answer: (c) Machine language
Q102. Which philosophy of CPU architecture favors a minimal set of machine instructions?
- Reduced Instruction Set Computer (RISC)
- Complex Instruction Set Computer (CISC)
- Minimalistic Instruction Set Computer (MISC)
- Basic Instruction Set Computer (BISC)
Show answer
Answer: (a) Reduced Instruction Set Computer (RISC)
Q103. Which architecture is known for its efficiency, speed, and lower manufacturing cost?
- RISC
- CISC
- MISC
- BISC
Show answer
Answer: (a) RISC
Q104. Which type of processors is used in PCs, such as Intel processors?
- RISC
- CISC
- MISC
- BISC
Show answer
Answer: (b) CISC
Q105. Which company is known for designing RISC architecture for low power consumption?
- Intel
- AMD
- ARM Holdings
- Qualcomm
Show answer
Answer: (c) ARM Holdings
Q106. How are a machine's instructions categorized?
- By their complexity
- By their execution speed
- By their memory usage
- Into three groups
Show answer
Answer: (d) Into three groups
Note: The three groups are data transfer, arithmetic/logic and control.
Q107. Which term is more appropriate than "move" for the actions of the data transfer group of instructions?
- Move
- Copy
- Delete
- Swap
Show answer
Answer: (b) Copy
Q108. What is a request to fill a general-purpose register with the contents of a memory cell called?
- Clone instruction
- Transfer instruction
- LOAD instruction
- STORE instruction
Show answer
Answer: (c) LOAD instruction
Q109. Which group of instructions handles the input/output activities of the machine?
- Data transfer group
- Arithmetic/Logic group
- Control group
- I/O group
Show answer
Answer: (a) Data transfer group
Note: Corrected: in the course text, I/O instructions belong to the data transfer group. The shared key said "I/O group", which is not one of the three groups.
Q110. What does the arithmetic/logic group of instructions ask the control unit to do?
- Request data transfer
- Perform arithmetic operations
- Execute program instructions
- Control data flow
Show answer
Answer: (b) Perform arithmetic operations
Q111. What do the control group instructions primarily direct?
- Data manipulation
- Input/Output operations
- Program execution
- Data transfer
Show answer
Answer: (c) Program execution
Q112. How is a machine instruction fetched from main memory to the CPU?
- By directly executing the instruction
- By decoding the instruction
- By obeying the instruction
- By transferring it using a bus
Show answer
Answer: (d) By transferring it using a bus
Q113. What determines the order of execution of instructions in memory?
- The CPU's program counter
- The CPU's instruction register
- The CPU's control unit
- The CPU's arithmetic/logic unit
Show answer
Answer: (a) The CPU's program counter
Q114. What is the role of the Instruction Register?
- To execute instructions
- To decode instructions
- To hold the currently executed instruction
- To fetch instructions from memory
Show answer
Answer: (c) To hold the currently executed instruction
Q115. In the machine cycle, what happens during the execution step?
- Instructions are fetched from memory
- Instructions are decoded
- Instructions are executed
- Instructions are stored in the program counter
Show answer
Answer: (c) Instructions are executed
Q116. In a machine whose instructions are two bytes long, what does the program counter contain after the instruction at address A4 has been fetched and executed (with no jump)?
- A4
- 166D
- A6
- 5056
Show answer
Answer: (c) A6
Q117. What is one major use of the AND operation in data manipulation?
- Combining two strings of bits
- Duplicating a bit pattern
- Inverting all the bits
- Moving bits within a register
Show answer
Answer: (b) Duplicating a bit pattern
Note: AND with a mask places 0s in one part of a bit string while duplicating the rest.
Q118. When the AND operation is used for masking, what does the mask determine?
- The position of the result
- The type of operation to perform
- Which part of the other operand affects the result
- The color of the result
Show answer
Answer: (c) Which part of the other operand affects the result
Q119. What does the OR operation do when used with a mask?
- Duplicates a part of a string
- Inverts all the bits in a string
- Rotates the bits in a string
- Discards the bits in a string
Show answer
Answer: (a) Duplicates a part of a string
Note: OR with a mask places 1s in one part of a string while duplicating the rest.
Q120. How is the XOR operation often used?
- To perform multiplication
- To perform division
- To form the complement of a bit string
- To perform circular shifts
Show answer
Answer: (c) To form the complement of a bit string
Q121. What are rotation and shift operations used for?
- Solving alignment problems
- Multiplying two's complement representations
- Adding two bit patterns
- Inverting all the bits in a register
Show answer
Answer: (a) Solving alignment problems
Q122. What distinguishes a circular shift (rotation) from a logical shift?
- The direction of motion
- The circular shift always fills the hole with 1
- The logical shift always fills the hole with 0
- The circular shift never discards bits
Show answer
Answer: (d) The circular shift never discards bits
Note: Corrected: in a circular shift the bits that fall off one end re-enter at the other end, so none are discarded. The shared key ("fills the hole with 1") is wrong.
Q123. How can subtraction be simulated using addition in 2's complement notation?
- By adding the binary of the first number to the binary of the second number
- By adding the binary of the first number to the negation of the second number
- By adding the binary of the second number to the binary of the first number
- By multiplying the binary of the first number with the binary of the second number
Show answer
Answer: (b) By adding the binary of the first number to the negation of the second number
Q124. In the context of arithmetic operations, multiplication can be seen as:
- Repetitive subtraction
- Repetitive addition
- Division by addition
- Division by subtraction
Show answer
Answer: (b) Repetitive addition
Q125. How can division be achieved on some small CPUs?
- By adding
- By subtracting
- By multiplication
- By division
Show answer
Answer: (b) By subtracting
Note: By repeated subtraction.
Q126. Which arithmetic operation is straightforward to carry out on numbers stored in 2's complement notation?
- Multiplication
- Division
- Addition
- Subtraction
Show answer
Answer: (c) Addition
Q127. What is the role of a controller in a computer system?
- It executes the main program of the computer.
- It connects external devices to the computer.
- It is responsible for executing instructions in the CPU.
- It manages the computer's memory.
Show answer
Answer: (b) It connects external devices to the computer.
Q128. How does a controller typically connect to peripheral devices?
- Via wireless connections.
- By using separate CPU chips.
- Through a shared memory module.
- Via cables and ports.
Show answer
Answer: (d) Via cables and ports.
Q129. What is the function of a controller in translating messages and data between a computer and peripheral devices?
- It converts messages into audio tones.
- It performs arithmetic calculations.
- It connects the computer to the internet.
- It translates data formats between computer and device.
Show answer
Answer: (d) It translates data formats between computer and device.
Q130. How has the development of standards like USB and FireWire affected controllers in personal computers?
- They have made controllers obsolete.
- They have simplified the role of controllers.
- They have increased the need for multiple controllers.
- They have enabled a single controller to handle various devices.
Show answer
Answer: (d) They have enabled a single controller to handle various devices.
Q131. Where do controllers typically connect within a computer's architecture?
- To a dedicated controller bus.
- To the computer's power supply.
- To the computer's central processing unit.
- To the same bus connecting the CPU and main memory.
Show answer
Answer: (d) To the same bus connecting the CPU and main memory.
Q132. How does a CPU send a bit pattern to a controller?
- By executing a STORE instruction.
- By executing a LOAD instruction.
- By using a separate controller bus.
- By sending an electrical signal directly.
Show answer
Answer: (a) By executing a STORE instruction.
Q133. What is the significance of direct memory access (DMA) in computer systems?
- It simplifies bus communication.
- It allows the CPU to communicate directly with peripheral devices.
- It enables controllers to access main memory during CPU idle time.
- It eliminates the need for controllers.
Show answer
Answer: (c) It enables controllers to access main memory during CPU idle time.
Q134. What is the main drawback of direct memory access (DMA)?
- It simplifies communication.
- It increases CPU utilization.
- It adds complexity to bus communication.
- It does not improve computer performance.
Show answer
Answer: (c) It adds complexity to bus communication.
Q135. What is parallel communication in computing?
- It transfers one signal at a time.
- It requires a simple data path.
- It involves several signals transferred simultaneously on separate lines.
- It is a form of wireless communication.
Show answer
Answer: (c) It involves several signals transferred simultaneously on separate lines.
Q136. What is serial communication in computing?
- It transfers one signal at a time.
- It involves complex data paths.
- It is slower than parallel communication.
- It requires multiple connections for each signal.
Show answer
Answer: (a) It transfers one signal at a time.
Q137. USB and FireWire are examples of which type of communication?
- Serial communication protocols.
- Parallel communication protocols.
- Wireless communication standards.
- CPU instruction sets.
Show answer
Answer: (a) Serial communication protocols.
Q138. What does the term "Kbps" stand for in the context of data transfer rates?
- Kilobytes per second.
- Megabits per second.
- Gigabits per second.
- Kilobits per second.
Show answer
Answer: (d) Kilobits per second.
Q139. What is the primary goal of pipelining in computer systems?
- To increase the execution speed of individual instructions.
- To reduce the complexity of CPU design.
- To eliminate the need for memory access.
- To improve the machine's throughput.
Show answer
Answer: (d) To improve the machine's throughput.
Q140. In pipelining, what happens when one instruction is being executed while the next instruction is fetched?
- Both instructions are executed simultaneously.
- The CPU waits for both instructions to complete.
- The instructions in the pipe are discarded.
- More than one instruction can be in the pipe at different stages of processing.
Show answer
Answer: (d) More than one instruction can be in the pipe at different stages of processing.
Q141. What is batch processing in the context of early computer systems?
- It involves executing multiple jobs simultaneously.
- It requires constant interaction with the user.
- It streamlines the transition between jobs.
- It was the only form of processing used.
Show answer
Answer: (c) It streamlines the transition between jobs.
Q142. What was one drawback of early batch processing systems?
- They required constant interaction with the user.
- Users had no interaction with their jobs once submitted.
- They were limited to executing one job at a time.
- They used wireless communication.
Show answer
Answer: (b) Users had no interaction with their jobs once submitted.
Q143. What is interactive processing in the context of operating systems?
- It involves executing jobs in batch mode.
- It allows a program to carry on a dialogue with the user during execution.
- It requires constant interaction with a computer operator.
- It is the same as batch processing.
Show answer
Answer: (b) It allows a program to carry on a dialogue with the user during execution.
Q144. What is a major challenge for operating systems in multiprocessor environments?
- Load balancing and scaling
- Graphics rendering and animation
- Disk fragmentation and file management
- Network security and data encryption
Show answer
Answer: (a) Load balancing and scaling
Q145. What do you call computer systems dedicated to specific tasks such as medical devices or cell phones?
- Personal computers
- Mainframes
- Embedded systems
- Supercomputers
Show answer
Answer: (c) Embedded systems
Q146. Which operating system was used in the Mars Exploration Rovers Spirit and Opportunity?
- VxWORKS
- Windows CE
- Linux
- macOS
Show answer
Answer: (a) VxWORKS
Note: As given in the course text.
Q147. What is the primary purpose of utility software in the system software category?
- Execute application programs
- Customize the operating system
- Manage the computer's hardware
- Handle network communication
Show answer
Answer: (b) Customize the operating system
Note: Judgment call: utility software extends or customizes what the operating system offers; this is the closest option.
Q148. In the context of operating systems, what does GUI stand for?
- Graphical User Interface
- General Utility Interface
- Global User Integration
- Generic User Input
Show answer
Answer: (a) Graphical User Interface
Q149. What is the distinction between the user interface and the internal parts of an operating system?
- The user interface handles hardware interactions.
- The internal parts manage utility software.
- The user interface communicates with users, while the internal parts control the system.
- The internal parts are responsible for file management.
Show answer
Answer: (c) The user interface communicates with users, while the internal parts control the system.
Q150. What is the role of a window manager in a graphical user interface?
- Allocating memory for programs
- Managing network communication
- Creating and managing windows on the screen
- Controlling the file system
Show answer
Answer: (c) Creating and managing windows on the screen
Q151. What is the internal part of an operating system called?
- User interface
- System software
- Utility software
- Kernel
Show answer
Answer: (d) Kernel
Q152. What is the primary function of the file manager in the kernel of an operating system?
- Allocating memory for programs
- Coordinating mass storage facilities
- Managing the user interface
- Handling network communication
Show answer
Answer: (b) Coordinating mass storage facilities
Q153. How are files often organized within an operating system for user convenience?
- In stacks
- In tables
- In bundles called directories or folders
- In registries
Show answer
Answer: (c) In bundles called directories or folders
Q154. What is a directory path?
- A list of file names
- A unique identifier for a file
- A chain of directories within directories
- A file's location in memory
Show answer
Answer: (c) A chain of directories within directories
Q155. What is the purpose of a device driver in an operating system?
- To execute application programs
- To manage the user interface
- To communicate with peripheral devices
- To allocate memory for programs
Show answer
Answer: (c) To communicate with peripheral devices
Q156. What is virtual memory in the context of an operating system?
- A type of flash memory
- A large memory space reserved for the kernel
- An illusion of additional memory created by paging
- The primary memory used by the user interface
Show answer
Answer: (c) An illusion of additional memory created by paging
Q157. What is the primary role of the scheduler in an operating system?
- Managing mass storage facilities
- Allocating memory for programs
- Determining which activities are considered for execution
- Coordinating network communication
Show answer
Answer: (c) Determining which activities are considered for execution
Q158. What procedure transfers the operating system from mass storage into main memory when a computer is turned on?
- Bootstrapping
- File management
- Paging
- Disk formatting
Show answer
Answer: (a) Bootstrapping
Q159. Why is read-only memory (ROM) used in the bootstrapping process of computers?
- To permanently store user data
- To ensure the operating system remains secure
- To store the boot loader for starting the operating system
- To provide additional memory space
Show answer
Answer: (c) To store the boot loader for starting the operating system
Q160. Why is booting from mass storage necessary for general-purpose computers?
- To conserve energy
- To ensure security
- To enable firmware updates
- To accommodate frequent operating system updates
Show answer
Answer: (d) To accommodate frequent operating system updates
Q161. Which components handle the coordination of processes in an operating system's kernel?
- File manager and memory manager
- Scheduler and dispatcher
- Process table and memory area
- Interrupt handler and timer circuit
Show answer
Answer: (b) Scheduler and dispatcher
Q162. What information is stored in the process table by the scheduler?
- User's name and password
- Process's priority and memory area
- Mass storage operation status
- Time slice duration
Show answer
Answer: (b) Process's priority and memory area
Q163. What initiates the end of a time slice in a time-sharing/multitasking system?
- Process completion
- User intervention
- Timer circuit generating an interrupt
- Dispatcher's decision
Show answer
Answer: (c) Timer circuit generating an interrupt
Q164. What is the procedure called when changing from one process to another in a time-sharing system?
- Process termination
- Process initiation
- Time slice completion
- Process switch or context switch
Show answer
Answer: (d) Process switch or context switch
Q165. Which component of the CPU is responsible for reacting to interrupt signals?
- Memory manager
- Scheduler
- Interrupt handler
- Dispatcher
Show answer
Answer: (c) Interrupt handler
Q166. What is the primary purpose of a semaphore in an operating system?
- Controlling access to printer devices
- Managing process priorities
- Enabling multitasking
- Preventing memory overflows
Show answer
Answer: (a) Controlling access to printer devices
Note: A semaphore guards a shared resource or critical region so that only one process uses it at a time (the printer is the classic example).
Q167. What is the technique called when non-sharable resources are made to appear sharable in an operating system?
- Spooling
- Multiprogramming
- Deadlock detection
- Privilege mode
Show answer
Answer: (a) Spooling
Q168. What is the role of auditing software in computer security?
- Allocating resources to processes
- Detecting unauthorized access
- Managing memory limits
- Controlling printer access
Show answer
Answer: (b) Detecting unauthorized access
Q169. What is the term for a situation in which an intruder tricks the operating system into allowing access beyond a user's privileges?
- Privilege escalation
- Memory limit override
- Resource allocation
- Deadlock
Show answer
Answer: (a) Privilege escalation
Q170. What can a single flaw in privilege level control lead to?
- Unauthorized access to printer devices
- Increased memory limits
- Disaster from malicious programming or errors
- Improved resource allocation
Show answer
Answer: (c) Disaster from malicious programming or errors
Q171. What is the primary purpose of an interrupt handler in the CPU?
- Allocating resources to processes
- Responding to external events and signals
- Managing printer access
- Controlling process priorities
Show answer
Answer: (b) Responding to external events and signals
Q172. How does the CPU handle an interrupt signal?
- It immediately resumes the interrupted task.
- It saves its position in the current process and starts executing an interrupt handler.
- It ignores the interrupt and continues with the current task.
- It terminates the current process.
Show answer
Answer: (b) It saves its position in the current process and starts executing an interrupt handler.
Q173. What are the four main classifications of computer networks?
- PAN, LAN, MAN, WAN
- Internet, Ethernet, WiFi, Bluetooth
- TCP/IP, CSMA/CD, CSMA/CA, IEEE
- Repeater, Bridge, Switch, Router
Show answer
Answer: (a) PAN, LAN, MAN, WAN
Q174. What does PAN stand for in network classification?
- Personal Area Network
- Public Access Network
- Private Area Network
- Peripheral Area Network
Show answer
Answer: (a) Personal Area Network
Q175. Which network is typically used for communications within a single building or building complex?
- PAN
- LAN
- MAN
- WAN
Show answer
Answer: (b) LAN
Q176. What does MAN stand for in network classification?
- Miniature Area Network
- Metropolitan Area Network
- Mobile Area Network
- Multipurpose Area Network
Show answer
Answer: (b) Metropolitan Area Network
Q177. Which network spans a local community?
- PAN
- LAN
- MAN
- WAN
Show answer
Answer: (c) MAN
Q178. What is the most significant difference between a LAN and a WAN?
- LANs are wireless, while WANs are wired.
- LANs cover a smaller geographic area than WANs.
- LANs are open networks, while WANs are closed networks.
- LANs use CSMA/CD, while WANs use CSMA/CA.
Show answer
Answer: (b) LANs cover a smaller geographic area than WANs.
Q179. How is the Internet classified in terms of network openness?
- Closed network
- Proprietary network
- Open network
- Private network
Show answer
Answer: (c) Open network
Q180. What collection of standards governs communication throughout the Internet?
- Ethernet standards
- IEEE standards
- TCP/IP protocol suite
- CSMA/CD protocol
Show answer
Answer: (c) TCP/IP protocol suite
Q181. What type of network design allows machines to communicate through a central access point (AP)?
- Bus topology
- Star topology
- Ethernet topology
- IEEE topology
Show answer
Answer: (b) Star topology
Q182. Which network topology was popularized in the 1990s under the Ethernet standards?
- Bus topology
- Star topology
- Mesh topology
- Ring topology
Show answer
Answer: (a) Bus topology
Q183. Which protocol controls the right to transmit messages in a bus network based on Ethernet standards?
- TCP/IP
- CSMA/CA
- CSMA/CD
- IEEE 802.11
Show answer
Answer: (c) CSMA/CD
Q184. Why is CSMA/CD not compatible with wireless star networks?
- It requires a central access point (AP).
- It cannot detect collisions in wireless networks.
- It uses a different addressing scheme.
- It is too expensive to implement wirelessly.
Show answer
Answer: (b) It cannot detect collisions in wireless networks.
Q185. Which approach to collision handling is commonly used in wireless networks?
- CSMA/CD
- CSMA/CA
- Ethernet standards
- IEEE protocols
Show answer
Answer: (b) CSMA/CA
Q186. How do routers differ from repeaters, bridges, and switches in network connectivity?
- Routers connect networks while maintaining their individual characteristics.
- Routers amplify signals between connected networks.
- Routers always forward all messages across connections.
- Routers are used primarily in star topologies.
Show answer
Answer: (a) Routers connect networks while maintaining their individual characteristics.
Q187. What is a network formed by connecting existing networks into an extended communication system called?
- Internet
- Intranet
- Gateway
- Internet of Things (IoT)
Show answer
Answer: (a) Internet
Note: Corrected: connecting networks together forms an internet. A gateway is the machine that connects a network to the rest of the Internet. The shared key said "Gateway".
Q188. What is the primary purpose of a gateway in networking?
- To connect devices within a single network
- To connect LANs to the Internet
- To replace routers in network connections
- To serve as a central access point (AP)
Show answer
Answer: (b) To connect LANs to the Internet
Q189. Which model defines the roles of processes as either clients or servers in inter-process communication?
- Peer-to-peer model
- Client/server model
- Ethernet model
- TCP/IP model
Show answer
Answer: (b) Client/server model
Q190. Which model involves processes that both provide service to and receive service from each other?
- Client/server model
- Peer-to-peer model
- Ethernet model
- WAN model
Show answer
Answer: (b) Peer-to-peer model
Q191. What term describes a system of software units that execute as processes on different computers?
- Intranet
- Extranet
- Distributed system
- Cluster computing
Show answer
Answer: (c) Distributed system
Q192. What are the organizations responsible for constructing and maintaining Internet networks called?
- Internet Service Users
- Internet Backbone Providers
- Internet Service Providers (ISPs)
- Internet Infrastructure Operators
Show answer
Answer: (c) Internet Service Providers (ISPs)
Q193. Tier-1 ISPs are primarily known for:
- Regional network operations
- Operating access networks
- Providing international high-speed backbone networks
- Managing domain name registrations
Show answer
Answer: (c) Providing international high-speed backbone networks
Q194. What is an access ISP in the context of Internet networking?
- An organization that provides Internet access to individual homes and businesses
- A specialized type of router used by ISPs
- A government agency responsible for Internet regulation
- A type of mobile phone carrier
Show answer
Answer: (a) An organization that provides Internet access to individual homes and businesses
Q195. What term describes the devices that individual users connect to access ISPs?
- Core systems
- Domain servers
- End systems or hosts
- Routers
Show answer
Answer: (c) End systems or hosts
Q196. Which technology is described as one of the fastest-growing for connecting end systems to larger networks?
- Dial-up connections
- Fiber-optic cables
- Wireless connections based on WiFi
- Satellite connections
Show answer
Answer: (c) Wireless connections based on WiFi
Note: As stated in the lecture.
Q197. What is the term for an area within the broadcast range of an access point (AP)?
- Broadband zone
- Internet hub
- Wireless hotspot
- Data center
Show answer
Answer: (c) Wireless hotspot
Q198. In the cellular telephone industry, what are hot spots called?
- WiFi zones
- Cells
- Routers
- Access points
Show answer
Answer: (b) Cells
Q199. What is the primary purpose of IP addresses in the Internet?
- Identifying users
- Providing domain names
- Allocating network resources
- Assigning unique identifying addresses to computers
Show answer
Answer: (d) Assigning unique identifying addresses to computers
Q200. Which organization allocates blocks of IP addresses to ISPs?
- Internet Service Providers (ISPs)
- Internet Corporation for Assigned Names and Numbers (ICANN)
- Internet Service Users (ISUs)
- Internet Regulatory Commission (IRC)
Show answer
Answer: (b) Internet Corporation for Assigned Names and Numbers (ICANN)
Q201. How are IP addresses traditionally represented in dotted decimal notation?
- In binary format
- In hexadecimal format
- In base 10 format
- In octal format
Show answer
Answer: (c) In base 10 format
Q202. What is the purpose of the domain name system (DNS) in the Internet?
- To encrypt Internet traffic
- To allocate IP addresses
- To translate mnemonic domain names to IP addresses
- To regulate Internet content
Show answer
Answer: (c) To translate mnemonic domain names to IP addresses
Q203. Which organization is responsible for domain name registration and the allocation of mnemonic domain names?
- Internet Service Providers (ISPs)
- Internet Corporation for Assigned Names and Numbers (ICANN)
- Domain Hosting Companies (DHCs)
- Domain Servers (DSs)
Show answer
Answer: (b) Internet Corporation for Assigned Names and Numbers (ICANN)
Note: As given in the lecture. In practice ICANN delegates registration to accredited registrars.
Q204. What are top-level domains (TLDs) used for in domain names?
- Indicating the location of the domain
- Categorizing the type of organization
- Determining the domain's age
- Identifying the domain's owner
Show answer
Answer: (b) Categorizing the type of organization
Q205. What does the term "subdomain" refer to in the context of domain names?
- A domain name with multiple periods
- A specialized domain for mobile devices
- An extension of the primary domain
- A secondary top-level domain
Show answer
Answer: (c) An extension of the primary domain
Q206. How are messages transferred over the Internet?
- Using mnemonic addresses
- Using domain names
- Using IP addresses
- Using top-level domains
Show answer
Answer: (c) Using IP addresses
Q207. What is the primary function of name servers in the domain name system (DNS)?
- To register domain names
- To provide address translation services
- To host websites
- To manage TLDs
Show answer
Answer: (b) To provide address translation services
Q208. What is the primary purpose of an analog telephone adapter in VoIP?
- To connect traditional telephones to digital networks
- To replace traditional telephones with VoIP phones
- To provide voice communication similar to traditional telephones
- To manage domain name registrations
Show answer
Answer: (a) To connect traditional telephones to digital networks
Q209. Which form of VoIP involves using smartphones as broadband-connected hosts on the Internet?
- VoIP soft phones
- Analog telephone adapters
- Embedded VoIP phones
- Wireless VoIP technology
Show answer
Answer: (d) Wireless VoIP technology
Q210. What is the purpose of enclosing a word in anchor tags (<a> and </a>) in HTML?
- To change the font style of the word
- To create a hyperlink to another webpage
- To highlight the word in color
- To make the word bold
Show answer
Answer: (b) To create a hyperlink to another webpage
Q211. What is the function of the href parameter within anchor tags in HTML?
- It changes the text color of the enclosed word.
- It specifies the font size of the enclosed word.
- It defines the URL of the linked webpage.
- It sets the background color of the enclosed word.
Show answer
Answer: (c) It defines the URL of the linked webpage.
Q212. In the HTML code for including an image, what does the "src" attribute specify?
- The image's width in pixels
- The image's file format (e.g., JPEG)
- The source code of the webpage
- The URL of the image file
Show answer
Answer: (d) The URL of the image file
Q213. If you want to display an image at the top of an HTML page, where should you insert the <img> tag?
- Immediately after the </head> tag
- Just before the </body> tag
- At the beginning of the <body> tag
- At the end of the <body> tag
Show answer
Answer: (c) At the beginning of the <body> tag
Q214. What is XML used for?
- To define the appearance of data
- To store binary data efficiently
- To represent data in a readable format
- To create markup languages for data representation
Show answer
Answer: (d) To create markup languages for data representation
Q215. Which markup language is based on the XML standard and is used for representing web pages?
- SGML
- XHTML
- HTML5
- XML2HTML
Show answer
Answer: (b) XHTML
Q216. What does the XML standard primarily emphasize in the design of markup languages?
- Data compression
- Data encryption
- Data semantics
- Data visualization
Show answer
Answer: (c) Data semantics
Q217. How many layers does the layered approach to Internet software have?
- Two layers
- Three layers
- Four layers
- Five layers
Show answer
Answer: (c) Four layers
Note: Application, transport, network and link layers.
Q218. What is the primary function of the transport layer in the layered approach to Internet software?
- Handling physical connections to the network
- Managing data transmission between devices
- Formatting data for display in web browsers
- Creating hyperlinks between webpages
Show answer
Answer: (b) Managing data transmission between devices
Q219. When an HTML page contains a hyperlink, what does clicking on the link typically do?
- Changes the font style of the text
- Highlights the text in color
- Retrieves and displays another webpage
- Makes the text bold
Show answer
Answer: (c) Retrieves and displays another webpage
Q220. Which HTML tag is used to display images on a webpage?
- <img>
- <image>
- <picture>
- <graphics>
Show answer
Answer: (a) <img>
Q221. How does the transport layer help ensure the proper transmission of messages over the Internet?
- By translating human-readable addresses into IP addresses
- By dividing messages into small segments
- By adding sequence numbers to message segments
- By routing packets to their final destinations
Show answer
Answer: (c) By adding sequence numbers to message segments
Q222. What is the primary role of the network layer in Internet communication?
- Dividing messages into segments
- Adding sequence numbers to message segments
- Deciding the direction of packet forwarding
- Transmitting individual packets
Show answer
Answer: (c) Deciding the direction of packet forwarding
Q223. How does the link layer contribute to the transmission of packets in the Internet?
- By routing packets to their final destinations
- By adding sequence numbers to message segments
- By dealing with communication details specific to the network
- By extracting message segments from packets
Show answer
Answer: (c) By dealing with communication details specific to the network
Q224. What is the purpose of assigning unique port numbers in Internet communication?
- To translate mnemonic addresses to IP addresses
- To divide long messages into segments
- To determine the direction of packet forwarding
- To specify which unit within the application layer should receive a message
Show answer
Answer: (d) To specify which unit within the application layer should receive a message
Q225. Which protocol is commonly used for DNS lookups and VoIP because of its efficiency?
- SMTP
- HTTP
- UDP
- TCP
Show answer
Answer: (c) UDP
Q226. What is the primary task of IP (Internet Protocol) in the network layer?
- Dividing messages into segments
- Translating mnemonic addresses to IP addresses
- Routing packets through the Internet
- Adding sequence numbers to message segments
Show answer
Answer: (c) Routing packets through the Internet
Q227. What does the hop count value in an IP packet determine?
- The number of packets transmitted simultaneously
- The number of routers in the Internet
- The number of times a packet can be forwarded
- The time it takes for a packet to reach its destination
Show answer
Answer: (c) The number of times a packet can be forwarded
Q228. What is the role of a proxy server in a network environment?
- It forwards messages between clients and servers.
- It communicates directly with servers to gather information.
- It acts as an intermediary between clients and servers to protect client information.
- It monitors the activities of firewalls within the network.
Show answer
Answer: (c) It acts as an intermediary between clients and servers to protect client information.
Q229. What is the role of antivirus software in network security?
- To forward packets between routers
- To provide a secure connection to the Internet
- To detect and remove known viruses and infections
- To act as a proxy server for client-server communication
Show answer
Answer: (c) To detect and remove known viruses and infections
Q230. How does a digital signature contribute to message authentication?
- It encrypts the entire message for security.
- It adds a unique port number to the message.
- It indicates the sender's identity and authenticity.
- It decrypts the message to verify its contents.
Show answer
Answer: (c) It indicates the sender's identity and authenticity.
Q231. What is the primary goal of a certificate authority in network security?
- To maintain a network's forwarding table
- To prevent unauthorized access to a network
- To authenticate the identity of network users
- To update antivirus software on network devices
Show answer
Answer: (c) To authenticate the identity of network users
Q232. Which of the following is a primary characteristic of an algorithm?
- The inclusion of parallel processing steps
- The ability to execute ambiguous steps
- The provision of well-established sequence
- The use of unambiguous, executable steps
Show answer
Answer: (d) The use of unambiguous, executable steps
Q233. Which layer of the layered approach to Internet software deals with directing the segments through the Internet?
- Application layer
- Transport layer
- Network layer
- Link layer
Show answer
Answer: (c) Network layer
Q234. What is the primary responsibility of the transport layer in Internet communication?
- Routing packets through the Internet
- Translating human-readable addresses into IP addresses
- Dividing long messages into segments
- Ensuring proper formatting of messages
Show answer
Answer: (c) Dividing long messages into segments
Q235. What problem does a sequential search algorithm solve?
- Sorting names alphabetically
- Finding a specific target value in a list
- Iterative loop control
- Repetitive algorithm design
Show answer
Answer: (b) Finding a specific target value in a list
Q236. When a sequential search through an alphabetically sorted list reaches an entry greater than the target, what happens?
- The search terminates as a success.
- The search continues.
- The search terminates as a failure.
- The search resets to the beginning of the list.
Show answer
Answer: (c) The search terminates as a failure.
Q237. What is the purpose of the check "if (List is empty)" in the sequential search pseudocode?
- To check if the list is sorted
- To declare a search success
- To check if the list is not empty
- To handle the case where the list contains no entries
Show answer
Answer: (d) To handle the case where the list contains no entries
Q238. What is the termination condition of the loop "while (the pH level is greater than 4): add a drop of sulfuric acid"?
- pH level is less than or equal to 4
- pH level is greater than 4
- pH level is equal to 4
- pH level is not mentioned
Show answer
Answer: (a) pH level is less than or equal to 4
Q239. What does the statement "i = i + 1;" do?
- Adds 1 to the value of "i"
- Multiplies "i" by 1
- Sets "i" to 1
- Subtracts 1 from the value of "i"
Show answer
Answer: (a) Adds 1 to the value of "i"
Q240. What is a pretest loop in the context of iterative structures?
- A loop that tests a condition after executing the loop body
- A loop that does not involve any testing
- A loop that tests a condition before executing the loop body
- A loop that tests multiple conditions simultaneously
Show answer
Answer: (c) A loop that tests a condition before executing the loop body
Q241. What is a posttest loop in the context of iterative structures?
- A loop that tests a condition before executing the loop body
- A loop that tests a condition after executing the loop body
Show answer
Answer: (b) A loop that tests a condition after executing the loop body
Q242. What is the value computed by the FindFactorial function when n = 5?
- 1
- 2
- 6
- 120
Show answer
Answer: (d) 120
Q243. In the FindFactorial loop "while (i <= n)", when does the loop terminate?
- The loop will run indefinitely
- The loop will terminate when i becomes equal to n
- The loop will run only once
- The loop will terminate when i is greater than n
Show answer
Answer: (d) The loop will terminate when i is greater than n
Note: Corrected: the loop keeps running while i <= n and stops as soon as i becomes greater than n. The shared key ("when i equals n") is wrong, because the case i = n is still executed.
Q244. When searching a dictionary quickly, which approach does binary search follow?
- Start at the beginning of the dictionary.
- Open to a random page.
- Begin with the middle entry.
- Randomly pick entries.
Show answer
Answer: (c) Begin with the middle entry.
Q245. What is the primary purpose of the initialization phase in loop (repetitive) control?
- To test for termination
- To create new activations
- To narrow down the search
- To establish a starting condition
Show answer
Answer: (d) To establish a starting condition
Q246. Which algorithm would be more efficient for searching a list of 30,000 entries?
- Sequential search
- Binary search
- Both are equally efficient
- Neither is efficient
Show answer
Answer: (b) Binary search
Q247. How does the binary search algorithm restrict the number of entries to consider after each step?
- It halves the number of entries.
- It reduces the entries by one.
- It always searches the entire list.
- It depends on the target value.
Show answer
Answer: (a) It halves the number of entries.
Q248. What does "log2 n" represent in algorithm analysis?
- The base two logarithm of n
- The number of iterations in a loop
- The number of recursive calls
- The total time required for execution
Show answer
Answer: (a) The base two logarithm of n
Q249. What is the significance of "algorithm analysis" in computer science?
- Evaluating the correctness of algorithms
- Comparing hardware specifications
- Evaluating the efficiency of algorithms
- Analyzing computer program syntax
Show answer
Answer: (c) Evaluating the efficiency of algorithms
Q250. Which phase of problem solving involves evaluating the solution for accuracy and for its potential as a tool for solving other problems?
- The first phase
- The second phase
- The third phase
- The fourth phase
Show answer
Answer: (d) The fourth phase
Note: Polya's phases: understand the problem, devise a plan, carry out the plan, evaluate the solution.
Q251. In the problem of cutting a chain of links, how many cuts are required to solve it optimally?
- Three cuts
- Two cuts
- One cut
- Four cuts
Show answer
Answer: (c) One cut
Q252. In algorithm analysis, what does the "worst-case scenario" refer to?
- The best possible outcome
- The average performance
- The most efficient solution
- The most challenging situation
Show answer
Answer: (d) The most challenging situation
Q253. What is the primary goal of algorithm analysis for algorithms that search lists?
- To analyze specific lists of fixed lengths
- To determine the fastest algorithm
- To identify a formula indicating algorithm performance for arbitrary list lengths
- To evaluate the performance of different hardware configurations
Show answer
Answer: (c) To identify a formula indicating algorithm performance for arbitrary list lengths
Q254. What key distinction is emphasized regarding software verification?
- The need for machine-independent programming languages
- The difference between software believed to be correct and software that is correct
- The importance of security in software development
- The use of assembly languages in software verification
Show answer
Answer: (b) The difference between software believed to be correct and software that is correct
Q255. What was the root cause of the Therac-25 X-ray radiation incidents?
- Security breach
- Hardware failure
- Technical issue with software
- Environmental factors
Show answer
Answer: (c) Technical issue with software
Note: The Therac-25 overdoses (1985-87) were traced to flaws in the machine's control software.
Q256. In the context of programming languages, what is an assembler used for?
- Executing high-level code
- Debugging machine code
- Converting mnemonic expressions to machine language
- Writing machine-independent code
Show answer
Answer: (c) Converting mnemonic expressions to machine language
Q257. What characterizes the third generation of programming languages?
- They are machine-dependent and use assembly language.
- They are machine-independent and use natural language.
- They are higher-level and machine-independent.
- They are lower-level and machine-dependent.
Show answer
Answer: (c) They are higher-level and machine-independent.
Q258. Which programming languages are examples of third-generation languages?
- Assembly and FORTRAN
- COBOL and machine language
- FORTRAN and COBOL
- FORTRAN and HLT
Show answer
Answer: (c) FORTRAN and COBOL
Q259. What term is used for programs that translate high-level primitives into machine-language programs?
- Compilers
- Assemblers
- Interpreters
- Translators
Show answer
Answer: (a) Compilers
Q260. In the declarative paradigm, what is the programmer's main task?
- Developing precise algorithms
- Translating machine code into high-level code
- Describing the problem to be solved
- Debugging code
Show answer
Answer: (c) Describing the problem to be solved
Q261. Which programming paradigm builds solutions through a sequence of commands?
- Functional
- Object-oriented
- Imperative
- Declarative
Show answer
Answer: (c) Imperative
Q262. What are small variations of a programming language that are not part of the standard version called?
- Language extensions
- Compiler enhancements
- Syntax modifications
- Standard deviations
Show answer
Answer: (a) Language extensions
Q263. What term describes the result of minor modifications to a programming language that make it incompatible with other compilers?
- Dialect
- Syntax error
- Compiler extension
- Standardization
Show answer
Answer: (a) Dialect
Part 2: Subjective Questions
Q1. What is the difference between computer hardware and computer software, and how do they contribute to Computer Science?
Hardware means the physical, tangible parts of a computer system that you can touch: the case, monitor, keyboard, mouse, hard disk, motherboard and so on.
Software means the programs, that is, the instructions (and their documentation) that tell the hardware how to perform tasks. It includes application software (word processors, browsers) and system software such as the operating system.
Contribution: hardware provides the physical platform that stores and processes data, while software provides the functionality and the step-by-step instructions. Neither is useful without the other, and together they form the foundation of Computer Science.
Q2. How does Computer Science apply to various industries, and why is it considered essential in today's job market?
Computer Science is used in almost every industry: telecom (networks, billing), banking (online banking, ATMs, transaction processing, security), hospitals (patient records, medical imaging), education, business, government and, of course, the software industry itself. In each of them it improves efficiency, automates routine processes, manages data and makes new services possible.
It is essential in the job market because every one of these sectors needs people who can develop and maintain software, manage data and networks, keep systems secure and innovate with new technology. According to the lecture, a large share of the job opportunities in Pakistan and abroad are in this field, and software developers are among the most in-demand professionals.
Q3. Why is it important for people from other fields of study, not just Computer Science students, to have a basic understanding of Computer Science?
Computing is now part of almost every profession, so basic Computer Science knowledge has become a form of general literacy. It helps people use technology to do their own work better, solve problems and communicate.
- Business: data analysis, spreadsheets, e-commerce and databases
- Engineering: programming embedded systems, simulation and design software
- Sciences and medicine: computational modelling, analysing experimental data
- Any field: working with the Internet, understanding security and privacy, and talking to technical teams
In short, it supports problem solving and innovation in nearly every career.
Q4. What are the two primary learning strategies mentioned in Module 2, and how do they differ?
The two strategies are Breadth First Learning and Depth First Learning.
- Breadth First Learning: gives a basic introduction to almost all courses of Computer Science first, so the student sees the overall scope of the degree program. This is the approach followed in this course.
- Depth First Learning: covers one course in full detail before moving on to the next one.
The difference lies in the order in which the material is covered and the level of detail given at each step.
Q5. What does Breadth First Learning aim to achieve in Computer Science education?
Breadth First Learning aims to show students what they will be learning throughout the entire degree. It gives an abstract view of all the major Computer Science courses, explains what each course is about, shows why each one is important and so builds the bigger picture of the field before the details are studied.
Q6. What topics are covered in the introductory course (CS101) described in Module 2?
As listed in the course introduction, the course covers:
- Search engine usage techniques
- History of computing, data storage and data manipulation
- Operating systems, networking and the Internet
- Algorithms and programming languages (basics of C++)
- Software engineering
- Data abstraction (arrays, stacks, queues, trees)
- Database systems and artificial intelligence
- Impact of Computer Science on society: content filtering, spam, international laws
- Word processing, presentation development and spreadsheets (Microsoft Excel)
- Database (MS Access) and web page development
Q7. Why does the course focus on Google as the search engine?
Because Google is the most widely used search engine and holds the largest share of the market for Internet searches, so the techniques learned on it are the most useful for students.
Q8. How does Google decide which pages are relevant to a search?
Google looks for web pages that contain all the terms given in the search query, and then lists the pages that match, ranked by relevance. That is why adding more useful keywords narrows the results.
Q9. What is the purpose of searching for "Weather Lahore" in Google?
Typing a query such as weather Lahore makes Google show the current weather conditions and the forecast for Lahore directly at the top of the results, so the user gets the information quickly without opening any website.
Q10. How can Google be used to perform mathematical calculations?
Simply type the calculation into the search box. Google recognises it and shows its built-in calculator with the answer. For example, typing 12*391 displays the result 4692.
Q11. What is the significance of writing "pkr" in front of a number in a Google search?
It tells Google that the number is a price in Pakistani Rupees, so the results are narrowed to products or services around that price, for example laptop pkr 50000.
Note: Google's own help documents this technique with the dollar sign (camera $400). The use of a currency code such as "pkr" is the lecture's version of the same idea, so write it the way your lecture does in the exam.
Q12. Does Google distinguish between capital and small letters in a search?
No. Google is case-insensitive: a search for COMPUTER SCIENCE gives the same results as computer science.
Q13. What does the "@" symbol do when it is used in a Google search?
Putting @ in front of a word makes Google search for that query on a social media platform. For example, Fifa World Cup @facebook looks for information about the FIFA World Cup on Facebook.
Q14. How did the abacus work as an early computing device, and where did it originate?
The abacus is one of the earliest known computing devices. It is a rectangular frame holding rods on which beads can slide. Each rod stands for a place value (ones, tens, hundreds and so on), and the position of the beads on a rod stands for a digit. By moving beads, the user can perform addition and subtraction directly, and multiplication and division by repeated steps.
Its exact origin is uncertain. Most course material connects it with ancient China, where the abacus became a very common calculating tool, and historians also trace early forms to Mesopotamia. Similar devices were used in Greek and Roman civilizations.
Q15. How did Herman Hollerith contribute to computing through punched cards?
Hollerith applied the idea of representing information as holes punched in paper cards, with each hole position standing for a piece of data. He used it to speed up the tabulation of the 1890 U.S. census, which was processed far faster than by hand.
His Tabulating Machine Company later became part of the company known today as IBM. Punched cards remained a popular way to store data and to communicate with computers until the 1970s.
Q16. What barrier was overcome in the move from mechanical-driven machines to electronics-driven machines?
Early machines by Pascal, Leibniz and Babbage were built from gears. The barrier was cost and practicality: nineteenth-century technology could not produce such complex gear-driven machines economically.
With advances in electronics in the early 1900s, machines based on electronically controlled mechanical relays became possible, such as George Stibitz's machine and the Mark I designed by Howard Aiken and IBM engineers. These were cheaper and more efficient, which opened the way to fully electronic computers.
Q17. What are Boolean operations, and why are they significant in Computer Science?
Boolean operations are named after the mathematician George Boole. They work on true/false values, where bit 1 stands for true and bit 0 for false. The basic operations are AND, OR, XOR (exclusive OR) and NOT.
They matter because computers handle binary data, and these operations are the basis of logical decision making, of manipulating bit patterns and of the logic gates that make up computer circuits.
Q18. Why is hexadecimal notation used in computer systems?
Bit patterns in a machine are long and hard for humans to read and write. Their lengths are usually multiples of four, so hexadecimal notation uses one symbol (0-9, A-F) for each group of four bits. For example, 1010 1111 is written as AF. This shortens the pattern and makes binary data easier to read, write and remember.
Q19. What is the purpose of a computer's main memory?
Main memory stores the data and programs that the CPU is currently working on, in binary form. It is built from circuits such as flip-flops, each able to hold one bit, and the bits are organised into cells (usually bytes), each with its own address.
It is called RAM (Random Access Memory) because any cell can be reached independently of the others, which allows quick retrieval and change of data. RAM is volatile: its contents are lost when the power is switched off.
Q20. How does zoned-bit recording work in mass storage systems?
On a magnetic disk, outer tracks are longer than inner ones. In zoned-bit recording, adjacent tracks are grouped into zones, and every track within a zone has the same number of sectors. Outer zones have more sectors per track than inner zones.
This lets the disk use its surface efficiently, because the storage density stays about the same across the disk, which gives more capacity than using the same number of sectors on every track.
Q21. What is the advantage of optical systems such as CDs for data storage?
A CD stores data on a single track in the form of a spiral, and a laser reads it by detecting irregularities on the reflective surface. This makes optical disks well suited to long continuous strings of data, such as music.
The drawback is that data cannot be reached individually as quickly as on a magnetic disk, so random access is slower.
Q22. How many bits does ASCII use for each character, and how many bits are needed to store the text "Virtual University"?
ASCII is a 7-bit code (128 symbols), and each character is normally stored in one 8-bit byte (the extra bit is a leading 0).
"Virtual University" has 18 characters (Virtual = 7, the space = 1, University = 10), so it needs 18 x 8 = 144 bits = 18 bytes.
Q23. What is the limitation of ASCII, and which organization introduced extensions to address it?
ASCII can represent only 128 different characters, which is not enough for the symbols of many languages. The International Organization for Standardization (ISO) introduced extensions, using 8-bit patterns (256 symbols), to cover the symbols of Western languages.
Q24. How does Unicode differ from ASCII, and what is the significance of its 21-bit patterns?
Unicode is an internationalized coding system that gives every character a unique pattern of up to 21 bits. This allows more than two million different patterns, enough for the characters of the world's languages, including Chinese, Japanese and Hebrew, whereas ASCII is limited to 128 characters (mainly English).
Q25. What is the advantage of MIDI for representing sound, and how does it differ from traditional sound encoding?
MIDI (Musical Instrument Digital Interface) encodes directions for producing the music (which instrument, which note, how long) instead of recording the sound wave itself. It is like the sheet music a performer reads rather than the recorded performance.
Advantages: files are much smaller, so it is efficient for storage and transmission. Traditional methods store the actual sampled audio, which needs far more space. (The sound produced does depend on the synthesizer playing the MIDI data.)
Q26. What is the purpose of the radix point in binary representation, and how is it used in floating-point notation?
The radix point plays the same role in binary as the decimal point in decimal numbers: it separates the whole-number part of a value from its fractional part.
In floating-point notation a value is stored in three fields: the sign bit, the exponent field and the mantissa field. The mantissa holds the significant bits of the value, and the exponent tells where the radix point has to be placed, which lets fractional values be represented.
Q27. How does two's complement notation represent negative integers, and what is the role of the sign bit?
Two's complement counts backwards from zero: with 4 bits, 0000 = 0, 1111 = -1, 1110 = -2, and so on down to 1000 = -8. Positive values run from 0001 = 1 up to 0111 = 7.
The leftmost bit is the sign bit: 0 means the value is zero or positive and 1 means negative. To negate a number, copy the bits from the right up to and including the first 1, then flip all the remaining bits (0101 = 5 becomes 1011 = -5).
Q28. What is the problem of overflow in two's complement notation, and how can it be handled?
Overflow occurs when the result of an arithmetic operation is outside the range that the available bits can represent, so the stored result is wrong. Example with 4 bits: 0101 (5) + 0100 (4) = 1001, which is read as -7 instead of 9.
It can be handled by using longer bit patterns (for example 32 bits instead of 16), and if the problem still occurs, by working in different units (for example kilometers instead of meters) so the numbers stay small enough to fit.
Q29. What is the normalized form in floating-point notation, and why is it important?
In normalized form the mantissa starts with the leftmost 1 of the value's binary pattern, so the radix point sits immediately to the left of a 1. Because of this rule, every value has only one representation, which removes ambiguity and makes comparison of numbers simple. All nonzero values have a mantissa that starts with 1.
Q30. How can subtraction be performed with addition in two's complement notation?
A subtraction a - b is carried out as a + (-b): the second number is negated (flip the bits and add 1) and then added to the first by the ordinary addition circuit. Any carry out of the leftmost bit is discarded.
Example (4 bits): 7 - 5 = 0111 + 1011 (which is -5) = 1 0010. Dropping the carry leaves 0010 = 2. This is why computers need only an adder and a negation circuit and no separate subtraction circuit.
Q31. What is a truncation error in floating-point notation, and how does it occur?
A truncation error is a loss of precision that occurs when a value needs more bits than the mantissa field can hold, so the extra low-order bits are cut off.
Example: with a one-byte floating-point format (1 sign bit, 3 exponent bits, 4 mantissa bits), the value 2 5/8 is 10.101 in binary. Its pattern 10101 needs five bits but only four fit, so the last 1 (which stands for 1/8) is lost and the stored value becomes 2 1/2.
Q32. How can truncation errors be reduced?
By using a longer mantissa field, which gives more bits for the fractional part. Modern computers use much longer formats (for example 32-bit single precision with a 23-bit fraction and 64-bit double precision with a 52-bit fraction). A longer exponent field is usually used along with it to widen the range of values.
Q33. What is a nonterminating expansion, how does it differ between binary and decimal, and how does it relate to truncation errors?
A nonterminating expansion is a value that cannot be written with a finite number of digits in a given base (for example 1/3 in decimal). More values are nonterminating in binary than in decimal: anything that terminates in binary also terminates in decimal, but not the other way round. For instance 1/10 terminates in decimal (0.1) but is nonterminating in binary.
Since a computer can store only a limited number of bits, such values are always truncated. For example, a dime (1/10 of a dollar) cannot be stored exactly in floating point. The solution is to work in units such as pennies, so that all values are integers and can be stored exactly in two's complement.
Q34. How does the order of adding small quantities affect accuracy in floating-point notation?
To limit truncation errors, add the smallest quantities first and the larger ones later.
Example: adding 1/8 + 1/8 first gives 1/4, and 2 1/2 + 1/4 = 2 3/4, which is stored exactly. If we add 2 1/2 + 1/8 first, the 1/8 is lost by truncation, and when the second 1/8 is added it is lost again, so the result is only 2 1/2.
Q35. What are the three main components of a CPU?
- Arithmetic/Logic Unit (ALU): performs arithmetic and logical operations on data
- Control Unit: coordinates the machine's activity by fetching and decoding instructions and directing the other parts
- Register Unit: a set of registers (general-purpose and special-purpose) used as fast temporary storage inside the CPU
Q36. How does the CPU perform operations on data stored in main memory?
The control unit first transfers the data from main memory into general-purpose registers inside the CPU. It then activates the proper circuitry of the arithmetic/logic unit, telling it which registers hold the operands and which register must receive the result. The result can then be stored back into main memory.
Q37. What are the two major philosophies of CPU architecture, and how do they differ?
RISC (Reduced Instruction Set Computer) uses a small set of simple machine instructions, which makes the CPU fast and efficient. CISC (Complex Instruction Set Computer) provides a large number of complex instructions to handle the complexity of modern software with fewer instructions per program. Intel's x86 processors are CISC, and ARM processors are a well-known RISC design.
Q38. How are machine instructions categorized, and what is the purpose of the data transfer group?
Machine instructions fall into three groups: data transfer, arithmetic/logic and control.
The data transfer group requests the movement or copying of data from one location to another, for example between memory and registers (LOAD and STORE) and between the CPU and input/output devices.
Q39. How is a machine instruction fetched from main memory to the CPU, and what decides the order of execution?
The control unit fetches the instruction from main memory over the bus, decodes it and executes it (the fetch, decode, execute cycle). The order is decided by the program counter, a register that holds the address of the next instruction. After each fetch it moves on to the following instruction, so instructions run in the order they are stored unless a JUMP instruction changes the program counter.
Q40. How is the AND operation used in data manipulation, and what is masking?
AND is often used to place 0s in one part of a bit pattern without disturbing the rest. One operand, called the mask, decides which part of the other operand is kept: where the mask has 1 the bit is preserved and where the mask has 0 the bit becomes 0.
Example: ANDing a byte with the mask 00100000 gives a result of all 0s if and only if the third bit from the left of the byte is 0. Masking therefore lets a program test or clear selected bits.
Q41. What is the purpose of rotate and shift operations, and how are they classified?
They move the bits of a register to the left or right and are often used to solve alignment problems. They are classified by the direction of movement (left or right) and by whether the movement is circular.
- Rotate (circular shift): bits that fall off one end re-enter at the other end
- Logical shift: bits that fall off the edge are discarded and the vacated place is filled with 0
- Arithmetic shift: like a shift but the sign bit is preserved, so it works for two's complement numbers
Shifting left or right by one place multiplies or divides a value by two (shifting by n places, by 2n).
Q42. What is the role of a controller in a computer system?
A controller is an intermediary device that handles communication between the computer and a peripheral device. It can be a circuit board plugged into the machine or be permanently mounted on the motherboard, and it connects to the peripheral through a cable or port.
It translates messages and data back and forth between the form used inside the computer and the form used by the peripheral, so the two stay compatible.
Q43. Why is the development of standards such as USB and FireWire significant for controllers?
These standards allow one controller to serve many different devices, so a new controller does not have to be bought for each new peripheral. For example, one USB controller can handle mice, printers, scanners, storage devices, digital cameras and smartphones. This makes connecting devices simpler and more flexible.
Q44. How does direct memory access (DMA) benefit performance, and what challenge does it create?
Benefit: with DMA, a controller can read from or write to main memory by itself, during times when the CPU is not using it. While the controller reads a block of data from a disk and moves it into memory, the CPU can carry on with other tasks, so CPU time is not wasted on slow transfers.
Challenge: the CPU and the controllers must share the same bus and main memory, so they compete for access. This congestion contributes to what is called the von Neumann bottleneck, and the coordination is complicated.
Q45. What are the two types of communication paths between computing devices, and how do they differ?
- Parallel communication: several signals are sent at the same time, each on its own line. It gives a high transfer rate over short distances, such as inside a computer.
- Serial communication: bits are sent one after another over a single path. The wiring is simpler and it suits longer connections, and modern serial standards such as USB and FireWire are very fast.
The choice depends on the speed required, distance and system design.
Q46. How does the operating system coordinate the execution of application software, utility software and itself?
By managing processes. Every program that is to be executed is treated as a process. The operating system allocates CPU time, memory and other resources to the processes, so they run in a scheduled, time-shared manner and seem to run at once. It makes sure the processes do not interfere with each other and provides ways for them to communicate and synchronize when they need to.
Q47. What is the difference between a program and a process?
A program is a static set of instructions (code and data) stored on disk. A process is the dynamic activity of executing that program, which exists once the program is loaded into memory and run by the operating system. A process includes the code, the data and the current state of execution, such as the register values and the memory cells in use.
Q48. What is meant by "process state" in an operating system?
The process state is a snapshot of a process at a particular moment: the value of the program counter, the values of other CPU registers and the contents of its memory cells. The operating system saves it when a process is interrupted and restores it later, so that the process can continue exactly where it stopped.
Q49. Why is booting (bootstrapping) necessary?
When a computer is switched on, its main memory (RAM) is volatile and empty, so there is no operating system in it. The CPU therefore starts executing a small bootstrap program stored in nonvolatile memory (ROM). This program loads the operating system from mass storage (such as the hard disk) into main memory and hands control to it. Without booting, the operating system could not start managing the machine.
Q50. How do the scheduler and the dispatcher work together in the operating system's kernel?
Both are part of the kernel. The scheduler keeps track of the processes: it adds new processes to the pool, removes the completed ones and maintains the process table. The dispatcher controls the execution of the scheduled processes: it gives each one a time slice and uses an interrupt to end the slice and switch to the next process.
Q51. What is the role of the process table, and what does it contain?
The process table is a block of information in main memory kept by the scheduler. It has an entry for each process containing the memory area assigned to it, its priority and whether it is ready or waiting for an external event.
Q52. How is mutual exclusion related to semaphores?
Mutual exclusion means that only one process at a time may execute a critical region (a part of a program that uses a shared resource). A semaphore is a flag that guards the critical region. A process must test and set the semaphore before it enters the region, and clear it when it leaves, so only one process can be inside at a time. The test-and-set has to be done as one indivisible operation.
Q53. What three conditions must hold for a deadlock to occur, and how can deadlock be handled?
A deadlock needs all three of these conditions:
- There is competition for non-sharable resources
- Resources are requested on a partial basis, that is, a process holds some resources while waiting for others
- Once allocated, resources cannot be forcibly retrieved
Deadlock can be handled by detection and correction (for example, detecting it and killing or rolling back a process) or by avoidance, which removes one of the conditions: for example, requiring all resources to be requested at once or making non-sharable resources sharable.
Q54. How are computer networks classified by size and coverage, and what are their typical uses?
- PAN (Personal Area Network): very short range, such as a wireless headset connected to a smartphone
- LAN (Local Area Network): computers in a single building or complex, such as a university campus
- MAN (Metropolitan Area Network): covers a local community or city
- WAN (Wide Area Network): connects machines over greater distances, across cities or continents
Q55. What distinguishes an open network from a closed (proprietary) network, and what is the implication for network development?
An open network is based on designs in the public domain, so anyone can use it without fees or licensing. A closed (proprietary) network is controlled by a particular entity, such as a company, which may charge licensing fees and impose restrictions.
Implication: open networks tend to become popular and widely adopted because anyone can use and improve them (the Internet is an example), while proprietary networks may earn income for their owner but have a smaller reach.
Q56. What is the difference between the bus and star network topologies? Give an example of each.
In a bus topology all machines are connected to a common communication line, the bus. Ethernet is the well-known example, popularized in the 1990s. In a star topology one central machine is connected to all the others, and all communication passes through it. Wireless networks, where the central machine is the access point, are the common example.
Q57. How does CSMA/CD work in a bus network, and why is it not suitable for wireless star networks?
Carrier Sense, Multiple Access with Collision Detection (CSMA/CD): each machine listens to the bus, and transmits only when it is silent. If two machines start at the same time, they detect the collision, stop, wait for a random period and try again.
It does not suit wireless star networks because a machine cannot always hear the transmissions of others (they may be out of range or interfere), so collisions cannot be detected reliably. Wireless networks therefore use CSMA/CA (Collision Avoidance), in which transmissions are coordinated through the access point to avoid collisions in the first place.
Q58. What is the fundamental difference between the imperative and declarative programming paradigms?
In the imperative paradigm the programmer writes the algorithm: a sequence of commands that manipulate data to produce the desired result. In the declarative paradigm the programmer only describes the problem to be solved, and the system applies pre-established, general-purpose problem-solving algorithms to find the solution. So imperative means "how to do it" and declarative means "what is to be solved".
Q59. Why were assembly languages a significant advancement over machine languages?
Machine languages require instructions to be written as numeric codes, which is tedious and error-prone. Assembly languages replaced them with mnemonic names (human-readable codes), so programs became easier to write, read and understand. A program called an assembler translates them into machine language. Assembly languages also paved the way for higher-level languages by adding a level of abstraction.
Q60. How did third-generation programming languages differ from earlier generations?
- They used higher-level primitives: each statement expresses a larger step than a machine instruction, which makes programming more intuitive.
- They were designed to be machine independent, so a program could be moved to a different computer with little change.
Early examples are FORTRAN (scientific and engineering) and COBOL (business applications).
Q61. Why did the development of programming languages follow several tracks?
Because different programming paradigms (approaches to the programming process) appeared and were developed independently: imperative, declarative, functional and object-oriented. Each is a fundamentally different way of building a solution, and each affects the whole software development process. They suit different kinds of problems, so each paradigm produced its own family of languages.
No comments:
Post a Comment
Please give us your feedback & help us to improve this site.