List all input values between 0123 and 3210 for which the following program writes 0000 to standard output before halting.
Solution. 0200 0400 0800 1000 2000. It returns 1 for all inputs that have at most one 1 in their binary representation—that is, the hexadecimal integers 0000, 0001, 0002, 0004, 0008, 0010, ..., 8000.
Q90.
Suppose that you load the following program into locations 10-20 of TOY:
Now suppose that you load 0001 0002 0003 0004 0004 0003 0002 0001 into memory locations 30 through 37, set the PC to 10, and press RUN. What will be the contents of memory locations 30 through 37 when the program halts?
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here