csci 10 :: midterm 1 (due mon, oct 6, AT START OF CLASS)
Submitting your work: Complete this exercise on your own.

Fill in all of the "Answer" boxes, then print the answer grid that you see after you press "Prepare for printing".

Staple all pages together and submit to the instructor on the date listed above.

YOU MUST HAVE YOUR MIDTERM PRINTED WHEN YOU ARRIVE IN CLASS. YOU WILL NOT BE ALLOWED TO PRINT YOUR MIDTERM IN CLASS ON THE DAY IT IS DUE.

Questions:

This midterm covers all of the concepts you encountered on Book Learning Challenges 1, 2, 3, and 4 and Programing Challenges 1, 2, 3, 4, and 5.

Your name:
  1. What is the name of the component on the Central Processing Unit (CPU) of an x86 processor that controls the flow of information through the processor and coordinates the activites of the other units within the processor?
    Answer:
  2. What is the name of the component on the Central Processing Unit (CPU) of an x86 processor that executes all arithmetic and logic operations?
    Answer:
  3. What is the name of the components on the Central Processing Unit (CPU) of an x86 processor that are used for the temporary storage of instructions and data?
    Answer:
  4. Convert the following base-10/decimal value to base-2/binary representation. Use the formatting style presented in your text -- extend the bits to the nearest 8, 16, or 32, and insert an underscore between each section of 4 bits. Precede the base-2/binary value with %.
    35225
    Answer:
  5. Convert the following base-10/decimal value to base-2/binary representation. Use the formatting style presented in your text -- extend the bits to the nearest 8, 16, or 32, and insert an underscore between each section of 4 bits. Precede the base-2/binary value with %.
    63761
    Answer:
  6. Convert the following base-10/decimal value to base-16/hexadecimal representation. Extend to the nearest of 2, 4 or 8 characters. Precede the base-16/hexadecimal value with $.
    4026531855
    Answer:
  7. Convert the following base-10/decimal value to base-16/hexadecimal representation. Extend to the nearest of 2, 4 or 8 characters. Precede the base-16/hexadecimal value with $.
    8675

    Answer:
  8. Convert the following base-2/binary value to base-10/decimal representation.
    %1010_0101
    Answer:
  9. Convert the following base-2/binary value to base-10/decimal representation.
    %1011_1000_0111_0111
    Answer:
  10. Convert the following base-2/binary value to base-16/hexadecimal representation. Extend to the nearest of 2, 4 or 8 characters. Precede the base-16/hexadecimal value with $.
    %1011_1101
    Answer:
  11. Convert the following base-2/binary value to base-16/hexadecimal representation. Extend to the nearest of 2, 4 or 8 characters. Precede the base-16/hexadecimal value with $.
    %0001_0011_0111_1111
    Answer:
  12. Convert the following base-16/hexadecimal value to base-10/decimal representation.
    $1010
    Answer:
  13. Convert the following base-16/hexadecimal value to base-10/decimal representation.
    $F123
    Answer:
  14. Convert the following base-16/hexadecimal value to base-2/binary representation. Use the formatting style presented in your text -- extend the bits to the nearest 8, 16, or 32, and insert an underscore between each section of 4 bits. Precede the base-2/binary value with %.
    $1C
    Answer:
  15. Convert the following base-16/hexadecimal value to base-2/binary representation. Use the formatting style presented in your text -- extend the bits to the nearest 8, 16, or 32, and insert an underscore between each section of 4 bits. Precede the base-2/binary value with %.
    $A0B1
    Answer:
  16. Write a single statement of HLA code to display to the screen the value in the register eax in both hexadecimal and decimal (using uns32) formats.
    Answer:
  17. Write the code to copy the value from the variable number below into the appropriate segment of the eax register.
    static number: int16 := 165;
    Answer:
  18. What would be the output of the following HLA code?
    mov(107, al);
    stdout.put(al);
    Answer:
  19. What would be the output of the following HLA code?
    mov(5901, ax);
    stdout.put(al);
    Answer:
  20. What would be the output of the following HLA code?
    mov(59109, eax);
    stdout.put(al);
    Answer:
  21. What would be the output of the following HLA code?
    mov(2, al);
    add(99, al);
    stdout.put(al);
    Answer:
  22. What is wrong with the following HLA code?
    static number: uns8;
    mov(255, number);
    mov(number, al);
    add(1, al);
    Answer:
  23. What HLA code must be inserted in the place of BLANK below so that the code is a proper translation of the expression number = number - 123? What is the output, after the new code has been inserted?
    static number: uns16 := 1234;
    mov(number, ax);
    sub(123, ax);
    BLANK
    stdout.put(number);
    Answer:
  24. What is wrong with the following HLA code? If the code were correct, what is the effect of the code on the value of number?
    static number: uns16 := 1234;
    mov(number, eax);
    add(number, eax);
    mov(eax, number);
    Answer:
  25. Write HLA the code to properly translate the expression number = number * multiplier.
    static number: uns32 := 4242;
    static multiplier: uns32 := 42;

    Answer:

Total points for this book learning challenge:

500 points