How exactly does binary code work? - José Américo N L F Freitas
-
0:07 - 0:11Imagine trying to use words
to describe every scene in a film, -
0:11 - 0:13every note in your favorite song,
-
0:13 - 0:16or every street in your town.
-
0:16 - 0:21Now imagine trying to do it using
only the numbers 1 and 0. -
0:21 - 0:24Every time you use the Internet
to watch a movie, -
0:24 - 0:25listen to music,
-
0:25 - 0:26or check directions,
-
0:26 - 0:29that’s exactly what your device is doing,
-
0:29 - 0:32using the language of binary code.
-
0:32 - 0:37Computers use binary because
it's a reliable way of storing data. -
0:37 - 0:41For example, a computer's main
memory is made of transistors -
0:41 - 0:44that switch between either high
or low voltage levels, -
0:44 - 0:48such as 5 volts and 0 volts.
-
0:48 - 0:52Voltages sometimes oscillate,
but since there are only two options, -
0:52 - 0:56a value of 1 volt
would still be read as "low." -
0:56 - 0:58That reading is done by
the computer’s processor, -
0:58 - 1:03which uses the transistors’ states
to control other computer devices -
1:03 - 1:05according to software instructions.
-
1:05 - 1:08The genius of this system
is that a given binary sequence -
1:08 - 1:12doesn't have a pre-determined meaning
on its own. -
1:12 - 1:15Instead, each type of data
is encoded in binary -
1:15 - 1:18according to a separate
set of rules. -
1:18 - 1:19Let’s take numbers.
-
1:19 - 1:21In normal decimal notation,
-
1:21 - 1:26each digit is multiplied by 10 raised
to the value of its position, -
1:26 - 1:28starting from zero on the right.
-
1:28 - 1:35So 84 in decimal form is 4x10⁰ + 8x10¹.
-
1:35 - 1:38Binary number notation works similarly,
-
1:38 - 1:42but with each position
based on 2 raised to some power. -
1:42 - 1:46So 84 would be written as follows:
-
1:46 - 1:50Meanwhile, letters are interpreted
based on standard rules like UTF-8, -
1:50 - 1:55which assigns each character to a specific
group of 8-digit binary strings. -
1:55 - 2:02In this case, 01010100 corresponds
to the letter T. -
2:02 - 2:06So, how can you know whether
a given instance of this sequence -
2:06 - 2:09is supposed to mean T or 84?
-
2:09 - 2:12Well, you can’t from seeing
the string alone -
2:12 - 2:16– just as you can’t tell what the sound
"da" means from hearing it in isolation. -
2:16 - 2:21You need context to tell whether you're
hearing Russian, Spanish, or English. -
2:21 - 2:23And you need similar context
-
2:23 - 2:27to tell whether you’re looking
at binary numbers or binary text. -
2:27 - 2:31Binary code is also used for
far more complex types of data. -
2:31 - 2:33Each frame of this video, for instance,
-
2:33 - 2:36is made of hundreds
of thousands of pixels. -
2:36 - 2:38In color images,
-
2:38 - 2:41every pixel is represented
by three binary sequences -
2:41 - 2:44that correspond to the primary colors.
-
2:44 - 2:45Each sequence encodes a number
-
2:45 - 2:49that determines
the intensity of that particular color. -
2:49 - 2:53Then, a video driver program transmits
this information -
2:53 - 2:55to the millions of liquid crystals
in your screen -
2:55 - 2:58to make all the different hues
you see now. -
2:58 - 3:01The sound in this video
is also stored in binary, -
3:01 - 3:05with the help of a technique
called pulse code modulation. -
3:05 - 3:07Continuous sound waves are digitized
-
3:07 - 3:12by taking "snapshots" of their
amplitudes every few milliseconds. -
3:12 - 3:15These are recorded as numbers
in the form of binary strings, -
3:15 - 3:19with as many as 44,000
for every second of sound. -
3:19 - 3:22When they’re read by
your computer’s audio software, -
3:22 - 3:26the numbers determine how quickly
the coils in your speakers should vibrate -
3:26 - 3:29to create sounds of different frequencies.
-
3:29 - 3:33All of this requires billions
and billions of bits. -
3:33 - 3:37But that amount can be reduced
through clever compression formats. -
3:37 - 3:41For example, if a picture has 30 adjacent
pixels of green space, -
3:41 - 3:46they can be recorded as "30 green" instead
of coding each pixel separately - -
3:46 - 3:49a process known as run-length encoding.
-
3:49 - 3:54These compressed formats are themselves
written in binary code. -
3:54 - 3:57So is binary the end-all-be-all
of computing? -
3:57 - 3:59Not necessarily.
-
3:59 - 4:01There’s been research
into ternary computers, -
4:01 - 4:03with circuits in three possible states,
-
4:03 - 4:05and even quantum computers,
-
4:05 - 4:09whose circuits can be
in multiple states simultaneously. -
4:09 - 4:11But so far, none of these has provided
-
4:11 - 4:15as much physical stability
for data storage and transmission. -
4:15 - 4:17So for now, everything you see,
-
4:17 - 4:18hear,
-
4:18 - 4:19and read through your screen
-
4:19 - 4:23comes to you as the result
of a simple "true" or "false" choice, -
4:23 - 4:25made billions of times over.
- Title:
- How exactly does binary code work? - José Américo N L F Freitas
- Speaker:
- José Américo N L F Freitas
- Description:
-
View full lesson: https://ed.ted.com/lessons/how-exactly-does-binary-code-work-jose-americo-n-l-f-freitas
Imagine trying to use words to describe every scene in a film, every note in a song, or every street in your town. Now imagine trying to do it using only the numbers 1 and 0. Every time you use the Internet to watch a movie, listen to music, or check directions, that’s exactly what your device is doing, using the language of binary code. José Américo N L F de Freitas explains how binary works.
Lesson by José Américo N L F de Freitas, animation by Qa'ed Mai.
- Video Language:
- English
- Team:
closed TED
- Project:
- TED-Ed
- Duration:
- 04:41
![]() |
Kayla Wolf edited English subtitles for How exactly does binary code work? | |
![]() |
Kayla Wolf edited English subtitles for How exactly does binary code work? | |
![]() |
Michelle Mehrtens edited English subtitles for How exactly does binary code work? | |
![]() |
Michelle Mehrtens edited English subtitles for How exactly does binary code work? | |
![]() |
Michelle Mehrtens edited English subtitles for How exactly does binary code work? | |
![]() |
Michelle Mehrtens approved English subtitles for How exactly does binary code work? | |
![]() |
Michelle Mehrtens accepted English subtitles for How exactly does binary code work? | |
![]() |
Michelle Mehrtens edited English subtitles for How exactly does binary code work? |