Midterm 1 Solution - Midterm#1 Solutions EE 2361...

This preview shows page 1 - 3 out of 6 pages.

Midterm #1 Solutions EE 2361 Microcontrollers – Fall 2015 Prof Riedel Scored out of 80 points Problem 1 (10 pts) Problem 2 (10 pts) (a) Suppose that ‘a’ is declared to be unsigned char. What value will it have if one assigns it 300?
(b) Suppose that ‘a’ is declared to be a signed char. What value will it have if one assigns it -128?
(c) Suppose that ‘a’ is declared to be unsigned char. What value will it have if one assigns it -128?
(d) What value would you have to assign to a signed int to cause it to overflow?
(e) What value would you have to assign to an unsigned int to cause it to overflow?
Problem 3 (10 pts) (a) Convert the following
(b) Compute the following:
(c) Write a number with 8 digits (bits, decimal digits, octa digits, hex digits, etc.) that has the same value regardless of what base is used.
(d) Express the following i. The negative of 0b01111111 in two’s complement notation (assuming 8 bits are used in the representation).

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture