Embedded engineer: Hardware Interfaces and Timing
Original technical interview practice in register semantics, DMA ownership, serial transactions, electrical and capture timing, conversion formats, and device-state evidence.
These prompts are original practice. They are not questions from a named employer or a live hiring loop.
1.A hypothetical register mixes ordinary RW bits 7:4 and write-one-to-clear status bits 3:0. A read returns 0xA5. Firmware wants RW field 0xB while preserving all status. What single write follows the supplied semantics?
Show answer and explanation
- 0xA5
- 0xB5
- 0xB0
- 0xBF
Answer: 0xB0
Write the desired upper field 0xB and zeros to W1C status bits, giving 0xB0. Copying the read status ones into the write would clear them. Mixed field semantics require constructing the transaction rather than blindly replaying a read value.
2.A register's reserved upper four bits read as ones but must be written as zeros by its contract. Lower four bits are ordinary RW. Why is unconditional read-modify-write of the whole byte unsafe?
Show answer and explanation
- Only the numeric register address determines write legality
- It can write forbidden ones back to reserved bits
- The lower writable field can never be changed
- Every reserved-bit read necessarily raises a bus fault
Answer: It can write forbidden ones back to reserved bits
Reserved read values need not be legal write values. Use the specified access width and field masks/semantics. A general memory-style update does not establish a valid device transaction.
3.A peripheral counter's low-word read latches its high word until a high-word read. What sequence captures one coherent two-word value under this contract?
Show answer and explanation
- Read high twice and infer the missing low value
- Read the live high first, then low without a snapshot rule
- Read low, then the latched high
- Either order, because separate device reads form one atomic transaction
Answer: Read low, then the latched high
The low read creates the snapshot and the following high read retrieves that snapshot's upper part. Access order is a device protocol, not a universal endianness rule. Other devices may define a different latch sequence.
4.A free-running 16-bit counter is exposed as two 8-bit words with no latch. Firmware reads high=0x12, then low=0x01, then high=0x13. What does the unequal high pair require under a high-low-high retry protocol?
Show answer and explanation
- Accept 0x1301 without any further sampling guarantee
- Accept 0x1201 as a guaranteed coherent snapshot
- Reset the counter because a changing high byte is forbidden
- Retry rather than accept the torn pair
Answer: Retry rather than accept the torn pair
The high word changed around the low read, so the initial pair may straddle rollover. The stated protocol retries until its coherence condition holds, subject to counter speed, read behavior, and any overflow assumptions.
5.A device latches a new 16-bit setting only when its low byte is written. Firmware must update high and low bytes separately. Which write order supplies the intended complete setting to that latch?
Show answer and explanation
- Low first, then high
- The byte order is irrelevant under every latch contract
- High first, then low
- Write low twice and omit high
Answer: High first, then low
The low write commits the pair. Writing high first prepares the upper byte before that commit. This order follows the supplied device behavior; CPU byte endianness alone does not select the correct register protocol.
6.A command bit was observed set for this request and then clears only on acceptance under the supplied contract. Work completes later, with a separate done flag. What does observing that command-bit clear establish?
Show answer and explanation
- The done flag is redundant by definition
- Every possible error was ruled out
- The external operation must have finished successfully
- Acceptance/clearing, not necessarily completion
Answer: Acceptance/clearing, not necessarily completion
A command bit can describe request capture rather than operation lifetime. Follow the device's explicit busy/done/error protocol. A cleared trigger is not automatically a completion acknowledgment.
7.A posted bus write can return to the CPU before the peripheral receives it. Firmware immediately assumes the device has acted. What ordering/completion evidence is missing?
Show answer and explanation
- Only the numeric width used for the written value
- A guarantee that a returned CPU store proves peripheral completion
- The platform-defined device-write completion protocol
- Only emitting a volatile store instruction
Answer: The platform-defined device-write completion protocol
Compiler access semantics, bus ordering, and device completion are distinct. An appropriate documented barrier/readback/acknowledgment sequence may be needed. Which mechanism is sufficient depends on the bus, memory type, and peripheral contract.
8.A status read clears its pending latch by contract. A helper reads status once to log it and again to decide what to service. What can the second read lose?
Show answer and explanation
- The event state consumed by the first read
- A guarantee that logging reads have no peripheral side effects
- Only a second copy of unchanged ordinary memory
- Only the presentation order of unrelated trace messages
Answer: The event state consumed by the first read
Device reads can be operations that change state. Capture the read result once and interpret it according to the protocol when appropriate. Repeated observation is not automatically passive or repeatable.
9.A hypothetical FIFO permits a 32-bit read that consumes four bytes, placing the earliest byte in the low eight bits. A driver performs that read, keeps only its low byte, and expects it consumed one byte. What data is lost to that driver?
Show answer and explanation
- Only the low byte it explicitly kept
- No bytes, because unused CPU bits return to the FIFO
- All future bytes, because word reads disable the device
- The other three consumed bytes
Answer: The other three consumed bytes
Access width can have device-side transaction semantics. The read consumed four bytes even though software retained one. Choosing or decoding a supported access must match the intended FIFO-consumption contract; discarding CPU bits does not undo a peripheral read.
10.A hardware register permits aligned 32-bit accesses only. A compiler-generated packed 8-bit field write is used at its address. What contract is unestablished?
Show answer and explanation
- That the generated bus access width/alignment is supported
- Only the byte-order interpretation of the register
- Only the field's arithmetic value
- A guarantee that all source-language field types map to supported device operations
Answer: That the generated bus access width/alignment is supported
The language expression and emitted access must match the hardware's allowed width, alignment, and side effects. Packed layout or bit-field convenience does not establish those properties. Use target-supported device access mechanisms.
11.A peripheral provides atomic SET and CLEAR aliases for ordinary output bits. Two execution contexts modify disjoint bits of that same output. What race can those aliases avoid compared with separate read-modify-write sequences?
Show answer and explanation
- Every electrical or bus-timing violation
- Overwriting another context's intervening bit update
- The need to know each context’s intended bit ownership
- Every possible pin-mux or output-enable configuration defect
Answer: Overwriting another context's intervening bit update
A hardware-supported bit operation can update only the requested bits atomically under its contract. This avoids one software RMW lost-update path; it does not make all accesses or resource ownership globally safe.
12.A status bit reports a level condition that remains true while a FIFO is nonempty. Firmware clears its interrupt latch without draining the FIFO. What can the device legitimately do under that level-triggered contract?
Show answer and explanation
- Suppress all future interrupts despite a still-asserted source
- Convert this source to edge-triggered semantics
- Discard every unread FIFO element automatically
- Reassert the pending interrupt
Answer: Reassert the pending interrupt
Acknowledging a latch is different from removing the asserted source condition. A level can remain active and retrigger. Service/acknowledgment order must follow the device protocol rather than assume one clear permanently removes the cause.
13.A driver writes buffer address and length, then rings a device doorbell. The device may fetch descriptors as soon as the doorbell arrives. What ordering must the publication sequence establish?
Show answer and explanation
- Descriptor/payload readiness before device ownership is announced
- Only the scheduling priority of the driver task
- A guarantee that source-code statement order covers every cache and bus
- Only the numerical value of the doorbell write
Answer: Descriptor/payload readiness before device ownership is announced
The device must not see ownership before the data it may consume is ready and visible under the platform's DMA/MMIO rules. This can require suitable cache maintenance, barriers, and mapping/ownership operations; one language-level store is not a universal proof.
14.The CPU uses virtual address V for a buffer; the DMA mapping operation returns bus address D, with V≠D. Which address belongs in the device's DMA-address field under this contract?
Show answer and explanation
- V
- D
- The address of the pointer variable holding V
- Any equal-width integer
Answer: D
CPU virtual and device bus address spaces can differ. Use the mapping/address returned for that device and maintain its lifetime/direction contract. Pointer size or arithmetic similarity does not establish device accessibility.
15.A DMA engine can address only the lowest 32-bit bus range. A mapped buffer requires bus address 0x1_0000_1000. What does truncating it to 0x1000 risk?
Show answer and explanation
- Automatic recovery of the missing high address bits by the device
- Accessing a different address instead of the intended buffer
- Extending the device’s address width by discarding high bits
- Only omitting redundant zeros from a printed address
Answer: Accessing a different address instead of the intended buffer
Address width is part of the device/mapping contract. Truncation changes identity, not merely representation. Obtain a supported mapping/buffer strategy or report failure rather than silently narrow an unsupported address.
16.A DMA transfer reads a CPU-written buffer on a noncoherent platform. Dirty cache lines have not been made visible to the device. What can DMA observe?
Show answer and explanation
- Older memory contents rather than the latest CPU writes
- A guarantee that an ordinary atomic flag flushes every DMA visibility path
- Only a diagnostic warning, never changed device-visible bytes
- Every newest CPU cache value without any coherency operation
Answer: Older memory contents rather than the latest CPU writes
DMA coherency is separate from CPU thread synchronization. Follow the platform's mapping, ownership, cache-maintenance, and ordering requirements. Do not infer device visibility from a compiler or atomic primitive alone.
17.On a supplied noncoherent platform, an old receive-buffer cache line remains dirty in the CPU. DMA writes new data to memory. A mistaken clean operation then writes that old CPU line back. What can happen?
Show answer and explanation
- The device-written data is guaranteed immutable after completion
- The clean necessarily imports the new device bytes into the cache
- Only the cache line address changes
- The old cached bytes overwrite the new DMA data
Answer: The old cached bytes overwrite the new DMA data
Cleaning writes dirty CPU contents toward memory under this supplied contract. If those bytes are stale relative to DMA writes, it can overwrite the new result. Correct maintenance and ownership depend on direction, platform, line granularity, and transfer phase.
18.A CPU-owned variable shares a cache line with a DMA receive buffer. Whole-line invalidation can discard dirty bytes. What allocation/ownership hazard exists?
Show answer and explanation
- Byte-disjoint data always have independent cache-line ownership
- Every cache line is necessarily maintained byte by byte
- Maintenance for the buffer can affect unrelated CPU-owned data
- Only the number of logical buffer elements changes
Answer: Maintenance for the buffer can affect unrelated CPU-owned data
Cache maintenance often operates on line granularity. Sharing a line across incompatible CPU/device ownership can lose or corrupt adjacent data. Alignment, isolation, direction, and the platform's coherency rules belong to the design.
19.Cache lines are 32 bytes. A buffer occupies byte addresses 0x104 through 0x123 inclusive. Which complete lines cover it?
Show answer and explanation
- Only 0x120–0x13F
- Exactly 0x104–0x123 as one aligned line
- 0x100–0x11F and 0x120–0x13F
- Only 0x100–0x11F
Answer: 0x100–0x11F and 0x120–0x13F
The buffer crosses the boundary at 0x120. Line-granular operations cover both aligned ranges. Ownership of any additional bytes in those lines must be considered rather than assume a maintenance operation touches only the named buffer.
20.A DMA-complete interrupt means the device finished one buffer, but the CPU immediately returns that buffer to DMA before the consumer finishes reading it. What safety condition is missing?
Show answer and explanation
- Only delivery of the already observed completion interrupt
- A guarantee that completion makes the buffer permanently immutable
- Only the device-visible address field’s numerical width
- Exclusive ownership/lifetime through consumer use
Answer: Exclusive ownership/lifetime through consumer use
Completion transfers an opportunity to acquire/use data; it does not eliminate subsequent reuse races. Buffer recycling must wait for the relevant consumers or use another correct copy/ownership protocol.
21.A circular DMA engine writes half A, then half B, then A again. CPU processing of A can exceed the time to finish B. What can happen without flow control or additional buffering?
Show answer and explanation
- Every half-complete interrupt automatically stops continuous DMA
- DMA overwrites A while the CPU still needs it
- Double buffering guarantees arbitrary consumer latency with no loss
- Only the textual names of the two halves change
Answer: DMA overwrites A while the CPU still needs it
Two buffers provide a finite processing window, not infinite ownership. Compare producer rate and consumer latency, and define overwrite/backpressure/loss behavior. A notification does not by itself reserve storage indefinitely.
22.A device fetches a descriptor's address and length separately while firmware edits both in place. No ownership or commit protocol prevents concurrent fetch. What can the device receive?
Show answer and explanation
- An inconsistent address/length combination
- Only a different descriptor name in the driver source
- Only the complete old pair or complete new pair automatically
- A guarantee that aligned atomic individual fields make the whole pair atomic
Answer: An inconsistent address/length combination
Individual field access does not establish coherent multi-field publication. Use the device's specified ownership/valid-bit/version/descriptor protocol and ordering so it consumes a complete compatible descriptor.
23.A DMA mapping is released while the device may still access it. A new mapping reuses the same bus range. What risk remains even if CPU pointers are no longer used?
Show answer and explanation
- An in-flight device operation can affect reused storage
- Every bus range stays permanently reserved to its first mapping
- Releasing a mapping necessarily stops every outstanding transaction
- Only the old CPU pointer’s printed value remains relevant
Answer: An in-flight device operation can affect reused storage
Mapping lifetime must cover actual device access and completion/quiescence. Removing a software mapping handle is not automatically device cancellation. Reuse needs the platform/device's proper stop, completion, and synchronization contract.
24.A driver observes a DMA error and retries the entire transfer. The peripheral operation increments an external counter and may have partially completed. What transaction property must recovery examine?
Show answer and explanation
- Whether replay can duplicate non-idempotent external effects
- A guarantee that every reported error means zero external progress
- Only the transfer buffer’s allocation capacity
- Only the syntax used for the retry loop
Answer: Whether replay can duplicate non-idempotent external effects
An error report can leave an uncertain or partial outcome. Recovery must use the device/protocol's completion, identity, and replay semantics rather than assume retrying is harmless. Buffer correctness alone does not establish external-effect correctness.
25.A DMA controller reports remaining count R for an original transfer of N elements, and this contract counts elements, not bytes. N=100,R=25, element size=4 bytes. What completed byte count follows if the snapshot is otherwise valid?
Show answer and explanation
- 400 bytes
- 300 bytes
- 100 bytes
- 75 bytes
Answer: 300 bytes
Completed elements are 100−25=75. Multiplying by four bytes each gives three hundred. Register count units and snapshot/wrap semantics must be explicit before interpreting progress.
26.An SPI target returns a response byte only during the eight clocks after its command byte. The controller sends the command and immediately reads the receive byte captured during those command clocks. What phase is missing?
Show answer and explanation
- An assumption that every simultaneous receive byte is the delayed response
- Eight additional clocks to receive the response
- Only widening the receive array’s element type
- Only reversing the command-phase receive byte’s order
Answer: Eight additional clocks to receive the response
SPI shifts receive bits while clocks are generated, but a target can define command latency. The driver must generate and interpret the correct response phase, often with dummy transmit bits, rather than treat every simultaneously received byte as requested data.
27.A supplied SPI transaction needs 8 command bits, 8 dummy clocks, and 16 response bits, with no gaps. At 4 MHz, what clocking time follows?
Show answer and explanation
- 32 μs
- 8 μs
- 4 μs
- 6 μs
Answer: 8 μs
Total clocks are 8+8+16=32. At four million clocks per second, duration is 32/4,000,000=8 μs. Chip-select setup/hold and other overhead would be additional if not included by the contract.
28.A target requires chip select asserted at least 50 ns before the first clock edge. A trace shows 40 ns. What timing margin follows relative to that requirement?
Show answer and explanation
- No constraint because the average clock frequency is permitted
- A 10 ns positive margin
- A 10 ns violation
- A 40 ns positive margin
Answer: A 10 ns violation
The observed interval is ten nanoseconds shorter than required. A correct average clock rate does not establish chip-select setup timing. Interpret trace resolution and uncertainty before making an actual hardware acceptance claim.
29.A device samples data at time 100 ns and requires 5 ns setup. The data last changed at 97 ns. What setup interval and result follow in this exact trace model?
Show answer and explanation
- 5 ns; requirement exactly met
- 7 ns; positive margin
- 3 ns; requirement violated
- 97 ns; requirement met
Answer: 3 ns; requirement violated
Data was stable for 100−97=3 ns before sampling, below five. Setup concerns the interval before the sampling event, not the absolute timestamp or the next edge.
30.A device samples at 100 ns and requires 3 ns hold afterward. Data changes at 102 ns. What hold interval and result follow in this exact trace model?
Show answer and explanation
- 5 ns; positive margin
- 102 ns; requirement met
- 2 ns; requirement violated
- 3 ns; requirement exactly met
Answer: 2 ns; requirement violated
The data remains stable for 102−100=2 ns after the edge, one short of the requirement. Setup and hold are separate constraints around the actual sampling event.
31.A serial clock period is 40 ns, with high time 30 ns and low time 10 ns. The device permits that frequency but requires both phases≥15 ns. What fails?
Show answer and explanation
- The low-phase minimum
- The high-phase minimum
- Both phases exceed a stated maximum
- No phase can fail when the mean clock frequency is allowed
Answer: The low-phase minimum
Frequency alone does not determine duty cycle or phase widths. Low lasts ten, below fifteen. Check all applicable pulse-width, setup, hold, and edge constraints rather than only the average rate.
32.A target requires uninterrupted clock pulses with no low phase longer than 2 μs during a frame. Software generates bits but can be preempted for 20 μs. What implementation property is unestablished?
Show answer and explanation
- Only hexadecimal formatting of the command byte
- A guarantee that correct byte values imply valid timing on every edge
- Only the fixed number of bits in a complete frame
- The frame's maximum inter-edge/phase timing
Answer: The frame's maximum inter-edge/phase timing
A correct bit sequence can violate temporal constraints. Use a design and timing evidence that bound allowed interruptions or a suitable hardware transfer mechanism. A nominal bit-rate setting does not cover arbitrary preemption gaps.
33.A device treats rising chip select as the end of a command frame. Its command is two bytes long. A driver toggles chip select after each byte. What transaction boundary is wrong?
Show answer and explanation
- Only total payload byte count determines transaction boundaries
- It splits one required frame into two
- Only CPU integer byte order changes
- The target necessarily concatenates independently ended frames
Answer: It splits one required frame into two
Chip-select behavior is part of framing. If the target resets/commits its parser at the intermediate boundary, two separate byte transfers are not equivalent to one two-byte frame. Follow the specified transaction semantics.
34.A sensor latches one multiword snapshot when chip select falls. Firmware toggles chip select between words and combines them as one sample. What can be mixed?
Show answer and explanation
- Only the bit numbering of the serial wire changes
- The same snapshot is guaranteed under every repeated select
- A guarantee that nearby reads are simultaneous
- Words from different snapshots
Answer: Words from different snapshots
Repeated frame starts can latch new source states. A coherent multiword sample needs the device's specified snapshot/transaction sequence, not only adjacent reads or a shared timestamp assigned afterward.
35.Two SPI targets share a receive wire. One target continues actively driving it while deselected, contrary to the bus-sharing assumption. What electrical issue can occur when the selected target drives a different level?
Show answer and explanation
- Output contention on the shared wire
- A guarantee that distinct chip-select pins isolate the shared receive conductor
- Only one redundant received byte with no electrical effect
- Automatic logical OR of all push-pull outputs
Answer: Output contention on the shared wire
Bus sharing depends on actual output-enable behavior, not chip-select names alone. Verify the targets' electrical drive/tri-state contract and board topology. Conflicting active drivers need not produce a valid logical value.
36.A target expects an 8-bit word least-significant bit first. Firmware sends the bits of 0x96 most-significant bit first. What value is the target's opposite bit-order interpretation of that eight-bit sequence?
Show answer and explanation
- 0x96
- 0x06
- 0x9A
- 0x69
Answer: 0x69
0x96 is 10010110 in MSB-first notation. Reversing those eight bit positions yields 01101001=0x69. Bit order within a word is distinct from byte endianness of a multi-byte value.
37.A UART frame has one start bit, eight data bits, one parity bit, and one stop bit. At 55,000 baud with no gaps, how many such data characters per second fit?
Show answer and explanation
- 5,000
- 6,875
- 55,000
- 5,500
Answer: 5,000
Each character occupies 1+8+1+1=11 line bits. Divide 55,000 by eleven to obtain five thousand characters per second. Payload throughput includes framing overhead and any actual gaps or flow-control stalls.
38.A supplied UART sampling model permits less than 0.5 bit total phase error. Start alignment error is 0.1 bit and accumulated drift is 0.04×9.5 bits in the same direction. What remaining margin follows?
Show answer and explanation
- 0.02 bit
- 0.12 bit
- −0.08 bit
- 0.38 bit
Answer: 0.02 bit
Total modeled error is 0.1+0.04×9.5=0.48 bit, leaving 0.02 before the 0.5 limit. Real acceptance also depends on the receiver's actual oversampling, edge detection, jitter, and frame contract.
39.A transmitter clock is 1.02 times nominal and receiver clock 0.98 times nominal. A supplied relative-frequency measure is
f_tx/f_rx−1. What value follows?Show answer and explanation
- 2%
- 2/49, about 4.08%
- 1/49, about 2.04%
- 4% exactly
Answer: 2/49, about 4.08%
The ratio is 1.02/0.98−1=(1.02−0.98)/0.98=0.04/0.98=2/49. Opposite nominal errors do not combine by exact simple addition under this specified relative definition.
40.A frame uses one parity bit to detect odd numbers of flipped protected bits. Exactly two protected data bits flip and no others do. What can the parity check report?
Show answer and explanation
- No parity mismatch despite corrupted data
- A guaranteed mismatch for every pair of flipped bits
- Automatic correction of both bit errors
- A guarantee that passing parity proves the payload unchanged
Answer: No parity mismatch despite corrupted data
Two flips preserve even/odd parity. Parity supplies limited detection, not complete integrity or correction. Use the actual error model and protocol requirements rather than interpret a passed parity check as proof of an uncorrupted frame.
41.A UART protocol allows long pauses inside a message. Firmware treats every idle-line interrupt as a complete-message boundary. What framing assumption is unproved?
Show answer and explanation
- A guarantee that electrical idle always means application completion
- Only that at least one receive byte exists
- That an allowed idle gap uniquely terminates a message
- Only the virtual address of the receive buffer
Answer: That an allowed idle gap uniquely terminates a message
Line-idle status and application framing are different layers. Valid pauses can split one message under the proposed parser. Use the specified length, delimiters, timing rules, or another justified framing protocol.
42.A receive FIFO holds eight bytes and contains four at time zero. No bytes are consumed; further bytes arrive at 10,20,30,40,50 μs. At which listed arrival does overflow first occur?
Show answer and explanation
- 10 μs
- No overflow occurs
- 50 μs
- 40 μs
Answer: 50 μs
Four slots are free initially. The first four arrivals fill them through time forty; the fifth at fifty exceeds capacity. This exact trace excludes simultaneous consumption; a real service bound must define those boundary orderings.
43.A receiver's capacity is ten bytes and occupancy is seven when it requests stop. The sender may still deliver five in-flight bytes, with no concurrent consumption. How many exceed capacity?
Show answer and explanation
- 2
- 5
- 3
- 0
Answer: 2
There are three free slots but up to five additional arrivals, leaving two beyond capacity. Flow control has response/in-flight latency. Assert thresholds must reflect the actual headroom and service model, not assume stop is instantaneous.
44.On a wired-low-dominant open-drain bus, a controller releases its data output to send one but reads zero during the arbitration sample. What does that sample show under the supplied arbitration rule?
Show answer and explanation
- A low physical level must be interpreted as a logical one
- Only multi-byte endianness differs between the senders
- Another participant's dominant zero wins this bit
- Its released output forces the physical wire high
Answer: Another participant's dominant zero wins this bit
Releasing an open-drain output does not drive high against another low driver. Arbitration compares intended and observed levels under the clocking rule. The controller must follow the bus's ownership/loss protocol rather than actively fight the line.
45.An I2C target holds clock low while a controller releases its clock output. The controller immediately samples data as if clock were high. What event did it fail to verify?
Show answer and explanation
- Only the total number of data bytes in the frame
- Only the controller’s own output register value
- The actual clock line rising after any permitted stretch
- A guarantee that releasing the clock makes the line high instantly
Answer: The actual clock line rising after any permitted stretch
Wired signaling and clock stretching can delay the observed clock edge. The protocol must follow the actual line/timing contract. Writing a released output is not equivalent to observing the wire high.
46.A bus supports multiple controllers. One transfer times out, but another controller may currently own the bus. Why can blindly generating recovery clocks be invalid?
Show answer and explanation
- Only the local attempt counter changes
- Recovery can interfere with another legitimate transaction
- A timeout automatically grants exclusive bus ownership
- Every local timeout proves that all other controllers are idle
Answer: Recovery can interfere with another legitimate transaction
Recovery actions need the bus/device's ownership and error-state rules. A local timeout does not prove global quiescence or permission to toggle shared lines arbitrarily. Establish the supported abort/recovery sequence for the actual topology.
47.A hypothetical target resets its register pointer on STOP but retains it across repeated START. A read requires writing the pointer then reading data without reset. What transaction sequence preserves it?
Show answer and explanation
- Any ordering that transmits the same total number of bytes
- Pointer write, STOP, delay, then read without setting the pointer again
- Pointer write, repeated START, read, then STOP
- Read first, then set the pointer only after data is returned
Answer: Pointer write, repeated START, read, then STOP
The supplied STOP behavior makes two separately ended transfers nonequivalent to the combined transaction. A repeated START preserves the required device state in this hypothetical contract. Follow actual device addressing/framing semantics.
48.A simplified I2C write sends one address byte, one register byte, and two data bytes. Each byte uses eight data clocks plus one ACK clock. Ignoring START/STOP and gaps, how many clocks follow?
Show answer and explanation
- 36
- 32
- 40
- 27
Answer: 36
Four bytes each occupy nine clocks, totaling thirty-six. The calculation counts the supplied acknowledgment phases; start/stop timing, stretching, and other overhead are outside this simplified count.
49.An I2C address phase receives a NACK. The device may be busy, unpowered, mistimed, or addressed incorrectly under the stated possibilities. What can that NACK alone uniquely diagnose?
Show answer and explanation
- Only a permanently damaged bus
- None of those causes by itself
- Only an incorrect address
- Only an unpowered device
Answer: None of those causes by itself
A negative acknowledgment is an observed protocol outcome, not a unique root-cause code for all contexts. Diagnose the actual timing, address representation, power, state, and bus evidence rather than infer one cause from the NACK alone.
50.An abstract arbitration bus sends 8-bit IDs MSB first; zero dominates one and the losing sender stops at its first conflicting bit. IDs 0x35 and 0x3A compete. Which wins?
Show answer and explanation
- 0x3A
- Both because their upper nibble matches
- Neither because arbitration compares host byte endianness
- 0x35
Answer: 0x35
Their bit strings are 00110101 and 00111010. At the first differing bit, 0x35 sends zero while 0x3A sends one, so 0x35 wins under the supplied rule. This is an abstract rule, not an unstated assumption about every bus protocol.
51.A supplied RC rise is V(t)=Vdd(1−
exp(−t/τ)). What time reaches 0.7Vdd from zero?Show answer and explanation
- −τ log(0.3), about 1.204τ
- τ log(0.7)
- Exactly τ
- 0.7τ
Answer: −τ log(0.3), about 1.204τ
Set 1−exp(−t/τ)=0.7, so exp(−t/τ)=0.3 and t=−τ log(0.3). Rise time depends on the chosen threshold definition, not only a single nominal time constant.
52.A study approximates a bus rise interval as 0.85RC. With R=2 kΩ and C=200 pF, what rise interval follows?
Show answer and explanation
- 3.4 μs
- 0.34 μs
- 0.034 μs
- 0.4 ns
Answer: 0.34 μs
RC=2000×200×10⁻¹²=0.4 μs. Multiplying by 0.85 gives 0.34 μs. The coefficient and lumped model are supplied; actual timing acceptance also needs device thresholds, wiring, and measurement uncertainty.
53.A hypothetical low driver must sink at most 3 mA with pull-up supply 3.3 V and allowed low voltage 0.3 V. Using I=(3.3−0.3)/R, what minimum R follows?
Show answer and explanation
- 100 Ω
- 1 kΩ
- 10 kΩ
- 3 kΩ
Answer: 1 kΩ
The resistor sees three volts. Requiring 3/R≤0.003 gives R≥1000 Ω. This is the supplied ideal bound, not a full circuit selection without tolerance, voltage, rise-time, and device constraints.
54.A study requires 1 kΩ≤R≤1.76 kΩ after combining sink and rise bounds. Which listed resistor satisfies both nominal bounds?
Show answer and explanation
- 2.2 kΩ
- 0.68 kΩ
- 4.7 kΩ
- 1.5 kΩ
Answer: 1.5 kΩ
Only 1.5 kΩ lies within the supplied interval. A stronger pull-up can violate sink limits; a weaker one can violate rise constraints. Actual design would additionally account for tolerances and the applicable device/network conditions.
55.Two identical 4 kΩ pull-ups are placed in parallel on one line. What equivalent resistance follows?
Show answer and explanation
- 1 kΩ
- 4 kΩ
- 2 kΩ
- 8 kΩ
Answer: 2 kΩ
Parallel conductances add: 1/R_eq=1/4000+1/4000, so R_eq=2000 Ω. Multiple boards can change the effective pull-up and its sink-current/rise-time behavior even when each individual resistor is unchanged.
56.A simplified input has a 100 kΩ pull-up to 3.3 V and 20 μA leakage toward ground. Ignoring other paths, what input voltage follows and does it meet a 2 V minimum-high requirement?
Show answer and explanation
- 1.3 V; no
- 3.3 V; yes
- 2.0 V; exactly
- 3.1 V; yes
Answer: 1.3 V; no
The leakage drop is 20 μA×100 kΩ=2 V. Input becomes 3.3−2=1.3 V, below the supplied high threshold. Weak bias and leakage must be considered together; a digital type declaration does not set the physical voltage.
57.A source guarantees output high only to 2.4 V minimum. A receiver requires at least 2.7 V for a guaranteed high. What nominal guaranteed-high margin follows?
Show answer and explanation
- −0.3 V
- +5.1 V
- Zero because both are digital signals
- +0.3 V
Answer: −0.3 V
Subtract receiver requirement from source guarantee: 2.4−2.7=−0.3 V. The supplied worst-case levels do not establish a high-level compatibility guarantee. Actual interface assessment also includes voltage limits, loading, and other conditions.
58.A hypothetical digital input guarantees low at ≤0.8 V and high at ≥2.0 V. No rule specifies the intermediate region. What is established for an applied 1.5 V?
Show answer and explanation
- A mandatory stable fifty-percent duty-cycle signal
- Guaranteed low because voltage is below the high guarantee
- Guaranteed high because voltage exceeds the low guarantee
- Neither guaranteed logic level from these limits alone
Answer: Neither guaranteed logic level from these limits alone
The value lies between the guaranteed low and high regions. An undefined/intermediate range is not a third stable logical code or a precise switching threshold. Use the actual device's specified behavior and margins.
59.A pin's overvoltage tolerance is specified only while its device supply is present. The system drives the pin while that supply is off. What condition is unestablished?
Show answer and explanation
- That the stated tolerance applies in the unpowered state
- Only the logical value the sender intended
- A guarantee that a powered-state rating applies to every power sequence
- Only the printed unit of the input voltage
Answer: That the stated tolerance applies in the unpowered state
Ratings and protection behavior can depend on supply state and sequencing. The powered-state statement does not establish unpowered tolerance. Check the actual device's conditions rather than generalize from one headline rating.
60.A GPIO output latch contains one, but the pin is currently assigned to a peripheral function and the output-latch readback is not a pad-voltage read. What does that readback fail to establish?
Show answer and explanation
- The fact that the documented register is readable
- The stated distinction between pad input and latch state
- The physical pin's present level
- The value stored in the output latch
Answer: The physical pin's present level
Pin mux, output enable, peripheral ownership, and external circuitry can affect the pad. A latch value is not automatically a measurement of the wire. Observe the register or signal that actually represents the claimed state.
61.A supplied Schmitt input switches low→high at 2 V and high→low at 0.8 V. Voltage is now 1.2 V after previously being above 2 V. What state follows if no other transition occurred?
Show answer and explanation
- A required oscillation
- Low
- High
- A new analog output code
Answer: High
Within the hysteresis band, the state retains its prior value. Having crossed the upper threshold, it remains high until voltage falls through the lower threshold. The current voltage alone would not determine the state without history.
62.A debouncer accepts a new high only after three consecutive high samples. Starting low, samples are [0,1,1,0,1,1,1]. At which one-based sample is high first accepted?
Show answer and explanation
- 7
- 4
- 6
- 3
Answer: 7
The first two highs are broken by sample four's zero. Samples five, six, seven form the first three-high run, so acceptance occurs at seven. The sampling interval and phase determine the corresponding time latency.
63.A pulse can last 1 μs and begins at arbitrary phase. Software samples its level every 10 μs with no hardware latch. What event-capture claim is unsupported?
Show answer and explanation
- That some pulses can overlap a sample time
- That every pulse will be observed
- The possibility of a zero level sample
- The supplied ten-microsecond sampling interval
Answer: That every pulse will be observed
A narrow pulse can fall wholly between samples. Higher-level event accounting needs a justified capture/latch, timing, or sampling guarantee. A fast average loop does not prove detection for every phase.
64.A synchronizer reduces metastability propagation risk under its device/timing model. Does observing no failures during a finite test prove zero failure probability for all future asynchronous edges?
Show answer and explanation
- Yes; one finite trace exhausts every analog arrival phase
- No; synchronizers cannot improve reliability
- Yes; two stages make every metastable resolution physically impossible
- No; that test does not establish an absolute zero-risk guarantee
Answer: No; that test does not establish an absolute zero-risk guarantee
Metastability behavior is probabilistic/physical and depends on timing and device assumptions. A finite clean test and a specified reliability model have limited scope. Avoid turning a risk-reduction mechanism into an unconditional elimination claim.
65.An asynchronous 4-bit bus changes from 0111 to 1000. Each bit is synchronized independently without a coherent-transfer protocol. What sample can occur during skew in the supplied model?
Show answer and explanation
- Only reversal of the word’s byte order
- A guarantee that separate bit synchronization provides bus-level atomicity
- A mixed word not equal to either complete source value
- Only one of the two complete values under every bit-skew pattern
Answer: A mixed word not equal to either complete source value
Independent bit settling does not establish coherent multi-bit ownership or capture. A suitable stable-data handshake, encoded protocol, or other device-supported method is needed when intermediate combinations are invalid.
66.A timer captures the counter at an input edge at time 10 μs. Its ISR reads the latched value at 310 μs. Ignoring counter error, what event timestamp does the capture represent?
Show answer and explanation
- 310 μs
- 300 μs
- 10 μs
- The average 160 μs
Answer: 10 μs
Hardware capture records the edge under its contract, not the later service time. Software timestamping at ISR entry would include latency. Overflow, capture overwrite, edge selection, and time-base semantics still need the actual device protocol.
67.A supplied timer rule is
f_update=f_clk/((PSC+1)(ARR+1)). Withf_clk=48 MHz, PSC=47, ARR=999, what update rate follows?Show answer and explanation
- 1.021 kHz
- 48 Hz
- 1 kHz
- 48 kHz
Answer: 1 kHz
The divisor is 48×1000=48,000. Dividing 48,000,000 by 48,000 gives 1000 Hz. The plus-one convention is supplied; other timer modes or clock trees can use different rules.
68.A hypothetical compare unit triggers only when the free-running counter equals its compare value. Firmware writes compare=90 while the current counter is 100, with no immediate-past trigger rule. What can happen?
Show answer and explanation
- The hardware must trigger immediately on every past compare write
- The next match waits until a later wrap/cycle reaches 90
- The hardware silently substitutes compare=101
- The counter automatically moves backward to the written value
Answer: The next match waits until a later wrap/cycle reaches 90
Writing a past equality target need not request immediate service. Firmware must follow the device's programming/race semantics and define how overdue targets are handled. A compare register is not automatically an absolute-time scheduler.
69.A supplied center-aligned counter takes eight clock ticks going up and eight going down per cycle. At 16 kHz timer clock, what waveform-cycle frequency follows?
Show answer and explanation
- 16 kHz
- 1 kHz
- 2 kHz
- 8 kHz
Answer: 1 kHz
A full cycle takes sixteen ticks, so frequency is 16,000/16=1000 Hz. Count paths, endpoint conventions, and compare behavior must match the exact timer mode rather than borrowing an edge-aligned formula.
70.A PWM peripheral has shadow registers transferred together only on an update event. Firmware writes new period and duty to those shadows. What does the update event provide under this contract?
Show answer and explanation
- Only a change in the memory addresses of the shadow fields
- Immediate activation at each shadow write by definition
- A guarantee that every arbitrary period/duty combination is valid
- A defined simultaneous activation boundary for the prepared values
Answer: A defined simultaneous activation boundary for the prepared values
Prepared state and active state are separate. A common transfer event can prevent mixed old/new settings if the device's sequencing and validity rules are followed. Shadow writes alone do not mean the waveform already changed.
71.A quadrature protocol permits only 00→01→11→10→00 or its reverse, one adjacent step at a time. Recorded consecutive states jump 00→11. What does the trace indicate under that model?
Show answer and explanation
- An invalid/skipped transition whose direction is not uniquely identified
- A guarantee that the mechanical shaft did not move
- Exactly one adjacent forward transition
- Exactly one adjacent reverse transition
Answer: An invalid/skipped transition whose direction is not uniquely identified
Both bits differ, skipping an intermediate allowed state. Noise, missed sampling, or other causes need investigation. The trace alone does not uniquely recover direction or number of true transitions.
72.An encoder produces 100 complete A-channel periods per revolution. A supplied decoder counts all four quadrature edges per such period. What decoded count per revolution follows?
Show answer and explanation
- 400
- 25
- 100
- 200
Answer: 400
Four counted edges per period times one hundred periods gives four hundred counts. Terms such as pulses/counts per revolution can be ambiguous, so the question states the edge convention explicitly.
73.A counter runs exactly 100 ppm faster than its nominal rate. Software converts counts using the nominal rate. During 100 true seconds, what elapsed value does it report in this ideal model?
Show answer and explanation
- 101 seconds
- 100.01 seconds
- 99.99 seconds
- 100.1 seconds
Answer: 100.01 seconds
The scale factor is 1+100×10⁻⁶=1.0001. Multiplying by one hundred gives 100.01. Time-base error is distinct from counter resolution and may matter even when integer arithmetic is exact.
74.A clock fallback halves a UART's source frequency, while its fixed divisor is unchanged and the supplied baud rule is proportional to source frequency. What happens to baud rate?
Show answer and explanation
- It doubles
- It halves
- It remains identical automatically
- It becomes zero by definition
Answer: It halves
With the same divisor, proportional output rate follows the changed input frequency. Clock recovery/mode changes must reconcile dependent peripherals and timing assumptions. A stable register value does not prove a stable physical rate.
75.A toggle-based request detector treats every observed bit change as a new request. One side resets its stored bit from one to zero while the other side retains the old phase. What false interpretation is possible?
Show answer and explanation
- Every independent reset synchronizes both histories automatically
- Only the textual representation of the bit changes
- Reset-induced phase change can look like a new request
- A guarantee that a toggle alone encodes every boot identity
Answer: Reset-induced phase change can look like a new request
Protocol state can span clock/reset domains. Reset/rejoin must establish a compatible phase or epoch before interpreting transitions as new work. A toggle is not inherently self-synchronizing across independent resets.
76.An ideal converter's supplied unsaturated rule is code=
floor(V/Δ), with Δ=1 V. It returns code 3. What input interval is consistent with that result?Show answer and explanation
- Exactly 3 V
- [2.5,3.5) V
- Exactly 4 V
- [3,4) V
Answer: [3,4) V
The floor rule gives 3≤V<4. A code represents a quantization interval under this convention, not one exact analog value. Other transfer conventions, offsets, noise, saturation, and reference errors need their own specification.
77.A noiseless quantizer returns the same integer code for every repeat of one constant input. Firmware averages many identical codes and claims new sub-code input information from repetition alone. What has not been supplied?
Show answer and explanation
- The ability to average a list of identical integer codes
- The exact repeated code value already observed
- Variation/information that distinguishes inputs within the same quantization bin
- The fact that additional conversion operations ran
Answer: Variation/information that distinguishes inputs within the same quantization bin
Identical deterministic quantized observations do not distinguish different analog values in that bin. Oversampling resolution claims need appropriate signal/noise/dither and model assumptions; repetition alone does not create missing information.
78.A pipelined ADC returns the result of the previous conversion while accepting a command for the next channel. Firmware labels each returned word with the newly requested channel. What association is wrong?
Show answer and explanation
- A guarantee that every returned value belongs to the newest command
- Only the count of configured channels
- Only the width of the returned integer container
- The result's conversion/channel phase
Answer: The result's conversion/channel phase
Pipeline latency separates command issue from result identity. Track the converter's actual sequence and startup/flush behavior. A transfer's returned word need not represent the command sent during the same transfer.
79.Two sinusoidal channels are sampled sequentially 10 μs apart. Their frequency is 1 kHz. Using phase=360°fΔt, what sampling phase offset follows?
Show answer and explanation
- 36°
- 0°
- 0.36°
- 3.6°
Answer: 3.6°
Compute 360×1000×10×10⁻⁶=3.6 degrees. Labeling sequential channel results with one nominal time can hide a phase difference. Measurement interpretation may need simultaneous sampling or a justified time-alignment model.
80.A supplied acquisition model leaves full-scale step error
exp(−t/τ). For a 10-bit ideal converter, require error≤1/2048. What minimum acquisition time follows?Show answer and explanation
- τ/2048
- τ log(1024)/2
- 10τ exactly
- τ log(2048), about 7.625τ
Answer: τ log(2048), about 7.625τ
Solve exp(−t/τ)≤1/2048 to obtain t≥τ log 2048. This model uses a full-scale step and half-LSB requirement. Actual converters can have additional settling, switch, reference, and source-drive conditions.
81.A supplied aperture model gives phase uncertainty magnitude 2πfδt. With f=10 kHz and δt=100 ns, what value follows?
Show answer and explanation
- 2π rad
- 0.002π rad, about 0.00628 rad
- 0.02π rad
- 0.2 rad
Answer: 0.002π rad, about 0.00628 rad
The product fδt is 10,000×100×10⁻⁹=0.001. Multiplying by 2π gives 0.002π radians. Clock timing uncertainty can become signal-dependent measurement uncertainty under this model.
82.An ideal unipolar converter uses code=
floor(1024Vin/Vref), away from saturation. Vin=1 V. Vref changes from 2 V to 2.02 V. What new code follows?Show answer and explanation
- 506
- 517
- 512
- 1024
Answer: 506
The new ideal ratio is 1024/2.02≈506.9307, whose floor is 506. Reference variation can change codes even when input voltage is unchanged. Resolution and reference accuracy are different properties.
83.A differential input has V+=2.8 V and V−=2.7 V. Its allowed common-mode range is [0.5,2.0] V. The difference 0.1 V is within the differential range. What constraint still fails?
Show answer and explanation
- Only the order of the subtraction operation matters
- A small differential voltage guarantees every input constraint
- Common-mode voltage 2.75 V exceeds its allowed range
- Every valid differential input must equal zero
Answer: Common-mode voltage 2.75 V exceeds its allowed range
Common mode is (2.8+2.7)/2=2.75 V. Differential magnitude alone does not establish converter input validity. Both individual/common-mode and differential limits must follow the supplied device conditions.
84.A hypothetical input path multiplies voltage by gain 10 before a converter limited to ±1 V at its input. Ignoring offsets, what source-voltage range avoids that gain-stage clipping?
Show answer and explanation
- [0,10] V
- [−0.1,0.1] V
- [−1,1] V
- [−10,10] V
Answer: [−0.1,0.1] V
Require abs(10V_source)≤1, giving abs(V_source)≤0.1 V. Increasing gain changes the source-referred range; it does not create unlimited sensitivity without saturation consequences.
85.A sensor returns a 12-bit two's-complement result in the low 12 bits. The bits are 0xF80. What signed code follows after correct 12-bit sign extension?
Show answer and explanation
- 3968
- 128
- −2048
- −128
Answer: −128
Unsigned 0xF80 is 3968. Its 12-bit sign bit is set, so subtract 4096 to get −128. Interpreting the container as unsigned or sign-extending from the wrong width changes the measurement meaning.
86.A 12-bit offset-binary converter defines signed code as raw−2048. For raw 0x800, what signed code follows?
Show answer and explanation
- −2048
- 0
- 2048
- −1
Answer: 0
0x800 equals 2048, so subtracting 2048 gives zero. Offset binary and two's-complement use different zero/sign encodings. The interface's declared representation, not only its bit width, determines decoding.
87.A continuous sine is sampled at exactly twice its frequency, with samples at its zero crossings: x[n]=
sin(πn). What do those samples show?Show answer and explanation
- Alternating positive and negative sample peaks
- All zeros, so this trace does not identify the sine amplitude
- A guaranteed complete reconstruction of the sine amplitude
- A constant sampled value of one
Answer: All zeros, so this trace does not identify the sine amplitude
For integer n, sin(πn)=0. Sampling exactly at a boundary can lose the signal for this phase. A reconstruction claim needs its strict band/phase and sampling assumptions, not only a slogan about two samples per cycle.
88.A converter accepts a trigger only when idle. Each conversion takes 2 ms, and triggers arrive every 1 ms. It ignores busy triggers; completion makes it idle before the next coincident trigger. What long-run accepted rate follows?
Show answer and explanation
- 1000 conversions/s
- 2000 conversions/s
- 250 conversions/s
- 500 conversions/s
Answer: 500 conversions/s
It accepts at times 0,2,4,... ms under the stated boundary ordering, rejecting intermediate busy triggers. Trigger rate and accepted conversion rate differ. Verify busy, overrun, and completion semantics rather than infer sampling solely from timer frequency.
89.A converter's repeated scan order is C,A,B. A zero-based DMA array starts with the first C result at index 0. Which channel corresponds to index 4 if no results are lost or reordered?
Show answer and explanation
- B
- It must be the last configured channel
- C
- A
Answer: A
Indices are 0:C,1:A,2:B,3:C,4:A. Channel identity depends on scan phase as well as the code value. Startup, dropped results, and changed scan configuration can invalidate a simple modulo interpretation.
90.An ideal hold-up capacitor is 1000 μF, allowed voltage drop 0.5 V, and constant load current 10 mA. Using t=CΔV/I, what hold-up time follows?
Show answer and explanation
- 0.5 ms
- 50 ms
- 5 ms
- 500 ms
Answer: 50 ms
Compute 0.001×0.5/0.01=0.05 s, or fifty milliseconds. This ideal constant-current study ignores ESR, efficiency, tolerances, minimum operating voltage, and load transients; those matter for an actual power-loss requirement.
91.A supplied constant-power model uses capacitor energy E=0.5C(V_hi²−V_lo²). C=100 μF, V_hi=3 V,V_lo=2 V, load power=5 mW, with ideal conversion. What duration follows?
Show answer and explanation
- 5 ms
- 0.25 ms
- 500 ms
- 50 ms
Answer: 50 ms
Available energy is 0.5×100×10⁻⁶×(9−4)=0.00025 J. Divide by 0.005 W to obtain 0.05 s. Constant-power and constant-current discharge models differ; use the one matching the stated assumptions.
92.A simplified 3.3 V source has series resistance 2 Ω. A load step draws 0.2 A. The reset threshold is 3.0 V. Ignoring other dynamics, what loaded voltage and threshold result follow?
Show answer and explanation
- 2.9 V; below threshold
- 3.1 V; above threshold
- 3.3 V; unchanged
- 2.6 V; exactly threshold
Answer: 2.9 V; below threshold
The drop is IR=0.2×2=0.4 V, leaving 2.9 V. This is below three. A supply can meet idle voltage while a transient/load path violates operating conditions; actual assessment requires the relevant dynamic and component model.
93.A hypothetical peripheral requires reset held for 16 cycles of its 4 MHz clock after that clock is stable. What stable-clock duration corresponds to the count?
Show answer and explanation
- 16 μs
- 0.25 μs
- 4 μs
- 64 μs
Answer: 4 μs
At four million cycles per second, sixteen cycles last 16/4,000,000=4 μs. Time spent before the required clock became valid does not automatically satisfy this supplied cycle-based reset condition.
94.A board output is high impedance until firmware configures it after boot. A requirement demands a defined external control level throughout reset. What does the later firmware write alone fail to establish?
Show answer and explanation
- The control level during the earlier reset/startup interval
- The specified high-impedance pin reset state
- The existence of elapsed time before firmware configuration
- The fact that firmware can eventually set the output
Answer: The control level during the earlier reset/startup interval
A post-boot configuration does not determine the earlier electrical state. The reset, mux, bias, power, and external-circuit contract must provide the required startup behavior. Do not infer reset-state guarantees from steady-state software alone.
95.A pin's output latch currently contains one, but its driver is disabled. Firmware wants to enable a low output and first enables the driver, then writes latch zero. What transient can occur under this contract?
Show answer and explanation
- Driver enable clears the old output latch by definition
- The pad stays low throughout the sequence automatically
- The pin drives high before the low write
- Only readback changes, with no possible pad-voltage effect
Answer: The pin drives high before the low write
Enabling exposes the existing latch value before the later write. Initialization order matters. A device-supported preload/enable sequence can avoid this specific transient, subject to its actual mux and electrical behavior.
96.Two hypothetical outputs must never both be on. State is A=1,B=0 and target is A=0,B=1. Writes take effect separately. Which sequence preserves the stated constraint?
Show answer and explanation
- Turn B on, then A off
- Turn A off, then B on
- Either order because adjacent source statements are electrically simultaneous
- Enable both, then disable the unwanted one
Answer: Turn A off, then B on
Disabling A first passes through both off, then enables B. Enabling B first produces both on temporarily. Atomic/group-update hardware or another supported sequence may be needed for different constraints; this exercise supplies one explicit invariant.
97.A wire frame uses XOR of its payload bytes as a checksum. Two payload bytes are swapped but otherwise unchanged. What integrity limitation follows?
Show answer and explanation
- The checksum authenticates the sender’s identity
- The checksum automatically restores the original positions
- Every byte-position swap necessarily changes XOR
- The checksum stays the same despite changed byte order
Answer: The checksum stays the same despite changed byte order
XOR is commutative, so reordering bytes does not change the combined value. A passed check has only the detection properties of its defined construction and coverage. It does not prove framing order, freshness, or authenticity.
98.A sensor sends a 12-bit unsigned code left-aligned in a big-endian 16-bit container. Bytes are [0xAB,0xC0]. What decoded code follows?
Show answer and explanation
- 0xAB
- 0xABC0
- 0xC0AB
- 0xABC
Answer: 0xABC
Assemble the big-endian container 0xABC0, then shift right four to get 0xABC. Byte order and bit alignment are separate representation rules. A raw host-endian pointer cast does not perform this protocol decoding.
99.A timeout uses a counter that stops in the selected low-power mode. The awaited peripheral may fail to wake the CPU, and no independent wake is scheduled. What timeout guarantee is missing?
Show answer and explanation
- That elapsed timeout progress and wakeup continue in that mode
- A guarantee that every physical timer runs in every sleep mode
- Only the stored counter’s integer width
- Only the value of the peripheral command byte
Answer: That elapsed timeout progress and wakeup continue in that mode
A correct arithmetic timeout still needs a live time source and a path to execute its expiry handling. Clock gating and wake sources are part of the hardware/power-state contract, not consequences of a timer variable's name.
100.A target needs 10 μs of active frame time plus at least 5 μs chip-select-high recovery between frames. Under this ideal saturated schedule, what maximum long-run frame rate follows?
Show answer and explanation
- 200,000 frames/s
- 100,000 frames/s
- 15 frames/s
- 1/15 μs, about 66,667 frames/s
Answer: 1/15 μs, about 66,667 frames/s
Each repeated frame cycle consumes at least fifteen microseconds, giving 1/(15×10⁻⁶)≈66,667 per second. Ignoring required interframe recovery overstates throughput even when the clocked frame itself is fast enough.
101.A sensor frame passes its checksum, but the transport may return a previous valid frame again. The application requires a new sample for every accepted result. What additional property is not established by checksum success alone?
Show answer and explanation
- Freshness/identity under a defined sample protocol
- That the checked bytes satisfy the stated checksum relation
- That integrity and sample freshness are different claims
- That the previous frame may itself have been valid
Answer: Freshness/identity under a defined sample protocol
A checksum can validate unchanged old bytes as easily as new ones. Freshness needs the appropriate sequence, timestamp, ready/consume handshake, or other device-supported contract. Integrity alone does not show a new measurement occurred.