Week 6
Upon finishing this learning module, you should be able to:
- Describe the goals of higher level programming languages and how they relate to machine code
- Uses branches in the Little Computer to make decisions
- Use conditionals in Python
Branching, Assembly Code, and Higher-Level Programming Languages
Assembly and the Little Computer
Read about what an assembly language is and how to write assembly for the Little Computer in sections 7.4–7.5 in Welcome to CS.
Explore the Little Computer Assembly Worksheet and check your work with the key. You will need to make use of the Little Computer Assembler.
Little Computer Branching
Last week, we saw how a simple computer would process information and use its memory. This week, we will look at how it could use branch instructions to allow us to say things like “if the number is positive, do this, otherwise do that” and “go back to instruction 4”
Read section 7.3 on the Little Computer in Welcome to CS to learn about the branch instructions.
Explore the Little Computer Branch Worksheet and check your work with the key. You will need to make use of the Little Computer simulator.
Higher-Level Programming Languages
Read the rest of chapter 7 in Welcome to CS. It describes how higher-level programming languages (such as the Python you are learning) relate to assembly and machine languages.
Algorithm of the Week: Compression
Read chapter 7 of Nine Algorithms That Changed the Future. Then, read the Compression supplement. It demonstrates how to build a Huffman code—a version of the shortest-symbol trick from Nine Algorithms.
Explore the Compression Practice worksheet and check your work with the key.
Optional Extras: Medical Data
See how Big Data and computation are transforming medicine.