ee357-HW1-Fall09-Nazarian

# ee357-HW1-Fall09-Nazarian - EE 357 Homework 1 Fall 2009...

This preview shows pages 1–3. Sign up to view the full content.

1 of 5 EE 357 Homework 1 Fall 2009 Nazarian Name: ___________________________________________ Assigned Tue. Sep. 1 st Due: Friday Sep. 11 th at 1pm (RTH109) Score: ________ Data Representation 1) (25 pts) Each C declaration of the variable x is initialized to a value in decimal. Show that value represented in hex using the appropriate size indicated by the variable type (e.g. char = 1-byte = 2 hex digits). Precede your hex value with the ‘0x’ prefix. Do not use a calculator. [Note: must have correct size/number of hex digits and value] Recall: Type ‘int’ defaults to size ‘long’. a. short int x = 13; b. short int x = -32,767; c. unsigned char = 246; d. int x = -4096; e. unsigned char x = 193; f. int x = -1; g. unsigned char x = ‘a’; h. short int x = 40; i. unsigned char x = ‘0’; j. char x = -2; 2) (10 pts) For each of the following C variable types show the maximum (largest) and minimum (smallest) possible values in hex. Use the appropriate number of hex digits for the given type/size and add the ‘0x’ prefix in front of your hex value. [Note: must have correct size/number of hex digits and value] Type/Size Maximum Minimum char 0x_____________ 0x_____________ unsigned short int 0x_____________ 0x_____________ int 0x_____________ 0x_____________

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
2 of 5 Arithmetic and Overflow 3) (16 pts) Perform the following hexadecimal operations. For subtraction, find the complement and add . 4)
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 5

ee357-HW1-Fall09-Nazarian - EE 357 Homework 1 Fall 2009...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online