First 50 of 200 questions. Each one lists the choices, the correct answer, and an explanation. The checker at the top of this page saves progress in this browser when it is available.
Continue in the practice tool above to load more questions, 50 at a time.
Question 1Computer Systems: hardware, software and system architecture
Which component of a computer system is described as volatile because its contents are lost when power is removed?
- Hard disk drive
- ROM
- RAM Correct answer.
- Solid-state drive
Explanation
RAM stores programs and data currently in use and requires a continuous power supply to hold its contents. When the machine is switched off, the charge patterns in RAM cells disappear, so the data is lost. ROM and secondary storage such as hard disks and SSDs retain their contents without power.
Question 2Computer Systems: hardware, software and system architecture
A school buys a program that manages the hardware, schedules tasks and provides a user interface. Which class of software does this describe?
- Utility software
- Application software
- System software Correct answer.
- Programming software
Explanation
System software controls and coordinates the hardware and provides a platform on which other programs run; the operating system is the main example. Application software performs user tasks, utilities maintain the system, and programming software helps developers write code. Managing hardware and scheduling tasks is the defining role of the operating system.
Question 3Computer Systems: hardware, software and system architecture
Which unit of storage is equal to 1024 megabytes?
- One bit
- One kilobyte
- One gigabyte Correct answer.
- One terabyte
Explanation
In binary storage units, 1 kilobyte is 1024 bytes, 1 megabyte is 1024 kilobytes and 1 gigabyte is 1024 megabytes. Each step multiplies by 1024, so a gigabyte is the next unit above a megabyte. A terabyte is 1024 gigabytes, far larger than the value given.
Question 4Computer Systems: hardware, software and system architecture
Which device is classified as an input device?
- Speaker
- Touchscreen used to display output only
- Plotter
- Optical mark reader Correct answer.
Explanation
An optical mark reader senses marks on a form and converts them into data for the computer, so it is an input device. A plotter and a speaker produce output for the user. A touchscreen that is only displaying output is acting as an output device at that moment.
Question 5Computer Systems: hardware, software and system architecture
What is the main function of the control unit inside a processor?
- To store the results of calculations permanently
- To perform arithmetic on integer values
- To convert analogue signals into digital data
- To fetch, decode and coordinate the execution of instructions Correct answer.
Explanation
The control unit directs the operation of the processor by fetching instructions, decoding them and sending control signals to other components. Arithmetic is handled by the ALU, while storage is handled by registers and memory. This coordinating role is what distinguishes the control unit from the datapath elements.
Question 6Computer Systems: hardware, software and system architecture
Which type of software is distributed free of charge for a trial period, after which the user must pay to continue using it?
- Shareware Correct answer.
- Freeware
- Open-source software
- Firmware
Explanation
Shareware is offered at no cost for evaluation, with payment required to keep using it or to unlock full features. Freeware remains free to use, and open-source software provides access to the source code under a licence. Firmware is software stored in hardware such as ROM.
Question 7Computer Systems: hardware, software and system architecture
A user needs a storage medium that is portable, has no moving parts and can be rewritten many times. Which medium best meets these requirements?
- Magnetic tape
- Blu-ray disc
- CD-ROM
- USB flash drive Correct answer.
Explanation
A USB flash drive uses solid-state memory, so it has no moving parts, is small enough to carry and can be erased and rewritten repeatedly. Magnetic tape is rewritable but relies on a moving mechanism and is not convenient for personal portability. A CD-ROM is read-only, so it cannot be rewritten.
Question 8Computer Systems: hardware, software and system architecture
Which of the following best describes the purpose of a device driver?
- It provides a graphical interface for the user
- It translates the operating system's instructions into signals a specific hardware device understands Correct answer.
- It compresses files before they are saved to disk
- It checks the computer for malicious software
Explanation
A device driver is software that acts between the operating system and a particular piece of hardware, converting general commands into the specific signals that device requires. Different devices need different drivers because their command sets differ. Compression, user interface and antivirus functions belong to other types of software.
Question 9Computer Systems: hardware, software and system architecture
A program uses a printer to produce a document. In terms of the stored program concept, which sequence correctly describes how the instruction to print is handled?
- The instruction is stored in secondary storage and executed directly from there by the ALU
- The instruction is executed by the printer before it is fetched by the processor
- The instruction is fetched from main memory into the processor, decoded and then executed Correct answer.
- The instruction is decoded first in main memory and then fetched into the control unit
Explanation
Under the stored program concept, both instructions and data are held in main memory, and the processor repeatedly fetches an instruction, decodes it and executes it. The instruction must be in main memory before it can enter the processor. Execution cannot happen before fetch and decode.
Question 10Computer Systems: hardware, software and system architecture
Why does a computer system normally include cache memory between the processor and main memory?
- To hold frequently used instructions and data so the processor spends less time waiting Correct answer.
- To convert machine code into high-level language
- To increase the total permanent storage capacity of the machine
- To provide backup power during a failure
Explanation
Cache is a small, very fast memory that keeps recently or frequently used instructions and data close to the processor. Because accesses to cache are quicker than accesses to main memory, the average time the processor waits for data is reduced. Cache therefore improves speed rather than capacity.
Question 11Computer Systems: hardware, software and system architecture
A company wants a storage system for archiving old records that are rarely accessed but must be kept for many years at low cost per gigabyte. Which choice is most suitable?
- Additional RAM
- Cache memory
- A larger monitor
- Magnetic tape Correct answer.
Explanation
Magnetic tape offers very low cost per gigabyte and is well suited to long-term archiving where data is written once and rarely read. Its sequential access makes it slow for random retrieval, but this matters little for archives. RAM and cache are volatile and expensive per gigabyte, and a monitor stores nothing.
Question 12Computer Systems: hardware, software and system architecture
Which statement correctly distinguishes a compiler from an interpreter?
- A compiler detects no errors, while an interpreter detects all errors before running
- A compiler translates the whole program before execution, while an interpreter translates and executes one statement at a time Correct answer.
- A compiler runs the source code directly, while an interpreter produces an executable file
- A compiler is used only for low-level languages, while an interpreter is used only for high-level languages
Explanation
A compiler converts the entire source program into object code in one process before the program runs, producing an executable. An interpreter translates and executes the source one statement at a time, stopping when it meets an error. This difference explains why compiled programs usually run faster but need recompilation after changes.
Question 13Computer Systems: hardware, software and system architecture
Which type of operating system is most appropriate for controlling a washing machine, where the program is fixed and must respond to sensor input within a strict time limit?
- A batch processing operating system
- A multi-user network operating system
- A real-time operating system Correct answer.
- A distributed operating system
Explanation
A real-time operating system guarantees a response within a defined and predictable time limit, which is essential when sensors and actuators must be handled promptly. Embedded control systems such as washing machines rely on this guarantee. Multi-user, batch and distributed systems are designed for other workloads and offer no such timing guarantee.
Question 14Computer Systems: hardware, software and system architecture
A technician adds more RAM to a computer that was running slowly while several programs were open. Why is this likely to improve performance?
- It reduces the need to move data to and from virtual memory on disk Correct answer.
- It increases the capacity of the hard disk
- It removes the need for an operating system
- It increases the clock speed of the processor
Explanation
When RAM is full, the operating system moves pages of data to disk in a process called virtual memory or paging, which is much slower than accessing RAM. Adding RAM allows more programs to stay resident, reducing paging and therefore speeding up the system. The amount of RAM does not change the processor clock speed.
Question 15Computer Systems: hardware, software and system architecture
Which characteristic is typical of a solid-state drive compared with a magnetic hard disk drive?
- It requires defragmentation after every use
- It stores more data per unit cost in all cases
- It has faster access times and no moving parts Correct answer.
- It is more easily damaged by being dropped
Explanation
An SSD stores data in flash memory cells with no moving parts, so it has no seek or rotational delay and is far more resistant to shocks. Access times are therefore much shorter than for a hard disk, which must position a read head. Cost per gigabyte is generally higher for SSDs, not lower.
Question 16Computer Systems: hardware, software and system architecture
Which type of software would a programmer use to convert assembly language into machine code?
- A spreadsheet application
- An assembler Correct answer.
- A web browser
- A device driver
Explanation
Assembly language uses mnemonics that correspond closely to machine instructions, and an assembler translates these mnemonics into the binary machine code the processor executes. A compiler generally translates high-level languages, while a browser, spreadsheet and driver serve unrelated purposes.
Question 17Computer Systems: hardware, software and system architecture
Which statement best explains why a computer needs both primary and secondary storage?
- Primary storage is fast but volatile and limited, while secondary storage is slower but non-volatile and large Correct answer.
- Both types of storage are volatile, so they are used interchangeably
- Primary storage is non-volatile and cheap, while secondary storage is volatile and expensive
- Secondary storage is faster than primary storage, so it is used for running programs
Explanation
Primary storage such as RAM is very fast and directly accessible by the processor, but it is volatile and comparatively expensive, so its capacity is limited. Secondary storage such as a hard disk or SSD is slower to access but non-volatile and cheap per gigabyte, so it holds programs and files permanently. The two types complement each other.
Question 18Computer Systems: hardware, software and system architecture
A user complains that a laptop's battery drains quickly and the fan runs constantly. Which action is most likely to reduce power consumption?
- Replacing the hard disk with a larger one
- Closing unused background applications Correct answer.
- Increasing the screen brightness
- Adding an external monitor
Explanation
Background applications keep the processor busy, and a busy processor draws more power and produces more heat, which makes the fan run. Closing unused programs reduces processor load and therefore power use. Brightness and external displays increase power demand rather than reduce it.
Question 19Computer Systems: hardware, software and system architecture
Which statement about the fetch-decode-execute cycle is correct?
- The program counter holds the address of the next instruction to be fetched Correct answer.
- Decoding happens before the instruction is fetched into the processor
- Execution always writes a result to secondary storage
- The accumulator stores the address of the next instruction to be fetched
Explanation
The program counter is a register that holds the address in memory of the next instruction to be fetched. During the cycle the instruction at that address is copied into the processor, decoded, and then executed. Decoding cannot precede fetching, and results usually go to registers or main memory rather than directly to disk.
Question 20Computer Systems: hardware, software and system architecture
Which of the following is an example of utility software rather than application software?
- A program that plays video files for the user
- A program that compresses files to save disk space Correct answer.
- A program that calculates payroll for a company
- A program that writes and edits letters
Explanation
Utility software performs housekeeping tasks that maintain the computer system, such as file compression, backup, disk checking and antivirus scanning. Word processing, media playback and payroll calculation serve the user's direct tasks and are therefore application software. File compression maintains the system's storage rather than producing user content.
Question 21Computer Systems: hardware, software and system architecture
An operating system uses a time-slicing scheduler on a single processor. Which outcome should be expected?
- Programs are permanently prevented from sharing the processor
- Only one program can ever be loaded into memory
- Each program receives a short turn in rotation, giving the impression of simultaneous execution Correct answer.
- Each program runs to completion before the next one starts
Explanation
Time slicing gives each runnable process a short burst of processor time in turn. Because the slices are brief and the switch is frequent, users perceive the programs as running at the same time, even though there is only one processor. Programs do not run to completion in one turn under this scheme.
Question 22Computer Systems: hardware, software and system architecture
A computer has a 12-bit address bus. What is the maximum number of distinct memory locations it can address directly?
- 512
- 1024
- 2048
- 4096 Correct answer.
Explanation
Each address line can carry one bit, so n address lines allow 2 to the power n distinct addresses. For 12 lines this is 2^12, which equals 4096. The result is the number of addressable locations, not the number of bits stored in each location.
Question 23Computer Systems: hardware, software and system architecture
Which statement best explains why a von Neumann architecture can suffer from a bottleneck during program execution?
- The processor has no registers to hold intermediate results
- Instructions and data share the same bus to main memory, so they cannot be transferred at the same time Correct answer.
- Secondary storage is faster than main memory
- Input devices must be polled before every instruction
Explanation
In a von Neumann machine, instructions and data are stored together in the same memory and travel over the same path to the processor. Because only one transfer can use that path at a time, fetching an instruction and fetching its operand cannot occur simultaneously, which limits throughput. This limitation is known as the von Neumann bottleneck.
Question 24Computer Systems: hardware, software and system architecture
A system uses DMA for transferring blocks of data from disk to memory. What is the main benefit of this approach?
- The processor is freed from copying each byte and can perform other work Correct answer.
- Data is compressed automatically during transfer
- The processor clock speed is increased during the transfer
- The data transfer becomes completely independent of the operating system
Explanation
With direct memory access, a dedicated controller moves data between a device and memory without the processor handling every byte. The processor only sets up the transfer and is interrupted when it finishes, so it can execute other instructions in the meantime. DMA does not change clock speed or compress data.
Question 25Computer Systems: hardware, software and system architecture
Which combination of memory characteristics would give the fastest average access to frequently used instructions?
- A read-only memory holding all program data
- A large cache with high hit rate and short access time Correct answer.
- A large amount of virtual memory on a slow disk
- A large hard disk with high capacity and long access time
Explanation
Average access time depends on how often a request is served from fast memory and how fast that memory is. A cache with a high hit rate and short access time serves most requests quickly, so the average is low. Disk-based virtual memory and read-only storage are much slower for the working set of instructions.
Question 26Computer Systems: hardware, software and system architecture
Which statement best describes the role of the control unit within a processor?
- It stores the programs and data that are currently in active use.
- It performs arithmetic and logical operations on data held in registers.
- It converts high-level source code into executable machine code before the program runs.
- It coordinates the timing and sequencing of instructions during the fetch-decode-execute cycle. Correct answer.
Explanation
The control unit directs the operation of the processor by generating control signals that sequence the fetch-decode-execute cycle and coordinate the other units. It does not itself carry out arithmetic, hold main memory, or translate source code, which are tasks of the ALU, main memory and translators respectively.
Question 27Computer Systems: hardware, software and system architecture
A computer's main memory is described as volatile. What does this mean in practice?
- It retains its contents indefinitely without any power source.
- Its contents are lost when the power supply is switched off. Correct answer.
- It can only be accessed in fixed-size blocks rather than individual addresses.
- Its contents can be read but never written to by the processor.
Explanation
Volatile memory, such as RAM used as main memory, requires a continuous power supply to hold its contents, so the stored data is lost when power is removed. Non-volatile media such as ROM, SSDs and hard disks keep their contents without power.
Question 28Computer Systems: hardware, software and system architecture
Which item is an example of system software rather than application software?
- A spreadsheet package used to prepare a budget.
- A photo-editing program used to retouch images.
- A web browser used to access online resources.
- An operating system that manages hardware and provides services to programs. Correct answer.
Explanation
System software manages the computer's hardware and provides a platform on which application programs run; the operating system is the main example. Spreadsheets, browsers and photo editors are application software because they perform tasks for the end user.
Question 29Computer Systems: hardware, software and system architecture
A user wants to run several demanding programs at once on a computer with a single processor. Which upgrade would most directly allow more programs to remain in main memory at the same time?
- Increasing the amount of RAM installed Correct answer.
- Replacing the hard disk with a larger-capacity model
- Fitting a higher-resolution monitor
- Adding a second optical drive
Explanation
The number of programs that can be held ready in main memory depends on the capacity of RAM, so adding memory allows more programs and data to be resident simultaneously. A larger disk only affects secondary storage capacity, and the monitor and optical drive do not hold running programs.
Question 30Computer Systems: hardware, software and system architecture
A program written in a high-level language must be translated once into an executable file that can be distributed and run later without the translator present. Which type of translator is required?
- An assembler
- An interpreter
- A compiler Correct answer.
- A linker
Explanation
A compiler translates the whole source program into machine code and produces an executable file that can be distributed and run independently of the translator. An interpreter translates and executes line by line at run time, so it must be present each time the program runs.
Question 31Computer Systems: hardware, software and system architecture
An operating system uses a spooler for jobs sent to a shared printer. What is the main purpose of this arrangement?
- To allow several printers to print the same job simultaneously
- To convert the document into a bitmap image before printing
- To store print jobs in a queue so that they can be processed in turn while the computer continues other work Correct answer.
- To compress each document so that it uses less disk space
Explanation
A spooler holds output jobs on disk in a queue and sends them to the printer as it becomes available, so the processor and user are not forced to wait for the slow printing device. This is an example of the operating system managing peripheral devices and overlapping slow I/O with other processing.
Question 32Computer Systems: hardware, software and system architecture
A file is stored on a magnetic hard disk. Which statement correctly describes how the data is recorded and located?
- Data is stored as patterns of holes punched through a rotating card.
- Data is stored as pits and lands read by a laser along a spiral track.
- Data is stored as magnetised regions on concentric tracks, addressed by track and sector. Correct answer.
- Data is stored as electric charge held in transistor cells arranged in rows.
Explanation
A magnetic hard disk records data as magnetised regions on concentric tracks divided into sectors, and the read/write head locates a block by its track and sector address. Optical media use pits and lands read by a laser, while flash memory holds charge in transistor cells.
Question 33Computer Systems: hardware, software and system architecture
In a stored program computer, what is the function of the program counter?
- It holds the data item currently being written to memory.
- It counts the number of arithmetic operations completed.
- It holds the address of the next instruction to be fetched. Correct answer.
- It stores the instruction that has just been decoded.
Explanation
The program counter holds the address of the next instruction to be fetched, and it is incremented or set to a new value so that instructions are executed in the required sequence. The current instruction itself is held in the current instruction register, and data being transferred passes through the memory data register.
Question 34Computer Systems: hardware, software and system architecture
Which statement best explains why read-only memory is used to hold the start-up instructions of a computer?
- Its contents are retained when power is removed and cannot normally be altered by ordinary programs. Correct answer.
- It is cheaper per byte than any other form of memory.
- It is volatile, so it can be updated whenever the computer restarts.
- It offers the greatest capacity of any storage device in the system.
Explanation
Start-up instructions must be available immediately when power is applied, so they are stored in non-volatile ROM whose contents survive a power loss and are protected from accidental change by ordinary programs. Volatility, cost and capacity are not the reasons for using ROM for boot instructions.
Question 35Computer Systems: hardware, software and system architecture
A designer must choose between a hard disk drive and a solid-state drive for a rugged handheld device that is frequently dropped and must start quickly. Which choice is best supported?
- A hard disk drive, because magnetic media cannot be damaged by physical shock.
- A solid-state drive, because it has no moving parts that shock can disturb and it offers faster access. Correct answer.
- A solid-state drive, because it stores data by magnetising rotating disks.
- A hard disk drive, because its spinning platters give faster random access.
Explanation
A solid-state drive has no moving parts, so it is more resistant to shock and vibration, and it provides faster access because there is no seek or rotational delay. A hard disk relies on spinning platters and moving heads, which are vulnerable to physical shock and slower for random access.
Question 36Computer Systems: hardware, software and system architecture
A processor has a 16-bit address bus and an 8-bit data bus. What is the maximum number of distinct memory locations that can be addressed directly?
- 256
- 4 294 967 296
- 16 384
- 65 536 Correct answer.
Explanation
The number of addressable locations equals two raised to the power of the number of address lines, so a 16-bit address bus gives 2^16 = 65 536 locations. The data bus width affects how many bits are transferred at a time, not the number of addressable locations.
Question 37Computer Systems: hardware, software and system architecture
A computer is fitted with a faster processor, but programs that perform many disk reads show little improvement. Which explanation is most consistent with this observation?
- Disk reads are performed by the arithmetic logic unit, which the new processor lacks.
- The processor is waiting for slower secondary storage, so the processor is not the limiting factor. Correct answer.
- Adding a faster processor always reduces the amount of RAM available to programs.
- The faster processor consumes more power, which automatically reduces the clock speed.
Explanation
Overall performance is limited by the slowest component in the chain, so a faster processor gives little benefit when programs spend most of their time waiting for comparatively slow disk input/output. This is a form of bottleneck in which secondary storage, not processing speed, governs execution time.
Question 38Computer Systems: hardware, software and system architecture
Two processes share a single processor under a pre-emptive multitasking operating system. Process A is compute-bound and Process B waits for keyboard input. Which scheduling outcome best uses the processor?
- Both processes should be run simultaneously on the single processor at all times.
- Process B should be given the processor permanently because input devices are slower.
- When Process B blocks for input, the scheduler should run Process A so that the processor is not left idle. Correct answer.
- Process A should be blocked whenever Process B is running, even if B is waiting for input.
Explanation
When a process blocks waiting for input, it cannot use the processor, so a good scheduler dispatches another ready process such as A to keep the processor busy. This improves utilisation and throughput while still allowing B to resume when its input arrives.
Question 39Computer Systems: hardware, software and system architecture
A system uses direct memory access for a large block transfer from disk to memory. Why does this improve overall performance compared with processor-controlled transfer?
- The DMA controller increases the clock speed of the processor during the transfer.
- The DMA controller performs the transfer while the processor carries out other instructions. Correct answer.
- The DMA controller replaces the operating system's file management functions.
- The DMA controller compresses the data so that fewer bytes need to be moved.
Explanation
A DMA controller moves blocks of data between a device and memory without the processor handling each byte, so the processor is free to execute other instructions and is interrupted only when the transfer completes. This reduces the overhead of many individual transfer instructions.
Question 40Computer Systems: hardware, software and system architecture
A small embedded controller stores its fixed start-up routine in ROM and uses RAM as its working memory while running. Which statement correctly distinguishes the roles of these two stores in this system?
- ROM holds the start-up routine permanently and RAM holds the data and instructions currently in use. Correct answer.
- Both ROM and RAM are cleared when power is removed, so the start-up routine is reloaded from the disk each time.
- Both ROM and RAM hold the start-up routine permanently, but RAM is used only when the controller is switched off.
- ROM holds the data and instructions currently in use and RAM holds the start-up routine permanently.
Explanation
Read-only memory retains its contents without power, so firmware such as a start-up routine is placed there and cannot be altered during normal running. Random-access memory is the volatile working store where the processor keeps the programs and data it is actively using. The two stores therefore serve different purposes: permanence of firmware versus temporary working space.
Question 41Data Representation and Number Systems
In the binary number system, what is the place value (weight) of the digit in the fourth position from the right?
- 16
- 8 Correct answer.
- 2
- 4
Explanation
Binary positions are weighted by powers of two, starting at 2^0 = 1 on the far right. Moving left, the weights are 1, 2, 4, 8, so the fourth position from the right carries the weight 2^3 = 8.
Question 42Data Representation and Number Systems
Which decimal value is represented by the binary number 1011?
- 15
- 9
- 11 Correct answer.
- 13
Explanation
Evaluate each set bit against its power-of-two weight: 1×8 + 0×4 + 1×2 + 1×1. Summing these gives 8 + 2 + 1 = 11.
Question 43Data Representation and Number Systems
Which of the following is the correct 8-bit binary representation of the decimal number 100?
- 01001010
- 01100100 Correct answer.
- 10100100
- 01100010
Explanation
The largest power of two not exceeding 100 is 64, leaving 36; then 32 leaves 4, and 4 leaves 0. Setting the 64, 32 and 4 bits gives 01100100.
Question 44Data Representation and Number Systems
What is the denary equivalent of the hexadecimal number 2F?
- 45
- 31
- 47 Correct answer.
- 215
Explanation
Each hexadecimal digit is weighted by a power of 16, so 2F means 2×16 + F×1. Since F represents 15, the value is 32 + 15 = 47.
Question 45Data Representation and Number Systems
Which statement best describes the purpose of the ASCII character set in data representation?
- It assigns a unique numeric code to each character so text can be stored and exchanged. Correct answer.
- It compresses text files so that they occupy less secondary storage space.
- It defines the physical keyboard layout used to enter characters.
- It converts analogue sound signals into a stream of digital samples.
Explanation
ASCII is a character encoding standard that maps each character to a specific binary code, allowing computers to store, compare and transmit text consistently. It is not concerned with compression, sound sampling or keyboard hardware.
Question 46Data Representation and Number Systems
How many distinct values can be represented using 6 bits?
- 32
- 128
- 12
- 64 Correct answer.
Explanation
With n bits there are 2^n distinct bit patterns. For n = 6, 2^6 = 64, so 64 different values (for example 0 to 63) can be represented.
Question 47Data Representation and Number Systems
A file is described as 4 KiB in size. What does this measurement represent?
- 1024 bytes of data
- 4000 bits of data
- 4096 bytes of data Correct answer.
- 4 000 000 bytes of data
Explanation
The prefix Ki (kibi) denotes a factor of 2^10 = 1024, so 4 KiB equals 4 × 1024 = 4096 bytes. This differs from the decimal SI prefix kilo, which denotes 1000.
Question 48Data Representation and Number Systems
A colour image uses a palette of 256 colours. What is the minimum number of bits needed to store the colour code for each pixel?
- 4
- 16
- 256
- 8 Correct answer.
Explanation
The number of bits n must satisfy 2^n ≥ 256. Since 2^8 = 256, exactly 8 bits are needed to encode each of the 256 colour codes.
Question 49Data Representation and Number Systems
Which binary operation is used to test whether a particular bit in a byte is set to 1?
- NOT applied to the whole byte
- AND with a mask that has 1 only in the target position Correct answer.
- OR with a mask that has 1 only in the target position
- XOR with a mask that has 1 in every position
Explanation
ANDing a byte with a mask that has a single 1 in the target position leaves that bit unchanged and forces all other bits to 0. The result is non-zero only when the target bit is set, which is exactly the test required.
Question 50Data Representation and Number Systems
Using 8-bit two's complement, what is the binary representation of the decimal number -5?
- 11111010
- 00000101
- 11111011 Correct answer.
- 10000101
Explanation
The positive value 5 is 00000101. Inverting the bits gives 11111010, and adding 1 produces 11111011, which is the two's complement form of -5.