If you are staring at an oscilloscope capture or a digital logic exam question asking what the binary number represented by the voltage graph below is, you need a systematic method to translate analog voltage swings into discrete digital states. The binary number represented by a digital voltage graph is the sequence of logic highs (1s) and logic lows (0s) extracted by sampling the waveform's voltage levels against a specific logic family threshold at defined clock intervals.

Understanding this translation changes how you debug real circuits: if you misidentify the logic family threshold, a 1.5V signal might be read as a logic '1' in a 1.8V system but cause a metastable, undefined state in a 5V TTL system, leading to silent data corruption on an I2C bus. Furthermore, beginners commonly confuse the exact analog amplitude with the digital logic state. A digital microcontroller does not care if a high signal measures 4.8V or 5.1V on your multimeter; it only cares that the voltage successfully crosses the minimum $V_{IH}$ (Input Voltage High) threshold defined by its silicon architecture.

Translating Voltage Levels to Logic States

To extract a binary number from a voltage graph, you must first identify the logic family of the transmitting and receiving ICs. A voltage graph is just a continuous analog line until you apply the correct threshold masks. The most common point of failure in embedded debugging is assuming all "5V logic" or "3.3V logic" shares the same switching thresholds.

For example, standard 5V TTL (Transistor-Transistor Logic) defines a logic high at any voltage above 2.0V. However, 5V CMOS (Complementary Metal-Oxide-Semiconductor) requires the voltage to reach at least 70% of VCC (3.5V) to register as a high. If your voltage graph shows a clean square wave peaking at 3.2V, a TTL receiver will read it as a string of 1s, while a CMOS receiver will read it as undefined noise.

Common Digital Logic Thresholds (at 25°C Ambient)
Logic Family VCC (Nominal) $V_{IL}$ (Max Low) $V_{IH}$ (Min High) Undefined Region
5V TTL (e.g., 74LS) 5.0V 0.8V 2.0V 0.8V to 2.0V
5V CMOS (e.g., 74HC) 5.0V 1.5V 3.5V 1.5V to 3.5V
3.3V LVCMOS 3.3V 0.8V 2.0V 0.8V to 2.0V
1.8V Logic 1.8V 0.63V 1.17V 0.63V to 1.17V
Bench Tip: When probing a 3.3V ESP32-WROOM-32 module communicating with a 5V Arduino Uno, the ESP32's 3.3V high output easily crosses the Uno's 2.0V $V_{IH}$ threshold. However, if the Uno outputs 5V directly into the ESP32's GPIO, you risk exceeding the ESP32's absolute maximum ratings (typically VCC + 0.3V), potentially bricking the pin. Always check the datasheet's absolute maximums, not just the logic thresholds.

Worked Numeric Example: Decoding an 8-Bit SPI Trace

Let's look at a concrete scenario. You have captured a Serial Peripheral Interface (SPI) transaction on a Siglent SDS1104X-E oscilloscope. You are looking at the MOSI (Master Out Slave In) line and the SCK (Clock) line. The system is running at 3.3V LVCMOS, and the SPI mode is Mode 0 (data is sampled on the rising edge of the clock, CPOL=0, CPHA=0).

Here are the voltage measurements on the MOSI line taken exactly at the rising edge of each of the 8 clock cycles:

  1. Cycle 1 (MSB): 3.25V (Crosses 2.0V $V_{IH}$ → Logic 1)
  2. Cycle 2: 0.15V (Below 0.8V $V_{IL}$ → Logic 0)
  3. Cycle 3: 3.28V (Crosses 2.0V $V_{IH}$ → Logic 1)
  4. Cycle 4: 3.30V (Crosses 2.0V $V_{IH}$ → Logic 1)
  5. Cycle 5: 0.10V (Below 0.8V $V_{IL}$ → Logic 0)
  6. Cycle 6: 0.12V (Below 0.8V $V_{IL}$ → Logic 0)
  7. Cycle 7: 3.22V (Crosses 2.0V $V_{IH}$ → Logic 1)
  8. Cycle 8 (LSB): 0.20V (Below 0.8V $V_{IL}$ → Logic 0)

Reading from Most Significant Bit (MSB) to Least Significant Bit (LSB), we assemble the binary sequence: 10110010. To convert this to a more readable hexadecimal format for your firmware debug logs, we split it into two nibbles: 1011 (8+2+1 = 11, or B) and 0010 (2, or 2). The binary number represented by the voltage graph is 0xB2.

If you had mistakenly sampled on the falling edge (SPI Mode 3), or if the protocol was configured as LSB-first (like some UART or custom shift-register implementations), your extracted byte would be completely inverted or reversed, resulting in 01001101 (0x4D). Always verify the clock polarity and bit-order in the peripheral datasheet before trusting your visual decode.

Where You Meet This in Practice

Translating voltage graphs to binary isn't just an academic exercise; it is the daily reality of embedded systems debugging and industrial protocol troubleshooting. You will encounter this exact problem in three primary scenarios:

  • Logic Analyzer Decoding: When using tools like a Saleae Logic Pro 8 or a cheap 24MHz 8-channel clone, the software automatically applies thresholds to the voltage graph. However, if your ground lead is too long, ground bounce can cause the voltage graph to dip below the $V_{IL}$ threshold mid-pulse, causing the software to decode phantom extra bits. Shortening your ground spring from 6 inches to 0.5 inches often fixes "corrupted" binary decodes.
  • Oscilloscope Serial Triggers: Modern scopes (like the Rigol MSO5000 or Siglent SDS1000X HD series) feature hardware serial decoders. You must manually input the logic threshold voltage in the scope's decode menu. If you leave it at the default 1.5V while probing a 1.2V core-logic rail, the scope will fail to trigger or decode the binary sequence entirely.
  • Asynchronous UART Sniffing: Unlike SPI, UART has no clock line. The voltage graph must be sampled based on an agreed-upon baud rate (e.g., 115,200 bps). The receiver waits for the voltage graph to drop below the $V_{IL}$ threshold (the Start Bit), then samples the midpoint of each subsequent bit window. A 2% baud rate mismatch between the transmitter and receiver will cause the sampling window to drift, eventually reading a logic 1 as a 0 by the 8th bit.

Frequently Asked Questions

How do you determine the binary number represented by the voltage graph below if there is no clock line?

If the voltage graph lacks a dedicated clock line, you are likely looking at an asynchronous protocol like UART, RS-232, or 1-Wire. In UART, the idle state is a logic high. The binary sequence begins when the voltage graph drops to a logic low (the Start Bit). From that falling edge, you must divide the time axis by the known baud rate period (e.g., at 9600 baud, each bit is ~104.16µs). You sample the voltage level at the center of each 104µs window to extract the 8 data bits, followed by the parity and stop bits. Without knowing the pre-configured baud rate, the binary number cannot be definitively extracted from the graph alone.

What happens if the voltage graph shows levels between the logic high and low thresholds?

Voltages that linger in the undefined region (between $V_{IL}$ and $V_{IH}$) cause a state known as metastability. In CMOS circuits, this is particularly dangerous because both the PMOS and NMOS transistors inside the logic gate partially turn on simultaneously. This creates a direct, low-resistance path from VCC to Ground, resulting in a spike in current draw (shoot-through current) and excessive heat. If a voltage graph shows slow rise times lingering in this zone, the binary number represented is technically "undefined," and the receiving flip-flop may output a 1, a 0, or oscillate wildly before settling.

Why does the binary number represented by the voltage graph change when I swap from 5V to 3.3V logic?

The binary extraction changes because the threshold masks change. A 2.5V signal on a voltage graph is a definitive logic '1' in a 3.3V LVCMOS system (since 2.5V > 2.0V $V_{IH}$). However, that exact same 2.5V signal falls squarely in the undefined region for a 5V CMOS system (which requires 3.5V for a high). Furthermore, if you are looking at an open-drain bus like I2C, the pull-up resistor value and the bus capacitance dictate the rise time. Swapping a 5V pull-up to a 3.3V pull-up changes the RC time constant of the voltage graph, potentially causing the signal to fail to reach the threshold before the next clock edge, corrupting the binary data.

How do I read a differential voltage graph like RS-485 or USB into binary?

For differential protocols, you cannot read the binary number from a single voltage graph referenced to ground. You must measure the voltage difference between the D+ and D- (or A and B) lines. According to the TIA/EIA-485 standard, a logic '1' (Mark) is represented when the voltage of the non-inverting line (A) is higher than the inverting line (B) by at least 200mV. A logic '0' (Space) occurs when B is higher than A by at least 200mV. If the differential voltage graph shows a difference between -200mV and +200mV, the receiver considers it a fail-safe or undefined state. To decode this on a bench scope, use the scope's math function to subtract Channel 2 from Channel 1 (Ch1 - Ch2) and apply the differential thresholds to the resulting math trace.