Stanford CS105: Introduction to Computers | 2021 | Lecture 1.2 Bits, Bytes, and Binary: 1 + 1 = 10?
Summary
Highlights
The video begins by reviewing how counting works in the decimal system, emphasizing the concept of carrying over when a digit capacity is reached. This foundation is then used to explain the binary counting system, illustrating how '1 + 1' in binary results in '10' due to its two-digit constraint (0 and 1).
The video presents the first 16 binary numbers and their decimal equivalents (0 through 15). It also introduces the use of subscripts (e.g., '6_10' for decimal, '110_2' for binary) to distinguish between number systems, especially in ambiguous cases, highlighting other systems like octal (base 8) and hexadecimal (base 16).
The lecture explains how to convert a binary number to its decimal equivalent by understanding place values as powers of two. For example, in the binary number 1101, each digit corresponds to a power of two (2^0, 2^1, 2^2, 2^3), which are then summed to get the decimal value.
The video explores how bits can represent different combinations of information. A single bit can represent two states (e.g., true/false), two bits can represent four combinations, and so on. A formula is introduced: '2^n combinations for n bits'. This concept is illustrated by showing how a few bits can represent Canadian provinces, but more bits are needed for U.S. states.
The lecture connects the powers of two to common computer memory and storage sizes (e.g., 128 MB, 256 GB for iPhones). It explains that units like 'kilobytes,' 'megabytes,' and 'gigabytes' are based on powers of two (approximately 1000, 1 million, 1 billion, respectively), rather than exact decimal multiples, because computers operate in binary. The speaker mentions a slight disagreement between electrical engineers and computer scientists on using powers of two versus powers of ten for these units, especially in communication speeds.