Circuit Bytes · Episode 48 · Electronics · Binary and logic levels
"Binary and logic levels"
Inside a chip, 0 and 1 are voltages. On a 5 V chip, near 0 V reads as 0 (low) and near 5 V reads as 1 (high); the gray zone between them keeps a little noise from flipping a bit. Each 0 or 1 is a bit, and every extra bit doubles the number of patterns, so 10 bits give 1,024.
Zeros and ones are voltages
Inside a chip there are no little digits. Every wire simply sits at some voltage. On a chip powered from 5 V, a wire near 0 V is read as a 0, and a wire near 5 V is read as a 1. That is all "binary" means at the hardware level: two kinds of voltage, two symbols.
Logic levels: low and high
The two voltage bands are called logic levels. The bottom band is low and stands for 0; the top band is high and stands for 1. A digital circuit only ever has to answer one question about a wire: is it low or high?
The gray zone keeps noise out
Between low and high is a gray zone that a working chip avoids. Real wires pick up a little electrical noise, so a "low" might wobble a bit above 0 V. Because there is a wide gap before the voltage would count as high, that wobble can't flip a 0 into a 1. The safety gap between what an output promises and what an input accepts is called the noise margin.
Bits, and why each one doubles the count
Each 0 or 1 is a bit (binary digit). One wire gives 2 choices: 0 or 1. Two wires give 4: 00, 01, 10, 11. A third wire gives 8, because every old pattern can now end in 0 or in 1. Every extra bit doubles the count, so n bits give 2 × 2 × ... × 2 (n twos) patterns. 10 bits give 1,024 patterns, exactly the 1,024 steps of the converter in episode 47.
Try it yourself
Start at 2 for one bit and keep doubling: 2, 4, 8, 16. How many patterns do 4 bits give? Check by listing them: 0000, 0001, 0010 ... up to 1111. You should find 16. Then try 5 bits: doubling 16 gives 32.
Good to know
- Exact thresholds depend on the logic family. Classic 5 V TTL inputs read 0 to 0.8 V as low and 2 to 5 V as high; 5 V CMOS roughly reads below a third of the supply as low and above two thirds as high. "Near zero" and "near five" are simplified.
- Many modern chips run at 3.3 V or lower; the same low/high idea applies.
- Some systems use high = 0 (active-low logic); the video leaves that out.
- The video shows bits as wires side by side; bits can also be sent one after another on a single wire.
- A byte is 8 bits, the standard modern definition.
- Battery or low-voltage supplies only; leave wall wiring to a licensed electrician.
Answer to the comment question
Eight bits make a byte. How many different patterns can one byte hold? 256. Each bit doubles the count: 2, 4, 8, 16, 32, 64, 128, 256, so 8 bits give 2⁸ = 256 patterns (from 00000000 to 11111111).
Test your knowledge
Quick quiz: "Binary and logic levels"
4 multiple-choice questions. Pick one answer for each, then check how you did.
Sources
- All About Circuits textbook, Vol. IV Digital, chapter 3, "Logic Signal Voltage Levels": low and high voltage ranges, the undefined band between them, noise margin
- SparkFun Learn, "Logic Levels": 5 V TTL and CMOS input thresholds; 3.3 V logic
- All About Circuits textbook, Vol. IV Digital, chapter 1, "Binary Numeration": bits as binary digits; each added bit doubles the count
Video transcript
What do zeros and ones actually look like inside a chip?
They aren't tiny numbers. They're voltages. On a five-volt chip, near zero volts means zero, and near five volts means one.
These are logic levels: low means zero, high means one.
The middle is a gray zone the chip avoids. That gap means a little electrical noise can't flip a zero into a one.
Each zero or one is a bit. One wire gives two choices. Two wires give four. Every extra bit doubles the count.
Ten bits give one thousand twenty-four patterns, the steps in last episode's converter.
Eight bits make a byte. How many different patterns can one byte hold? Comment your answer below!
That's your byte.
More from Circuit Bytes
- EP46c"Sensors"
- EP47c"Analog to digital"
- EP49c"Logic gates: AND, OR, NOT"
- EP50c"How transistors make a gate"