Week 3
Be sure to take the first quiz while it is open! It will cover material from the first two units (no new material from this unit).
Upon finishing this learning module, you should be able to:
- Perform simple math on unsigned binary numbers
- Describe how binary values can be used to represent non-numeric data like text and images
- Perform conversion between binary and hexadecimal (base 16)
- Calculate values using modular (‘clock’) arithmetic
- Describe how the Diffie–Hellman algorithm can be used to generate a shared secret in public
- Write simple Turtle programs in Python
- Define procedures to reuse Python code and form abstractions
Numbers and Other Data
Read sections 4.4–4.5 in Welcome to CS, which covers doing addition and other arithmetic on binary numerals. Sections 4.6–4.8 are optional.
Read sections 4.9–4.12 in Welcome to CS, to explore representing information beyond just numbers, such as text, colors, and images. You will also learn about hexadecimal (base 16), which is commonly used when describing colors.
Explore the ASCII/Hex/Binary worksheet and check your work with its key.
Algorithm of the Week: Diffie–Hellman Key Exchange
Read chapter 4 of Nine Algorithms the Changed the Future, on private-key cryptography and the Diffie–Hellman key exchange protocol.
Read the Diffie–Hellman supplement. It has tips on how to do clock arithmetic and a cool interactive version of the algorithm that can help you understand who knows what information as the computations are performed.
Optional Extras: Cryptography and Numbers
The Introduction to Cryptography on Khan Academy is great if you want to learn more about cryptography and the related math.
Do you want to see the bits from a real image? Or any other file on your hard drive? Programs called Hex Editors allow you to see the raw information in a file and modify it. You can google "hex editor windows" or "hex editor mac" if you want to try one out.
If you are interested in how negative numbers and decimals are represented using bits, read Welcome to CS 4.6–4.8. You can also try these videos for extra insight.