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

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


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

Check out our Patreon page: https://www.patreon.com/teded

View full lesson: https://ed.ted.com/lessons/how-exactl

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.

Thank you so much to our patrons for your support! Without you this video would not be possible! Bev Millar, Rishi Pasham, Jhuval, SookKwan Loong, Daniel Day, Nick Johnson, Bruno Pinho, Javier Aldavaz, Rodrigo Carballo, Marc Veale, Boytsov Ilya, maxi kobi einy, Misaki Sato, Craig Sheldon, Andrew Bosco, Catherine Sverko, Nik Maier, Mark Morris, Tamás Drávai, Adi V, Peter Liu, Leora Allen, Hiroshi Uchiyama, Michal Salman, Julie Cummings-Debrot, Gilly , Ka-Hei Law, Maya Toll, Aleksandar Srbinovski, Ricardo Rendon Cepeda, Renhe Ji, Andrés Melo Gámez, Tim Leistikow, Moonlight , Shawar Khan, Chris, Megan Douglas, Barbara Smalley, Filip Dabrowski, Joe Giamartino, Clair Chen, Vik Nagjee, Karen Goepen-Wee, Della Palacios, and Bah Becerra.


Content

6.777 -> Imagine trying to use words to describe every scene in a film,
11.415 -> every note in your favorite song,
13.318 -> or every street in your town.
16.035 -> Now imagine trying to do it using only the numbers 1 and 0.
20.859 -> Every time you use the Internet to watch a movie,
23.754 -> listen to music,
24.863 -> or check directions,
26.349 -> that’s exactly what your device is doing,
28.859 -> using the language of binary code.
31.812 -> Computers use binary because it's a reliable way of storing data.
36.502 -> For example, a computer's main memory is made of transistors
40.577 -> that switch between either high or low voltage levels,
44.154 -> such as 5 volts and 0 volts.
47.644 -> Voltages sometimes oscillate, but since there are only two options,
51.75 -> a value of 1 volt would still be read as "low."
55.751 -> That reading is done by the computer’s processor,
58.28 -> which uses the transistors’ states to control other computer devices
62.595 -> according to software instructions.
64.791 -> The genius of this system is that a given binary sequence
68.132 -> doesn't have a pre-determined meaning on its own.
71.52 -> Instead, each type of data is encoded in binary
75.205 -> according to a separate set of rules.
78.115 -> Let’s take numbers.
79.497 -> In normal decimal notation,
81.179 -> each digit is multiplied by 10 raised to the value of its position,
86.032 -> starting from zero on the right.
88.483 -> So 84 in decimal form is 4x10⁰ + 8x10¹.
95.04 -> Binary number notation works similarly,
97.755 -> but with each position based on 2 raised to some power.
101.561 -> So 84 would be written as follows:
105.573 -> Meanwhile, letters are interpreted based on standard rules like UTF-8,
110.376 -> which assigns each character to a specific group of 8-digit binary strings.
115.483 -> In this case, 01010100 corresponds to the letter T.
122.389 -> So, how can you know whether a given instance of this sequence
126.147 -> is supposed to mean T or 84?
128.832 -> Well, you can’t from seeing the string alone
131.87 -> – just as you can’t tell what the sound "da" means from hearing it in isolation.
136.442 -> You need context to tell whether you're hearing Russian, Spanish, or English.
141.279 -> And you need similar context
142.67 -> to tell whether you’re looking at binary numbers or binary text.
146.785 -> Binary code is also used for far more complex types of data.
151.146 -> Each frame of this video, for instance,
153.492 -> is made of hundreds of thousands of pixels.
155.96 -> In color images,
157.641 -> every pixel is represented by three binary sequences
161.095 -> that correspond to the primary colors.
163.701 -> Each sequence encodes a number
165.487 -> that determines the intensity of that particular color.
168.671 -> Then, a video driver program transmits this information
172.6 -> to the millions of liquid crystals in your screen
175.31 -> to make all the different hues you see now.
178.088 -> The sound in this video is also stored in binary,
181.402 -> with the help of a technique called pulse code modulation.
184.806 -> Continuous sound waves are digitized
187.19 -> by taking "snapshots" of their amplitudes every few milliseconds.
191.582 -> These are recorded as numbers in the form of binary strings,
195.247 -> with as many as 44,000 for every second of sound.
199.16 -> When they’re read by your computer’s audio software,
201.77 -> the numbers determine how quickly the coils in your speakers should vibrate
206.124 -> to create sounds of different frequencies.
208.965 -> All of this requires billions and billions of bits.
212.66 -> But that amount can be reduced through clever compression formats.
216.663 -> For example, if a picture has 30 adjacent pixels of green space,
221.171 -> they can be recorded as "30 green" instead of coding each pixel separately -
226.019 -> a process known as run-length encoding.
229.194 -> These compressed formats are themselves written in binary code.
234.094 -> So is binary the end-all-be-all of computing?
237.164 -> Not necessarily.
238.549 -> There’s been research into ternary computers,
240.967 -> with circuits in three possible states,
243.432 -> and even quantum computers,
245.252 -> whose circuits can be in multiple states simultaneously.
248.916 -> But so far, none of these has provided
251.339 -> as much physical stability for data storage and transmission.
254.635 -> So for now, everything you see,
257.079 -> hear,
257.848 -> and read through your screen
259.464 -> comes to you as the result of a simple "true" or "false" choice,
263.097 -> made billions of times over.

Source: https://www.youtube.com/watch?v=wgbV6DLVezo