Electronics & Circuits · Study deck
Binary Number Systems
Picture a pressure alarm stored as eight bits.
Voltage Vera is your guide for this deck.

After studying this chapter
Learning objectives
You will be able to:
- Convert Binary Numbers: Translate between decimal and binary number systems using place-value decomposition
- Apply Powers of 2: Calculate ADC resolution ranges from bit depth
- Interpret Place Values: Use positional notation in base-2 arithmetic
- Analyse Floating Point: Explain IEEE 754 representation and identify its precision limitations
Major section
Start Simple
The same row can mean a value, several flags, or part of a signed number.
- The hardware contract must say which meaning is correct.
- An analog-to-digital converter is a circuit that turns a changing voltage into a number.
- ADC is its short name.
- This runway does not prove measurement accuracy or every number format.
Major section
Phoebe's Field Notes: How Many Bits Does A Reading Actually Need
The mathematical gist: To resolve a smallest change Δ across span VFS, require 2N≥VFS/Δ, hence Nmin=⌈log2(VFS/Δ)⌉.
- Resolving 1% of a 50 mV conditioned span needs 7 bits; leaving that signal on a bare 5 V range needs 14 bits.
Major section
For Kids: Meet the Sensor Squad!
But your feelings are analog - smooth like sliding down a slide." This was a big problem!
- Analog and digital are like the difference between a slide (smooth) and stairs (steps)!
- I can only work with exact step numbers, like climbing stairs.
- The Sensor Squad's translation team was complete!
Major section
For Kids: Meet the Sensor Squad! (continued)
But I can make my stairs have MORE steps - instead of big steps like 20, 21, 22, I can use tiny steps like 20.0, 20.1, 20.2.
- Temperature Terry had a problem. "Max, I can feel temperatures that go smoothly from cold to hot - like 20.1, 20.2, 20.3 degrees.
- He's a translator!" ADC Andy arrived with a big smile. "I can help!
- The more steps I use, the closer I get to Sammy's smooth feelings!" Now Sammy could measure temperatures, Andy would translate them into step-numbers, and Max could process them.
Major section
Getting Started: Analog vs Digital
The analog trace can occupy any intermediate voltage, while the digital trace can occupy only one of the four pictured step levels.
- The left-hand trace has effectively infinite possible values; the right-hand trace assigns each sample to one of 2n fixed levels.
- Everything we want to measure is analog, but computers only understand digital!
- Each arrow changes the quantity or its representation.
Major section
Binary Number System
Each added bit has two states and doubles the combinations, so four bits produce 24=2×2×2×2=16 possible values.
- Eight bits similarly provide 256 values numbered 0 through 255.
- This distinction matters for ADC work: 2n counts the available quantization levels, while 2n−1 is the largest code.
- Because an unsigned code begins at zero, those values are numbered 0 through 15 rather than 1 through 16.
Major section
ADC Resolution vs Range
The Mistake: Assuming that a "12-bit ADC" can measure 12 volts, or that increasing bit depth extends the measurable voltage range.
- For a 12 V input, the pin is 12/6.6 = 1.818 V; a calibrated 1.818 V reading gives 12.0 V.
- Raw code alone is not a 3.3 V/4095 voltmeter.
- They expected accurate readings because "12-bit should handle 12 volts." The ESP32 immediately damaged because its maximum input is 3.3V, not 12V.
Deck summary
Key takeaways
The same row can mean a value, several flags, or part of a signed number.
- The mathematical gist: To resolve a smallest change Δ across span VFS, require 2N≥VFS/Δ, hence Nmin=⌈log2(VFS/Δ)⌉.
- But your feelings are analog - smooth like sliding down a slide." This was a big problem!
- But I can make my stairs have MORE steps - instead of big steps like 20, 21, 22, I can use tiny steps like 20.0, 20.1, 20.2.
Retrieval practice
Recall check 1 of 3

Voltage Vera says: answer from memory, then check your reasoning.
Q1Why should you avoid using == to test whether two computed floating-point sensor values are approximately equal?
Show answer
Answer: B see answers page
Q2What is the decimal value of binary 1101?
Show answer
Answer: B Answer: B) 13 11012=(1×8)+(1×4)+(0×2)+(1×1)=8+4+0+1=1310.
Retrieval practice
Recall check 2 of 3

Voltage Vera says: answer from memory, then check your reasoning.
Q3How many different values can a 16-bit ADC represent?
Show answer
Answer: D Answer: C) 65,536 Values=2bits=216=65,536 The actual digital output ranges from 0 to 65,535 (one less than total values).
Q4If you increase an ADC from 10-bit to 12-bit, how much more precise is each voltage step?
Show answer
Answer: D Each additional bit doubles the resolution: 10-bit = 1,024 levels, 12-bit = 4,096 levels.
Retrieval practice
Recall check 3 of 3

Voltage Vera says: answer from memory, then check your reasoning.
Q5What quantity is being encoded before any binary bit position is interpreted in the 37 example?
Show answer
Answer: A 37 is the quantity being encoded before any bit position is interpreted.
Print reference
Answers 1 of 2
Answer key.
- B · Due to binary representation limitations, operations like 0.1 + 0.2 may not exactly equal 0.3 in floating-point arithmetic. Use threshold comparison instead: if (abs(a - b) < 0.0001). This is critical for IoT sensor thresholds, PID controllers, and any comparison involving floating-point sensor readings to avoid unpredictable behavior.
- B · Answer: B) 13 11012=(1×8)+(1×4)+(0×2)+(1×1)=8+4+0+1=1310.
Print reference
Answers 2 of 2
Answer key.
- D · Answer: C) 65,536 Values=2bits=216=65,536 The actual digital output ranges from 0 to 65,535 (one less than total values).
- D · Each additional bit doubles the resolution: 10-bit = 1,024 levels, 12-bit = 4,096 levels.
- A · 37 is the quantity being encoded before any bit position is interpreted.