Chapter 1.1: Basic Concepts
Multiple Choice · How a Computer Works
Question 1: The Processing Stage at an ATM
When you withdraw cash from an ATM, which of these steps is the processing stage?
B: The comparison (balance ≥ amount?) and the arithmetic (balance − amount) are work done by the CPU. A is input, C is output, and D is storage. The same stages appear in every task: input → processing → output, with storage when needed.
Output Question · How a Computer Works
Question 2: Computing an Average
A student information system computes the average with the formula 0.4 × midterm + 0.6 × final. The teacher enters midterm = 50 and final = 80 in the form and presses “Calculate”. What appears on the screen? Identify each stage (input, processing, output, storage) in this example.
Show answer
Output: Average: 68
- Input: 50 and 80 are typed on the keyboard.
- Processing: 0.4 × 50 + 0.6 × 80 = 20 + 48 = 68 (ALU).
- Output: the result appears on the monitor. Storage: the grade record is written to the database.
Multiple Choice · How a Computer Works
Question 3: An Unsaved Document
Ten minutes of changes have been made to homework.docx open in Word, but the power fails before it is saved (autosave and AutoRecover are off). When the computer restarts and the file is opened, what do you see?
D: The open document and its changes are held in RAM, which is erased when power is cut. The “Save” command copies the document from RAM to the SSD, and the last copy on the SSD survives. (A program’s AutoRecover feature is a separate matter.)
Step-by-Step Trace · Binary System
Question 4: What Is 1100101₂?
The algorithm below converts a binary number to decimal using place values. After each bit, what are total and value, and what is the result?
The value of the rightmost place is 2⁰ = 1.
Rightmost bit is 1 → total + 1 = 1. The value doubles.
Bit 0 → 2 is not added. Bits that are 0 contribute nothing.
Bit 1 → 4 is added: 1 + 4 = 5.
Bit 0 → 8 is not added.
Bit 0 → 16 is not added.
Bit 1 → 32 is added: 5 + 32 = 37.
Leftmost bit is 1 → 64 is added: 37 + 64 = 101.
No bits left: 1100101₂ = 64 + 32 + 4 + 1 = 101.
bits ← 1100101 value ← 1 total ← 0 for each bit b from right to left: if b = 1 then total ← total + value value ← value × 2 print(total)
Step-by-Step Trace · Binary System
Question 5: Converting 37 to Binary
Trace the algorithm that converts 37 to binary by repeated division by 2. In each round, what are remainder, bits and number?
Method: divide by 2 until the quotient is 0, adding each remainder on the left.
37 ÷ 2 = 18, remainder 1 (odd number). The first remainder is the rightmost digit.
18 ÷ 2 = 9, remainder 0. The new remainder goes on the left.
9 ÷ 2 = 4, remainder 1.
4 ÷ 2 = 2, remainder 0.
2 ÷ 2 = 1, remainder 0.
1 ÷ 2 = 0, remainder 1. The quotient is now 0.
The condition is false → the loop ends. 37 = 100101₂; check: 32 + 4 + 1 = 37.
number ← 37 bits ← “” while number > 0 repeat: remainder ← number mod 2 bits ← remainder + bits number ← number div 2 print(bits)
Multiple Choice · Binary System
Question 6: How Many Bits Are Needed?
A car park will store 300 different vehicle codes as binary numbers. What is the minimum number of bits needed for each code?
B: n bits can represent 2ⁿ different values. Since 2⁸ = 256 < 300, 8 bits are not enough; since 2⁹ = 512 ≥ 300, 9 bits are enough. Each extra bit doubles the number of values that can be represented.
Multiple Choice · Data Representation
Question 7: The Bits of the Letter “B”
In the ASCII table “A” = 65, and the letters are coded consecutively in alphabetical order. When the “B” key is pressed on the keyboard, which bit sequence is stored in memory?
A: “B” = 66 = 64 + 2 → 01000010. C is the letter “A” (65); B is the lowercase letter “b” (98); and D is 130 (the 128 bit is set instead of the 64 bit).
Output Question · Data Representation
Question 8: Image File Size
How many bytes does an uncompressed image of 1280 × 720 pixels at 3 bytes per pixel (RGB) take? Taking 1 MiB = 1,048,576 bytes, about how many MiB is that?
Show answer
2,764,800 bytes ≈ 2.64 MiB
- Number of pixels: 1280 × 720 = 921,600.
- Each pixel takes 3 bytes: 921,600 × 3 = 2,764,800 bytes.
- 2,764,800 ÷ 1,048,576 ≈ 2.64 MiB.
If the resolution is doubled (2560 × 1440), the pixel count and the size grow 4 times.
Output Question · Data Representation
Question 9: Number of Video Frames
How many frames are in a 2-minute video at 24 fps? If each frame is 1280 × 720 × 3 bytes, about how many GiB does the uncompressed video take (ignore the sound)?
Show answer
2,880 frames · ≈ 7.4 GiB
- 2 minutes = 120 s → 24 × 120 = 2,880 frames.
- 2,880 × 2,764,800 = 7,962,624,000 bytes.
- ÷ 2³⁰ (1,073,741,824) ≈ 7.42 GiB.
This is why video files are almost always stored compressed; the sound is kept in a separate channel.
Multiple Choice · Units of Memory
Question 10: Why Does a 1 TB Disk Look Smaller?
A disk labeled “1 TB” on its box shows up as about 931 GB in the operating system. What is the reason?
B: 1,000,000,000,000 ÷ 1,073,741,824 ≈ 931.3. The byte count is the same; only the unit definition differs. C reverses the definitions. Multiples of 1,024 are written KiB, MiB, GiB in the IEC standard.
Output Question · Units of Memory
Question 11: Unit Conversions
Calculate with 1 KB = 1,024 B, 1 MB = 1,024 KB, 1 GB = 1,024 MB, 1 TB = 1,024 GB:
a) How many bits is 2 KB?
b) At most how many 3 MB photos fit on a 64 GB card?
c) How many 4 GB movies fit on a 1 TB disk?
Show answer
a) 16,384 bits b) 21,845 c) 256
- a) 2 × 1,024 = 2,048 bytes; × 8 = 16,384 bits (1 byte = 8 bits).
- b) 64 × 1,024 = 65,536 MB; 65,536 ÷ 3 = 21,845.3 → the number of whole photos is 21,845 (rounded down).
- c) 1,024 GB ÷ 4 = 256 movies.
Each step is a factor of 1,024 = 2¹⁰; between bits and bytes the factor is 8.
Multiple Choice · Processing Data
Question 12: The AND and OR Rules
A student has a score of 55 and attendance of 80. What are the values of (score ≥ 60) AND (attendance ≥ 70) and (score ≥ 60) OR (attendance ≥ 70), in that order?
A: 55 ≥ 60 is false (0), 80 ≥ 70 is true (1). AND gives 1 only if both sides are 1: 0 AND 1 = 0. OR gives 1 if either side is 1: 0 OR 1 = 1. Under the “and” rule the student fails; under the “or” rule the student passes.
Multiple Choice · Types of Computers
Question 13: A Bank’s Computer
A bank is looking for a system that will run millions of account transactions at the same time, without interruption and reliably. The priority is not computing speed but transaction volume and continuity. Which type is suitable?
C: Mainframes are designed for large numbers of simultaneous transactions, as in banking, insurance and large public systems. A supercomputer’s priority is speed in large scientific calculations such as climate modeling; a thin client is only an endpoint that reaches a central system.
Step-by-Step Trace · Types of Computers
Question 14: The Embedded Computer in an Air Conditioner
The microcontroller in an air conditioner runs this loop. If the sensor measures 27, 25, 24, 23, 26 °C in turn, what happens to the compressor and what is printed in each round?
An embedded computer runs a continuous measure → decide → act loop.
27 > 24 is true → the compressor turns on and the room cools.
25 > 24 is true → it stays on.
24 > 24 is false (equal is not greater) → the compressor turns off.
23 > 24 is false → it stays off.
The room warmed up: 26 > 24 → it turns on again. The loop never ends; it keeps measuring.
target ← 24 repeat forever: t ← readSensor() if t > target then compressor ← ON else compressor ← OFF print(t, compressor)
Output Question · Information Technology
Question 15: The Data Life Cycle
A weather station’s sensor sends 5 readings: 18.2 · −99 · 19.0 · 20.3 · 21.5 (°C). −99 is the sensor’s “fault” code. What is the output of the processing stage (the average)? Match the four stages to this example.
Show answer
Average: 19.75 °C
- Processing: −99 is an invalid reading and is discarded. (18.2 + 19.0 + 20.3 + 21.5) ÷ 4 = 79 ÷ 4 = 19.75.
- If −99 were not discarded: (79 − 99) ÷ 5 = −4 °C, a meaningless “information”.