midterm2 - CS 211 Midterm 2 100 points Instructor Prof Santosh Nagarakatte Full Name Here RUID Question 1 2 3 4 5 Max Points 20 20 25 20 15 1 Points

midterm2 - CS 211 Midterm 2 100 points Instructor Prof...

This preview shows page 1 - 5 out of 11 pages.

CS 211: Midterm 2: 100 pointsInstructor: Prof. Santosh NagarakatteFull Name Here:RUID:QuestionMax PointsPoints1202203254205151
Background image
Problem 1: (10+10 points)Answer “True” or “False” to these questions. If the answer is “False”, you need to provide a reason to statewhy the answer is “False” (you will not get points otherwise).1. The C switch instruction is converted to a series of jumps in all cases. True or False?2.A.B+Bis the minimal boolean expression that cannot be simplified to a simpler circuit. True or3. A single D-latch can store 1-bit of information even though it has two outputs. True or False?4. 1111 is the largest negative number in signed 4-bit one’s complement representation. True or False?5. If register %eaxholds a pointer to an integer, then executing the cmdp/x$eaxin gdb prints out theaddress of the integer. True or False?2
Background image
C Programming (10 points)1. (10 points) Write a C program to reverse a singly linked list? If you write Java code (instead of C),you will not get any points.Use the prototype below:struct node{int field;struct node* link;};// complete this function, list points to the head of the linked liststruct node* reverse(struct node* list){// Fill your code here3
Background image
Problem 2: Assembly Programming 1 (20 Points)1. (15 points) Write the equivalent C code for the following assembly snippet.Hint: all functions inthis code take one input argument
Background image
Image of page 5

You've reached the end of your free preview.

Want to read all 11 pages?

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture