CSCI 237

Computer Organization

Home | Schedule | Assignments | Links | Slack | Williams CS

The table below lists practice problems that test topics we emphasized in class. We recommend completing these practice problems to reinforce the course material in prepration for quizzes and exams. Some questions have answers in the textbook, but the TAs and instructors are available to answer any questions that you have about the material. You're encouraged to work together on these problems.

Problem Page Topics Covered (Notes)
PP1 PP1 Practice Problems 1
- - How do you include libraries in C? What is the return type of main? How do you compile a C program?
- - Write a C program that takes a positive integer as a command line argument and sums together that many numbers read from stdin before printing the sum to stdout.
- - Write a C program that declares an integer array of 10 elements, initializes the elements of that array to random values between 0 and 100 inclusive (see driver.c from lab 1 for help with random number generation), prints out the contents of the array, and prints out the median value in the array to stdout.
PP2 PP2 Practice Problems 2
- - What is the 8 digit binary representation for 15? 16? 31? 32? 255?
2.17 65 Converting Hexadecimal to binary representations; unsigned vs. twos-complement.
-- -- Write the 16-bit twos-complement representation of the following numbers: -1, 2864, -1573
- - If w bits are able to store the two's complement representation of a positive whole number, can the negation of that number also be stored in w bits using two's complement representation? If w bits are able to store the two's complement representation of a negative whole number, can the negation of that number also be stored in w bits using two's complement representation?
2.61 (A, B) 129 C and bitwise representations of integers.
2.22 79 Sign extension. (Equation 2.3 is on page 64)
2.23 80 Arithmetic shifting.
2.24 82 Effect of truncating on signed/unsigned.
2.29 93 Signed addition; overflow.
2.30 94 Overflow.
- - How can overflow be detected when adding/subtracting 2 unsigned numbers? 2 signed numbers?
2.68 132 C and bitwise representations of integers.