< Return to Video

How exactly does binary code work? - José Américo N L F Freitas

  • Not Synced
    Imagine trying to use words
    to describe every scene in a film,
  • Not Synced
    every note in your favorite song,
  • Not Synced
    or every street in your town.
  • Not Synced
    Now imagine trying to do it using
    only the numbers 1 and 0.
  • Not Synced
    Every time you use the Internet
    to watch a movie,
  • Not Synced
    listen to music,
  • Not Synced
    or check directions,
  • Not Synced
    that’s exactly what your device is doing,
  • Not Synced
    using the language of binary code.
  • Not Synced
    Computers use binary because
    it's a reliable way of storing data.
  • Not Synced
    For example, a computer's main
    memory is made of transistors
  • Not Synced
    that switch between either high
    or low voltage levels,
  • Not Synced
    such as 5 Volts and 0 Volts.
  • Not Synced
    Voltages sometimes oscillate,
    but since there are only two options,
  • Not Synced
    a value of 1 Volt
    would still be read as "low."
  • Not Synced
    That reading is done by
    the computer’s processor,
  • Not Synced
    which uses the transistors’ states
    to control other computer devices
  • Not Synced
    according to software instructions.
  • Not Synced
    The genius of this system
    is that a given binary sequence
  • Not Synced
    doesn't have a pre-determined meaning
    on its own.
  • Not Synced
    Instead, each type of data
    is encoded in binary
  • Not Synced
    according to a separate
    set of rules.
  • Not Synced
    Let’s take numbers.
  • Not Synced
    In normal decimal notation,
  • Not Synced
    each digit is multiplied by 10 raised
    to the value of its position,
  • Not Synced
    starting from zero on the right.
  • Not Synced
    So 84 in decimal form is 4x10⁰ + 8x10¹.
  • Not Synced
    Binary number notation works similarly,
  • Not Synced
    but with each position
    based on 2 raised to some power.
  • Not Synced
    So 84 would be written as follows.
  • Not Synced
    Meanwhile, letters are interpreted
    based on standard rules like UTF-8,
  • Not Synced
    which assigns each character to a specific
    group of 8-digit binary strings.
  • Not Synced
    In this case, 01010100 corresponds
    to the letter T.
  • Not Synced
    So how can you know whether
    a given instance of this sequence
  • Not Synced
    is supposed to mean T or 84?
  • Not Synced
    Well, you can’t from seeing
    the string alone
  • Not Synced
    – just as you can’t tell what the sounds
    ‘da’ means from hearing it in isolation.
  • Not Synced
    You need context to tell whether you're
    hearing Russian, Spanish, or English.
  • Not Synced
    And you need similar context
  • Not Synced
    to tell whether you’re looking
    at binary numbers or binary text.
  • Not Synced
    Binary code is also used for
    far more complex types of data.
  • Not Synced
    Each frame of this video, for instance,
  • Not Synced
    is made of hundreds
    of thousands of pixels.
  • Not Synced
    In color images,
  • Not Synced
    every pixel is represented
    by three binary sequences
  • Not Synced
    that correspond to the primary colors.
  • Not Synced
    Each sequence encodes a number
  • Not Synced
    that determines
    the intensity of that particular color.
  • Not Synced
    Then, a video driver program transmits
    this information
  • Not Synced
    to the millions of liquid crystals
    in your screen
  • Not Synced
    to make all the different hues
    you see now.
  • Not Synced
    The sound in this video
    is also stored in binary,
  • Not Synced
    with the help of a technique
    called pulse code modulation.
  • Not Synced
    Continuous sound waves are digitized
  • Not Synced
    by taking ‘snapshots’ of their
    amplitudes every few milliseconds.
  • Not Synced
    These are recorded as numbers in the form of binary strings,
Title:
How exactly does binary code work? - José Américo N L F Freitas
Speaker:
José Américano N L F de Freitas
Description:

more » « less
Video Language:
English
Team:
closed TED
Project:
TED-Ed
Duration:
04:41

English subtitles

Revisions Compare revisions