CS110A Week 2 Day 2 lesson on 08-27-2026
Watch on YouTube →
Overview
Indika Walimuni connects algorithm design to practical tasks, then introduces how computers represent information using bits, character encodings, and positional number systems. The lesson works through ASCII and Unicode, decimal-to-binary conversion by repeated division, binary-to-decimal place values, octal and hexadecimal, and a memory overview covering RAM, cache, and long-term storage. It concludes by applying abstraction to functions and black-box diagrams, with a bread machine as the example for an individual activity.
Key takeaways
- An algorithm should be judged by whether its ordered steps reliably produce the intended result; the essay example ends with a completed, reviewed, and submitted essay.
- ASCII uses seven-bit codes for 128 values, while eight bits per character make a 500-character message at least 500 bytes before file overhead.
- Repeated division by the target base converts decimal values to another base: dividing 47 by 16 yields 2F₁₆, and place-value expansion verifies the result.
- Binary positional notation uses powers of two, so 0100000₂ equals 32 because its only set bit occupies the 2^5 position.
- Memory technologies trade off speed, cost, capacity, and persistence: SRAM cache is faster and costlier than DRAM, while magnetic, optical, and solid-state media serve as longer-term storage.
- A black-box function can be specified through inputs and outputs without exposing its internal process; the bread-machine example maps ingredients to finished bread.
Chapters
- The class develops an algorithm for writing an essay, beginning by reading the assignment and collecting information.
- The outline separates an introduction, three body paragraphs, and an ending, with information gathered for each section.
- The sequence continues through drafting, reviewing the draft, and submitting the essay.
- Numbering makes the order of operations in an algorithm explicit.
- Walimuni relates top-to-bottom algorithm execution to how people read English and follow recipes.
- Programs can branch and return to earlier steps, but their ordinary instruction flow still has a defined sequence.
- A bit is one binary digit, either 0 or 1, corresponding to two possible states.
- Eight bits make one byte, the unit used in familiar terms such as megabytes and gigabytes.
- The lesson presents text and other computer content as higher-level representations ultimately encoded in bits.
- Character encoding assigns agreed numerical codes to text so different systems can interpret the same characters.
- ASCII represents 128 values, numbered 0 through 127, including printable characters and control codes.
- Unicode addresses ASCII's limited character set by supporting writing systems beyond English, including Sinhala and Mandarin.
- Seven bits can represent 128 distinct values, which covers ASCII's 0-to-127 range.
- ASCII alone cannot represent the world's many writing systems and symbols.
- The lesson contrasts ASCII's restricted set with Unicode's broader character repertoire.
- The class decodes a two-character ASCII sequence from left to right, distinguishing uppercase H from lowercase i.
- The example groups seven bits per ASCII code and uses a space character to separate the two letters.
- At eight bits per character, a 500-character message requires at least 4,000 bits, or 500 bytes, before additional file overhead.
- Decimal uses ten digit symbols, 0 through 9; binary uses two, 0 and 1.
- In positional notation, digit significance increases from right to left.
- Binary place values are powers of two, beginning with 2^0 at the rightmost position.
- Each binary position represents a power of two, with values increasing as powers move left.
- The lesson connects seven-bit ASCII to a maximum value of 127, which is 2^7 minus 1.
- A challenge activity gives practice constructing binary numbers from their place values.
- To convert a decimal number to base 2, repeatedly divide by 2 and record each remainder.
- For 4, the remainders read from bottom to top produce 100₂.
- The method can be reused for other target bases by dividing by the desired base.
- The reverse conversion multiplies each bit by its corresponding power of 2 and adds the results.
- For the example 0100000₂, only the bit at 2^5 contributes, giving decimal 32.
- The lesson cautions that zeroes between significant bits affect place values, even though leading zeroes do not change a number's value.
- The decimal example 123 is decomposed as 1 × 10^2 + 2 × 10^1 + 3 × 10^0.
- Binary uses the same positional principle with powers of 2 instead of powers of 10.
- A leading zero contributes zero to the total, while a zero in a middle position preserves the place value of digits to its left.
- The class watches an explainer describing bits as two-state memory units and contrasting short-term memory with long-term storage.
- DRAM stores charge in transistor-and-capacitor cells and must be refreshed; SRAM cache is faster, uses more space, and is more expensive.
- Magnetic disks, optical media, and solid-state drives store data differently; the clip contrasts their latency, capacity, and durability.
- The worked conversion assigns each bit a power of 2, starting at 2^0 on the right.
- For 0100000₂, the single 1 contributes 1 × 2^5, or 32; all zero-bit terms contribute nothing.
- The method generalizes by adding every bit's value multiplied by its place value.
- Octal is base 8, so repeated division for a decimal-to-octal conversion uses 8 rather than 2.
- Dividing 32 by 8 yields 4 with remainder 0, giving 40₈ when the remainders are read in order.
- The reverse calculation, 4 × 8^1 + 0 × 8^0, confirms that 40₈ equals decimal 32.
- Hexadecimal is base 16 and uses 0 through 9 followed by A through F for values 10 through 15.
- Repeated division converts decimal 47 into hexadecimal 2F: the quotient is 2 and the remainder 15 is represented by F.
- The reverse conversion, 2 × 16^1 + 15 × 16^0, verifies that 2F₁₆ equals decimal 47.
- The lesson introduces bit-size terms such as kilobit and megabit and compares metric prefixes with binary powers.
- It notes that a binary quantity based on 2^10 is 1,024, not exactly 1,000.
- The distinction matters when interpreting storage and memory quantities expressed with different prefix conventions.
- Abstraction compresses a complex process into a simple operation, illustrated by the phrase “make bread.”
- A function or task is described through inputs, an action or process, and an output; the internal process can be hidden from the user.
- The bread-machine black-box diagram uses flour, water, yeast, and salt as inputs and bread as the output.
- Students are assigned to choose a real-world task, identify its inputs and output, draw a black-box diagram, and submit a photo individually, though collaboration is allowed.
Transcript excerpt
0:00 So um uh I don't need to spend too much time over here you guys. I mean figure it out but so let's kind of pick a problem and then um uh solve it uh again here. Okay. So uh remember like you know um so this is like real world problem right? So we are writing the algorithm but this is really similar to um um software world too. Okay. So it's really similar to programming as well. The reason is we so um thanks. So basically um the the reason is basically we we solve real world problem in in software as well. So um it's the the the analogy is really
0:49 similar. Okay. So um that's why so um uh I'm going to pick um I I have given you guys an example I think right so um uh and then basically you have to have and then you can see that in in in the it's part of your assignment as well stepwide refinement of an algorithm and in there I think I show you guys an example okay so kind of this this activity was a a practice for that one okay so all Right. So, um yeah. So, let's reply. Okay. So, I'm going to pick
1:39 um so let's say writing an essay. Okay. So, that's my um real world um algorithm. Okay. So, I'm going to write an algorithm for that. Okay. So um what are the things we need to write an essay? So so um so based on the topic we need to collect information right first. I mean usually we we should not go directly right and and and then try to think think uh those things right so we just we collect some information right so um so I'm going to say the
This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.
Related notes
Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, indika walimuni.