Course Solutions Uncategorized (Solved) : Converty C Style Pseudocode Assembly Language Please Collatz Conjecture Receives 8 Bit Hex Q27195593 . . . .

(Solved) : Converty C Style Pseudocode Assembly Language Please Collatz Conjecture Receives 8 Bit Hex Q27195593 . . . .

 

Can you converty the C-style pseudocode into Assembly languageplease.

Collatz Conjecture
receives an 8-bit HEX number through command line parameter
outputs a sequence of numbers according to Collatz Conjecture

From https://en.wikipedia.org/wiki/Collatz_conjecture

The conjecture is that no matter what value of n, the sequencewill always reach 1.

In modular arithmetic notation, define the function f asfollows:
f(n+1) = n/2, if n==0 (mod 2)
f(n+1) = 3n+1, if n==1 (mod 2)

this corresponds to the following C style pseudocode:
printf(“number = %dn”,number)
while(number != 1)
{
step++
if(number % 2)
number = 3*number + 1
else
number /= 2
printf(“number = %dn”,number)
}
printf(“Total Steps: %dn”,steps)

where number = n and steps counts the number of steps forthe
sequence to converge to 1
___________________________________________
Using the

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post