Exam #1 Review

(Last Mod: 27 November 2010 21:38:37 )

ECE-1021 Home


Bookmarks:


Topics Covered

A Review of the Course Syllabus shows that the following topics are fair game for the exam:

Module #1:

Basic properties of positional numbering systems.

Conversions between number bases.

Binary representation of positive integers.

Binary representations of negative integers.

Binary representation floating point values - IEEE 574 Standard.

Binary representation of characters (ASCII) and strings.

Module #2:

Manipulating Data Memory.

Using direction to store/retrieve values.

Program flow control using conditional and unconditional jumps.

Module #3:

Structured programming

Algorithm representation using pseudocode

Algorithm representation using flowcharts

Algorithm development

Chapters 1-4: (minor emphasis)

Constants and Variables

Arithmetic, Logical, Relational, and Bitwise Operators

Assignment Statements and Abbreviated Assignment Statements

Selection Structures - if(), if()/else, switch(), conditional expressions ( ()?: )

Repetition Structures - while(), do/while(), for()


Review Questions

Below are a number of possible questions. It is guaranteed that questions totaling a minimum of 50% of the points on the exam will be selected, verbatim, from either this list or the material listed under "Included by Reference". Be forewarned, some of these questions are not trivial. It may take you quite a while to answer them the first time. However, it is your own fault if the exam is the first time that you try to answer them.

Included by Reference:

  1. Draw the flowchart for an if()/else structure.

  2. Draw the flowchart for a while() loop.

  3. Draw the flowchart for a do/while() loop.

  4. What are the three basic building blocks used to develop structured programs?

  5. The speed of light (in a vacuum) is exactly 299,792,458 meters/second. How many digits are required to express this in base 3?

  6. The speed of light (in a vacuum) is exactly 299,792,458 meters/second. Express this in base 7.

  7. The speed of light (in a vacuum) is exactly 299,792,458 meters/second. Express this in hexadecimal.

  8. The speed of light (in a vacuum) is exactly 299,792,458 meters/second. Express this as an IEEE 754 single precision floating point value stored at memory location 0x3C08 in Little Endian format.

  9. The value pi (3.14159265) is stored as a four-byte IEEE-574 single precision floating point number in Little Endian format. It is then mistakenly read as a four-byte IEEE-574 single precision floating point number in Big Endian format. What is the base-10 value that would be read as a result?

  10. A particular number is represented using two bytes in signed binary, offset binary, and two's compliment format. In no particular order, the three representations yield values of 0x2020, 0x2020, and 0xA020. What is the original number?

  11. A particular number is represented using two bytes in signed binary, offset binary, and two's compliment format. In no particular order, the three representations yield values of 0xA020, 0x5FE0, and 0xDFE0. What is the original number?

  12. The string, "Time 2 Go!" is stored at memory location 0xC340. Indicate the values (using the actual numbers - in hex) that are stored in each of the relevant memory locations.

  13. The following bytes are stored beginning at memory location 0xC34D: 0x66, 65, 68, 00, 47, 6F, 6F, 64, 00, 73, 6F, 2D, 73, 6F, 00. What string is stored at memory location 0xC351?

  14. Beginning with the flowchart for a basic while() loop, develop an ACME-1021 template for this construct.

  15. Beginning with the flowchart for a basic d0/while() loop, develop an ACME-1021 template for this construct.

  16. Performing all computations directly in hexadecimal, write the result of 0xFADE divided by 0x2BAD in quotient-remainder form (i.e., the quotient is an integer).

  17. The following values are stored in memory starting with Card #10: 44, 14, 89, 27, 10, 12. What are the values on these cards after each of the following instruction is performed (in decimal mode): ADD **11, *13, **15 ?

  18. Briefly summarize the key elements of the top-down algorithm development strategy.

  19. To take the negative of a number when using the two's compliment format you can use the simply algorithm where you first invert all of the bits and then add one to the result. Starting with the definition of an "additive inverse", show where this algorithm comes from.

  20. Given two two-byte binary bit strings A and B, what is the practical net effect of executing the following three statements:

    1. A = A^B

    2. B = A^B

    3. A = A^B

    Note that '^' indicated bitwise XOR and that these instructions are neither ACME-1021 nor C code. This is a general question regarding the impact of performing three successive XOR operations on the same variables as shown above.

(EXTRA CREDIT) This WILL be the ten point extra credit problem on the exam.

An ACME-1021 program is to be written that computes the sum of the first n non-zero integers. At the time that your program begins execution, the value of n has been stored on Card #2. Your result should be a two-card result (i.e., four digit answer) stored at Card #3 in Little Endian format.

1) Draw a flowchart for this program.

2) Implement this program in ACME-1021 code. You may use the Assembly Language directives (e.g., EQU and LABEL) or not at your discretion.

3) Using the supplied memory map, walk through the execution of your program for n=4.