CS110A Week 4 Day 1 lesson on 09/08/2026
Watch on YouTube →
Overview
Indika Walimuni teaches CS110A problem-solving and computer fundamentals, beginning with a general algorithm for reversing a two-digit decimal number using quotient, remainder, and place-value arithmetic. The lesson then covers binary addition, abstraction, two’s-complement subtraction, overflow, floating-point representation, and memory, before guiding students through an authorized SSH login to the SDF server and basic Linux commands.
Key takeaways
- A two-digit number can be reversed numerically by extracting its tens digit with integer division by 10, extracting its ones digit with remainder modulo 10, and rebuilding the number with place values.
- Binary addition uses the same column-and-carry procedure as decimal addition, but 1 + 1 equals binary 10, so the current column receives 0 and carries 1.
- Two’s complement represents a negative binary value by inverting its bits and adding 1, allowing subtraction to use the CPU’s adder and discard the final carry.
- Fixed-width signed arithmetic can overflow: in four-bit two’s complement, 7 + 1 produces 1000, which represents −8 rather than 8.
- IEEE 754 floating-point values use sign, exponent, and significand fields, and finite storage means some fractions cannot be represented exactly.
- SSH provides encrypted remote login; once connected to SDF, students can use ls, mkdir, cd, and pwd to inspect and navigate the server’s filesystem.
Chapters
- The task is to reverse a positive two-digit decimal integer using numerical operations, not by treating its digits as text.
- Examples include 91 becoming 19, 88 remaining 88, and 10 becoming 1 after reversal.
- Walimuni recommends testing several examples to reveal special cases before writing a general solution.
- If the digits are already separated, the reversed value is the original ones digit times 10 plus the original tens digit.
- For 91, the digits 1 and 9 produce 1 × 10 + 9 × 1 = 19.
- Place values are powers of 10, a pattern that generalizes to hundreds, thousands, and larger decimal numbers.
- Dividing 91 by 10 gives quotient 9 and remainder 1, which recover its tens and ones digits.
- The divisor is 10 because the input uses base-10 notation.
- Combining quotient and remainder extraction with the place-value formula completes the numerical method.
- The algorithm begins by accepting any positive two-digit decimal integer rather than hard-coding 91.
- Its action steps calculate the first digit by quotient, the last digit by remainder, and the output using the reversed place-value formula.
- Testing 10 and 88 confirms the method handles a trailing zero and identical digits; Walimuni emphasizes correctness across all valid inputs.
- Walimuni says three teaching assistants have been added to Canvas and will begin grading discussion work using rubrics.
- The lesson revisits decimal notation and describes the Hindu-Arabic system, including the historical importance of zero.
- Binary uses base 2, so three bits encode eight distinct values, from 0 through 7.
- Binary addition follows the same right-to-left procedure as decimal addition, but a sum of 2 is written as 10 in binary.
- For each 1 + 1 column, write 0 and carry 1 to the next column.
- Walimuni works through examples, including a result of 1101, and notes that one exercise instructs students to ignore a fifth carry bit.
- Printing a document is an abstraction: users understand the action without needing to manage the computer-to-printer and toner processes.
- A purple “Hi!” on a webpage is ultimately represented by lower-level data, including character codes and color information.
- The examples connect familiar outputs to the complex operations that computers perform beneath the visible interface.
- The CPU’s arithmetic logic unit performs arithmetic, while the control unit coordinates operations and interactions with memory and peripherals.
- Rather than requiring a separate subtractor circuit, computers can turn subtraction into addition using complements.
- In base 10, the complement of 3 is 7 because 3 + 7 = 10; adding 7 to 5 and discarding the carry gives 2.
- For binary two’s complement, invert the bits and add 1 to represent the negative of a value.
- The lesson uses four-bit examples, including 0011 for positive 3 and 1101 for negative 3.
- Adding the complemented value to 0101 performs 5 − 3 with the CPU’s adder; the extra carry is discarded.
- A textbook exercise about the complement of 3 causes confusion over whether it asks for the complemented value or a further sum.
- Walimuni clarifies the question by identifying the requested result as the four-bit representation 1101 for −3.
- He describes binary representation as useful background but not a prerequisite for later CS110A modules.
- Python instruction and a formal problem-solving technique called the Umpire process are scheduled to begin the following week.
- Students will use Python with turtle graphics to create visual drawings.
- Walimuni encourages students to attend and practice rather than worry about mastering every detail of the one-off binary unit.
- The embedded recommendation-letter lesson distinguishes generic praise from specific evidence, such as a student taking charge when two writers miss a deadline.
- It recommends building sustained relationships with potential recommenders through class participation, strong work, initiative, and clear communication of future goals.
- Students should ask well in advance, provide a résumé and strengths summary, explain why they chose that teacher, and send a thank-you note.
- With four-bit signed values, adding 7 and 1 produces the bit pattern 1000, interpreted as −8 rather than the expected positive result.
- Adding two negative values can also overflow when the result exceeds the range representable by the fixed bit width.
- The examples contrast these failures with adding a positive and a negative value, which does not produce signed overflow in the illustrated cases.
- Binary fractions use positions to the right of the radix point with negative powers of 2, including 1/2 and 1/4.
- A fixed number of fraction bits may not represent a value exactly, so the stored result can be an approximation.
- Repeating values such as 2/3 and irrational values such as √2 require indefinitely many digits in their expansions.
- The lesson introduces IEEE 754 single precision at 32 bits and double precision at 64 bits; it notes that Python uses 64-bit floating-point values.
- A floating-point value is organized around a sign, exponent, and significand, similar to scientific notation.
- The examples test whether fractions fit in a specified number of binary fraction bits, including 1/4 with two bits and an approximation of 0.1 with three.
- Machine instructions are streams of bits, with physical circuit states represented as high and low voltage levels.
- A computer stores keyboard input and program data in memory cells identified by sequential addresses.
- An animation traces an addition such as 2 + 3 through input, instructions, memory, CPU processing, a stop signal, and output on the screen.
- Students use accounts and passwords issued for the class to log in to a remote SDF server, making the exercise authorized rather than unauthorized access.
- Mac and Linux users open Terminal; Windows users can open Command Prompt by entering CMD in the search box.
- The assigned SSH command uses a username and the server address, and SSH encrypts data exchanged between the client and remote server.
- New SDF accounts can be requested through the class instructions, with credentials sent by email; accounts may be removed after inactivity.
- SSH password entry does not display characters or move the cursor, so students must type the password even when the terminal appears unchanged.
- Walimuni demonstrates command history with the up and down arrow keys and helps students troubleshoot confusing characters such as lowercase l, uppercase I, and zero.
- After login, the terminal session is running on the remote SDF server rather than on the student’s own computer.
- Students who reach the server are directed to continue through the numbered instructions in the Canvas discussion.
- Some students connect successfully while Walimuni encounters repeated permission-denied and timeout errors before later getting in.
- The Linux command ls lists directory contents; its first character is a lowercase L, not the numeral 1.
- The mkdir command creates a CS110A directory, and running ls again verifies that it exists.
- The cd command enters the directory, while pwd prints the current directory path.
- Students finish by taking a screenshot of the completed terminal work and submitting it to the correct Canvas discussion, “Ethically hacking into remote server.”
- Walimuni helps students distinguish the assigned exercise from a similar practice item and encourages students who have finished to assist classmates.
- For a student unable to access a school email account, he points to the CCSF IT help desk and its student email password-reset instructions.
Transcript excerpt
0:00 Good morning, guys. So, this is our agenda today. So, we're going to solve this um problem. And then um we haven't uh learned any coding yet. So, this will be still English, okay? So, um but later on, starting next week, we're going to learn Python, okay? And then that's when I will also teach you guys a technique called Umpire process to actually formally solve um problems in computer like, you know, programming. So, um it's it's uh it's good to learn such a formal technique in in solving problem rather than just, you know, trying to think about code that uh going to give you the answer, right?
0:47 So, we will from the get-go, like, you know, starting week four, we will use the Umpire technique all the way to the end. Pretty much every day. Um uh and then you will improve. All right. So, uh in this problem, right? So, um Right? Um So, we're going to basically um write our algorithm that's going to reserve uh reverse, sorry, reverse a two-digit number, okay? Two-digit positive decimal integer number, okay? So, So, reverse it only using numerically. Okay?
1:37 All right. So, ideas? So, we have to do it numerically, right? So, so that means like, you know, um Let Let's write some steps. We first need to input this number. So, I'm going to write like, you know, we are writing an algorithm, right? So, but we can first um work out couple of examples. So, let's take the the the number, right? Um number 91, okay? So, we're going to take the input number 91. Okay? And then then, well, the output should be What should be the output? 19, right? 1 9, right? So, given 91, it
2:29 should be uh 19. So, if the um
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.