We study an algorithm to convert an unsigned decimal integer into an unsigned binary integer. In other words, we use MATLAB to implement an algorithm to do decimal to binary conversion for nonnegative integers.
00:00 -Introduction
00:20 -This algorithm starts with most-significant bit
01:06 -General form of unsigned binary integers
02:12 Definition of most and least-significant bits
02:30 -A money analogy: why it’s called the most-significant bit?
03:17 -Value tables map weights assigned to each bit
04:09 -Work hard to understand the problem before writing code
04:38 -Example 1: Convert 27 to binary via pen and paper
09:50 -Example 1: Check work using dec2bin function
10:15 -Example 2: Convert 149 to binary via pen and paper
13:42 -Example 3: Convert 19229 to binary via pen and paper
18:39 -Reflection on examples to describe algorithm in simple English
19:52 -Example 3: Drafting our general algorithm in MATLAB
38:26 -Community Challenge: What is going on with the char data line?
38:54 -Conclusion