Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

How does a computer tell a 0 from a 1?

  1. Dec 29, 2006 #1

    EnumaElish

    User Avatar
    Science Advisor
    Homework Helper

    Since a CPU is essentially a chip, a transistor, or a capacitor (?), it must be operating on a continuous scale. How does it translate a continuous scale into a binary one?
     
  2. jcsd
  3. Dec 29, 2006 #2
    On or off.
    A transistor is simply a switch.
     
  4. Dec 29, 2006 #3

    D H

    User Avatar
    Staff Emeritus
    Science Advisor

    A transistor is an amplifier. The transistors in your analog equipment are designed to faithfully amplify the inputs, that is, linearly. All transistors have an upper limit to their linear amplification range. The transistors output flattens out beyond this limit and eventually reaches some saturation level. This saturation effect is very undesirable in analog circuitry but is essential for making digital circuitry.

    The transistors in digital circuitry have a very high gain, making the linear range negligible. Instead, the transistors in digital circuitry are either generating no output (off) or are saturated (on). The transistor becomes a switch.
     
  5. Dec 29, 2006 #4

    AlephZero

    User Avatar
    Science Advisor
    Homework Helper

    What constitutes "0" and "1" is defined as part of the specification of different logic circuit types (CMOS, TTL, etc). It's then the chip designer's job to make sure the chip responds properly to input signals and generates valid outputs.

    See http://www.interfacebus.com/voltage_threshold.html
     
  6. Dec 30, 2006 #5

    chroot

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    Most commonly, logic 1 is defined as any voltage above some threshold; logic 0 is defined as any voltage below some threshold. (There are some kinds of exotic logic that use currents or other signalling mechanisms, but you can safely ignore pretty much all of them.)

    In CMOS static digital logic, the output of each gate is connected to either the positive supply (VDD) or to ground, via a conducting (turned-on) transistor, at all times. Thus, the gate is producing a clear, unambiguous logic 1 or logic 0 signal.

    - Warren
     
  7. Jan 2, 2007 #6

    EnumaElish

    User Avatar
    Science Advisor
    Homework Helper

    Has anyone seen the probability of a "false zero" (1 read as 0) or a "false one" (0 read as 1) being calculated on any type of circuitry?
     
  8. Jan 2, 2007 #7

    AlephZero

    User Avatar
    Science Advisor
    Homework Helper

    Yes. For example, if you are connecting two digital devices by a cable, what is the maximum length of cable you can use for a given error rate in the transmitted signal.
     
  9. Jan 2, 2007 #8

    chroot

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    There are enormous branches of electrical engineering devoted to exactly this possibility. Every piece of digital logic ever designed includes many such considerations.

    In the real world, supplies have noise and surges. Power wires on chips have resistance and thus lose voltage over their length. Transistors take time to turn on and turn off. Wires and transistors have unavoidable parasitic capacitances that must be charged and discharged. Cosmic rays can strike memory cells and change their contents. Clocks can reach flip-flops at the wrong time and put the flip-flop into indeterminate "metastable" states. There are dozens and dozens of failure modes that can cause poorly-designed digital circuits to malfunction because, at some point, a logic low is confused with a logic high, or vice versa.

    - Warren
     
  10. Jan 2, 2007 #9

    -Job-

    User Avatar
    Science Advisor

    It's interesting that something which is variably random at the most basic layer becomes something fairly deterministic at the top.
    Maybe randomness & determinism aren't mutually exclusive after all.
     
  11. Jan 4, 2007 #10

    EnumaElish

    User Avatar
    Science Advisor
    Homework Helper

    Is this because of some kind of averaging algorithm (execute an operation many times, then take the average [or some other summary statistic]), or is there some other explanation?
     
  12. Jan 4, 2007 #11

    chroot

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    In a sense, yes, it's an averaging. If you try to send just one electron down a wire, you'll find that its motion is almost completely random -- moving at hundreds of thousands of meters per second in random directions due to its own thermal energy and collisions with the metal atoms. Its motion is almost entirely dominated by thermal energy, and it just barely drifts down the wire at all, at a leisurely couple of centimeters per hour.

    On the other hand, if you observe not just one electron, but billions, you can make a very accurate calculation of the number of electrons passing a specific point in the wire every second, or of the average velocity of those electrons.

    - Warren
     
  13. Jan 6, 2007 #12
    One time we had a memory that would flip its state once every few weeks. After much money and investigation it turned out that the packaging that we were using was emiting alpha particles of all things. You never know what you are going to find.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?