Eventually $N$ will reach 1.
For instance, if we start with $N = 10$, then we get the following sequence of numbers:
10 5 16 8 4 2 1
The number of steps it takes for 10 to reach 1 is 6.
This conjecture has been shown to hold true for numbers up to $2^{60}$ but has never been proven.
For this lab, you will write an ARM assembly function to calculate the number of steps it takes any number to reach 1.
wget https://ianfinlayson.net/class/cpsc305/labs/collatz.tar.gz tar xvf collatz.tar.gz
gbacc collatz.s main.c
When you are done, your program should produce the following output:
When you are done, please submit the assembly code under the assignment in Canvas.
Copyright © 2024 Ian Finlayson | Licensed under a Creative Commons BY-NC-SA 4.0 License.