Homework 1 (24 points total)

Show your work for full credit.
  1. (6 points) Convert numbers from the given radix to fill in the following table.

    Decimal Binary Hexadecimal
    43  
     10110101 
      0x21f

  2. (2 points) Give a base 4 representation for the number 253.67
    Note: The subscript indicates the base of the number.

  3. (2 points) Give a base 6 representation for the number 20121.2013

  4. (2 points) What base is the number 10010111 written in? If it represents a numerical value, what value does it represent?

  5. (4 points total) Consider the simple SAL program below and answer the following three questions.
    	.data
    str1:	.ascii "A bit of "
          .byte 0x76
          .byte 0x6F
          .byte 0x6E
          .byte 0x4E
          .byte 0x65
    str2:	.asciiz "umann.\n"
    ret:    .word
    
            .text
    __start: la      ret, retM
             b       procA
    retM:    
             done
    
    procA:   
             puts	 str1
             b       (ret)
    
    
    What does the program print out?

    What is the full name of the man who developed a new computer architecture to store programs in computers? His name is still used today to refer to all computers based on this successful architecture.

    What would it print if you change str2's directive from .asciiz to .ascii?

  6. (1 point) SAL stands for Simple Abstract Language. What is SAL an abstraction of?

  7. (4 points) Briefly describe what happens in each step of the Fetch and Execute cycle for the following SAL instruction.

    b proc1

  8.       1.
    
          2.
    
          3.
    
          4.
    
          5.
    
          6.
    
    
  9. (3 points) Write the SAL equivalent of the following C/C++/Java statement.
    x = aa * ( bb % -cc );
    You may assume that x, aa, bb, and cc have been declared as integers, and that any temporary variables (t1, t2, etc.) needed have also been declared.

Handing In the Homework

Turn in your file containing your answers by running the handin script. For information on running the script, look at the instructions.
You can ls the directory where your files for this assignment will be stored:

~cs354-1/handin/username/HW1

where HW1 is the name of the directory where you will submit this assignment. The path information allows you to review your submissions.

Now copy your file to the handin directory.
cp hw1.txt ~cs354-1/handin/username/HW1/.

No printout will be turned in.