The question this layer answers
How can matter carry a stable, distinguishable state?
Information in the physical world. This layer connects Charge, Voltage, Noise, Energy to the rest of the computing stack.
A bit is an agreement between imperfect devices
The logical symbols 0 and 1 do not specify a physical voltage. A sender promises output ranges, and a receiver promises how it interprets input ranges. Consider a device with these guarantees: a low output is at most 0.4 V; a high output is at least 2.7 V. The next device accepts inputs at or below 0.8 V as low and at or above 2.0 V as high.
The low noise margin is 0.8 − 0.4 = 0.4 V; the high noise margin is 2.7 − 2.0 = 0.7 V. These are allowances for disturbances in the harmful direction. A 2.7 V high can lose 0.6 V and remain valid. Losing 0.8 V takes it outside the guaranteed high region. The interval between 0.8 V and 2.0 V is unspecified, not a third logical value and not the noise margin.
Restoring a received symbol to a fresh output level prevents small voltage errors from simply accumulating through every gate. That restoration works only while electrical and timing assumptions hold. A logically correct circuit can still fail when the receiver samples before a signal settles.
Turning measurements into numbers
Sampling chooses when to measure; quantization chooses which numeric level represents a measurement. They lose different information. In a simple nearest-step quantizer with step size 0.1 V, a 1.26 V reading becomes 1.3 V, with error 0.04 V. Away from clipping boundaries, the maximum rounding error is half a step. More amplitude bits do not fix insufficient sampling frequency.
For a band-limited signal, sampling strictly faster than twice its highest frequency permits ideal reconstruction under the theorem's assumptions. Real sensors require filtering, practical margins, and nonideal reconstruction. A component above the representable frequency range can alias into a lower one. Once the samples are ambiguous, a later algorithm cannot know which original produced them without additional assumptions.
Redundancy can reveal damage
Add an even-parity bit to 1011. The data has three ones, so append 1, producing 10111. The protected word now has four ones.
| Received word | Ones | Parity check | What you know |
|---|
| 10111 | 4 | Pass | No detected odd-flip error |
| 00111 | 3 | Fail | Corruption detected |
| 01111 | 4 | Pass | Two changed bits can go undetected |
A passing check is evidence within a failure model, not proof of perfect communication. Parity detects every odd number of bit flips, but cannot identify the damaged position or provide secrecy.
Connection: a database checksum and a network checksum also check representations. Neither proves the application assigned the correct units or meaning. A temperature multiplied by ten can be transmitted perfectly and still be wrong. In the lab, separate physical margin, decoded symbols, and integrity checks instead of treating them as one success condition.
Free Physics & signals lessons
Stable distinctions in a noisy world
A physical device exposes a continuous quantity such as voltage, charge, light, or magnetization. Engineers assign ranges of that quantity to symbols. A receiver uses thresholds to decide which symbol arrived; noise margins compare guaranteed sender output levels with accepted receiver input thresholds. The gap between receiver thresholds is an unspecified input region, not itself a noise margin.
Suppose 0–0.8 V means low and 2–3.3 V means high. A gate receiving 2.7 V does not forward “2.7” as an increasingly degraded fact; it produces a fresh high-level output. Cascaded gates therefore restore logical levels, within their timing and electrical limits.
What measurement keeps, and loses
Sampling chooses when to observe a changing signal; quantization chooses the nearest representable amplitude. Sampling too slowly can make a high-frequency pattern masquerade as a slower one, aliasing. Too few amplitude levels introduce quantization error. More samples and bits improve fidelity but consume bandwidth, storage, and energy.
Frequencies above the representable range can fold into false lower frequencies after sampling. Once folded, the samples no longer reveal which frequency was original. A low-pass filter removes those components before the irreversible sampling step.
Bandwidth, latency, energy, and synchronization
Bandwidth limits how much variation a channel can carry; latency measures how long a change takes to matter at the destination. Receivers also need timing, an explicit or recoverable clock, to decide where one symbol ends and the next begins. Faster signalling usually tightens noise, power, and synchronization constraints.
Overlaying many received symbol intervals reveals an “eye.” Vertical closure indicates reduced voltage margin; horizontal closure indicates timing uncertainty. Sampling near the widest opening maximizes tolerance. The diagram joins analog behaviour to the probability of digital mistakes.
Detect corruption and locate the broken boundary
The sender encodes symbols with known structure. The channel perturbs them. The receiver measures, decides, and checks whether the result satisfies that structure. A parity bit can detect some errors; stronger codes add enough redundancy to locate or correct patterns of corruption.
If raw sensor readings are already clipped, no packet code can restore the lost amplitudes. If local readings are sound but checksums fail, investigate the channel. If frames pass checks yet values are wrong, inspect decoding, units, and schema. Each observation narrows the failed boundary.
Derive an alias and design a sampling boundary.
Compute entropy, construct a code, and separate rate from reliability.
Practice lab: Calculate the room for noise
About 20 minutes. Read inequalities and subtract decimals. A voltage is a measured electrical potential difference; no circuit kit is needed.
A sender guarantees low outputs at or below 0.4 V and high outputs at or above 2.7 V. The receiver accepts low inputs at or below 0.8 V and high inputs at or above 2.0 V. Values between the input thresholds are unspecified. Transmit data 1011 with one even-parity bit.
- Calculate the low and high noise margins. Classify received values 0.6 V, 1.4 V, and 2.4 V.
- Append the even-parity bit to 1011. Flip one bit and then two bits; check each received word.
- Explain why a clean-looking decoded bit does not prove that the original sensor measurement was correct.
Hint
For low, subtract the maximum low output from the maximum accepted low input. For high, subtract the minimum accepted high input from the minimum high output.
Worked solution
The low margin is 0.8 − 0.4 = 0.4 V; the high margin is 2.7 − 2.0 = 0.7 V. The samples are low, unspecified, and high. The 1.2 V gap between receiver thresholds is not either noise margin. Data 1011 contains three ones, so transmit 10111. Flipping the first bit produces 00111 with odd parity, detected. Flipping the first two produces 01111 with even parity, undetected. Parity detects an odd number of bit flips in this model; it neither corrects them nor validates units, sampling, or sensor calibration.
- Keep input thresholds separate from output guarantees.
- Show a two-bit corruption that passes parity.
- Locate what parity cannot check before the encoding boundary.
Change one assumption
If the guaranteed high output falls to 2.1 V, the high margin becomes 0.1 V. Explain the effect of a −0.2 V disturbance at that worst-case output.
Follow a signal through an imperfect channel
Use small numerical models to locate what information is lost and which assumptions permit recovery. Distinguish physical detection, representation, and statistical inference.
1. Worst-case analysis · allow 30 minutes
Budget noise at the receiver
A transmitter guarantees low outputs at most 0.2 V and high outputs at least 2.8 V. A receiver guarantees low recognition at or below 0.8 V and high recognition at or above 2.0 V. The channel may add any disturbance between−0.4 V and+0.4 V. Determine whether both logic levels are guaranteed.
Calculate the largest symmetric disturbance magnitude preserving both guarantees, assuming boundary voltages are accepted. Then change the high-output guarantee to 2.3 V. Show a concrete allowed transmission that becomes ambiguous. Explain why the interval between receiver thresholds is not the noise margin.
Get a starting hint
Compare worst-case transmitted voltages after disturbance with the receiver guarantees. Use separate high and low margins.
Compare your reasoning with the worked solution
A low can rise to 0.6 V, still within the low-recognition region. A high can fall to 2.4 V, still within the high-recognition region. The low margin is 0.8−0.2=0.6 V; the high margin is 2.8−2.0=0.8 V. The largest symmetric magnitude is the smaller margin,0.6 V, under the inclusive boundary assumptions.
With the revised high output, the high margin is 0.3 V. An allowed high at 2.3 V with disturbance−0.4 V arrives at 1.9 V, between the two guaranteed recognition regions. The specification does not determine its interpreted value. It is incorrect to assert it must become low:1.9 V also exceeds the low guarantee.
The threshold gap 2.0−0.8=1.2 V is the unspecified input region. Noise margins compare transmitter guarantees to receiver requirements. A wider threshold gap can actually reduce those margins when output levels remain fixed. This model ignores temporal behavior; a signal can satisfy voltage bounds yet arrive too late.
Check your reasoning
- Analyze both disturbance signs and both logic levels.
- Separate an ambiguous value from a guaranteed wrong value.
- Define margins across the transmitter-receiver interface.
2. Derivation and counterexample · allow 40 minutes
Exhibit two continuous signals with identical samples
Sample x(t)=cos(2π·700t) at 1000 samples per second. Write the first five samples symbolically or numerically. Prove that a 300 Hz cosine produces the same samples. Identify the assumption that permits choosing one reconstructed signal over the other.
Suppose a real sensor contains components at 100 Hz and 700 Hz. Describe the role of an analog low-pass filter before sampling, and explain why deleting high-frequency bins after sampling cannot generally undo the ambiguity. State a suitable ideal band limit for a 1000 Hz sampler, taking care with the boundary frequency.
Get a starting hint
At integer n, cos(2πn−θ)=cos(θ). Sampling identifies frequencies differing by integer multiples of the sampling rate, with cosine symmetry.
Compare your reasoning with the worked solution
Samples are cos(1.4πn), yielding approximately 1,−0.309017,−0.809017,0.809017,0.309017 for n=0..4. Since cos(1.4πn)=cos(2πn−0.6πn)=cos(0.6πn), the 300 Hz cosine is indistinguishable at these sampling instants. The samples alone cannot establish which original signal occurred.
An assumed input band strictly below 500 Hz, together with an ideal sampling/reconstruction model, excludes 700 Hz and supports the lower-frequency interpretation. The exact Nyquist boundary needs care: phase can make a sine at 500 Hz sample to zero. Practical filters need a transition band and attenuation budget rather than a perfect brick-wall cutoff.
Before sampling, an analog filter attenuates the 700 Hz component so it does not appear as an unwanted 300 Hz component. After sampling, the aliased component occupies the same discrete-frequency location as a genuine 300 Hz signal; a digital filter cannot know which origin to remove from the samples alone. Oversampling can ease filtering, but it does not eliminate the need to control out-of-band energy.
Check your reasoning
- Show equality at all integer sample indices.
- Name the band-limit assumption required for reconstruction.
- Explain why filtering order matters.
3. Dimensional calculation · allow 30 minutes
Separate transmission time from propagation
A 1,500-byte packet crosses a 10 Mbit/s link of length 2,000 km. Propagation speed is 2×10^8 m/s. Ignore headers, queuing, processing, and acknowledgments. Compute serialization time, propagation time, and time from the first bit entering until the last bit arrives.
Now send 100 packets back-to-back. Calculate when the last bit of the final packet arrives. Compare doubling link rate with halving distance. Finally compute the bandwidth-delay product and explain what physical quantity it represents in this one-way model.
Get a starting hint
Convert bytes to bits and kilometers to meters. Propagation occurs while later bits are still being serialized.
Compare your reasoning with the worked solution
Each packet contains 12,000 bits. Serialization is 12,000/10^7=0.0012 s=1.2 ms. Propagation is 2×10^6/(2×10^8)=0.01 s=10 ms. The final bit of the first packet arrives after 11.2 ms. For 100 back-to-back packets, serialization takes 120 ms, so the last bit arrives at 130 ms; propagation is added once to the entire stream, not once per packet.
Doubling rate gives first-packet arrival 10.6 ms and whole-stream arrival 70 ms. Halving distance gives 6.2 ms and 125 ms. Thus which change helps most depends on the transfer size and metric.
The one-way bandwidth-delay product is 10^7×0.01=100,000 bits, or 12,500 bytes. It is the amount of data that can be in propagation on a fully occupied link. A transport window sized for acknowledgments would normally use a relevant round-trip delay and include additional protocol effects; substituting the one-way value without stating that difference is a modeling error.
Check your reasoning
- Keep bit rate and byte length consistent.
- Overlap serialization and propagation correctly across a stream.
- Distinguish one-way data in flight from an acknowledgment window.
4. Information and error detection · allow 40 minutes
Construct a code and then violate its model
A memoryless source emits A,B,C,D with probabilities 1/2,1/4,1/8,1/8. Construct a binary prefix code, compute expected code length and entropy, and explain whether your code reaches the entropy lower bound for this source model.
Encode the message ABDCA and decode your bit string by traversing the code tree. If a sender appends one even-parity bit to each fixed-size data word, prove which numbers of bit flips are detected. Exhibit a two-bit corruption that escapes detection. Explain why source compression and error detection solve different problems.
Get a starting hint
A tree with code lengths 1,2,3,3 can match these dyadic probabilities. Parity measures the number of flipped bits modulo 2.
Compare your reasoning with the worked solution
One code is A=0,B=10,C=110,D=111. Expected length is 0.5×1+0.25×2+0.125×3+0.125×3=1.75 bits per symbol. Entropy is−Σp log₂p=1.75, so this code reaches the bound under the stated memoryless distribution. ABDCA encodes as 0|10|111|110|0, or 0101111100. The prefix property permits decoding without separators by returning to the tree root at every leaf.
Even parity makes the sum of all transmitted bits zero modulo 2. Flipping k distinct bits changes that sum by k modulo 2, so every odd number of flips is detected and every even number leaves parity unchanged. For data 1011, parity 1 gives 10111; flipping the first two bits yields 01111, still even parity. Detection is not correction: a parity mismatch does not locate the corrupted bit.
Compression removes predictable redundancy in source symbols. Error-control coding introduces structured redundancy to detect or correct channel errors. A changed symbol distribution can make this prefix code inefficient; a changed noise model can make a one-bit parity check inadequate.
Check your reasoning
- Check prefix-freeness and decode the full message.
- State the source model behind the entropy comparison.
- Give an explicit undetected corruption and distinguish detection from correction.
Study the underlying methods
Section project: Build a sampling and quantization laboratory
4 to 5 hours. Create a local numerical experiment showing what a sampler can preserve and what it loses. Use Python standard-library math, random, csv, and optional handwritten SVG output. The input describes a sinusoid frequency, sample rate, sample count, phase, noise seed, noise amplitude, and ADC bit depth. Generate samples at t=n/fs, optionally add bounded uniform noise, then quantize into equally spaced bins covering [-1,1]. Use bin midpoints as output values and explicitly saturate out-of-range inputs. Output a CSV containing time, clean amplitude, noisy amplitude, quantized amplitude, and error, plus a short interpretation of three controlled experiments. Compare one-hertz and nine-hertz signals sampled at eight samples per second, compare two quantization depths, and separate clipping from quantization error. Use a sample rate and duration that make your compared inputs unambiguous. Describe the model as an ideal sampler and uniform quantizer; it does not simulate an analog anti-alias filter, aperture jitter, or a real converter circuit. The report should connect visible artifacts to a specific information-loss mechanism rather than judging the output by appearance alone. Report maximum error and root mean square error separately. When comparing resolutions, keep the clean signal and noise realization fixed so a change in random input cannot masquerade as an ADC improvement.
Milestones
- Implement the clean sampler and record units and all parameters in each output.
- Implement the midpoint quantizer, saturation policy, and seeded bounded-noise generator.
- Run aliasing, resolution, and clipping experiments while changing one relevant parameter at a time.
- Submit CSVs and a plot or table explaining the differences between the three failure mechanisms.
Acceptance criteria
- With zero noise and equal phase, one-hertz and nine-hertz sine samples at fs=8 agree within an explicit numerical tolerance for all sampled times.
- A b-bit quantizer produces only its defined 2^b midpoint values.
- For unsaturated inputs in [-1,1], absolute quantization error never exceeds half the bin width, allowing only the documented floating-point tolerance.
- An input above 1 saturates to the highest midpoint and is flagged as clipped, rather than wrapping around.
- Repeating the same noise seed and parameters reproduces the same output data.
Add a documented finite impulse response low-pass filter before downsampling and compare it with direct subsampling, including edge handling and residual aliasing.
Practise Physics & signals free →