ee357_hw1_sol

# ee357_hw1_sol - 3.) Perform the following hexadecimal...

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

EE 357 Homework 1 Spring ’0 9 ● Redekopp Name: ____Solutions________________________________ Lec: 9:30 / 11:00 Data Representation 1.) 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). Do not use a calculator. a. short int x = 13; 0x000D b. short int x = -32,767; 0x8001 c. unsigned char = 246; 0xF6 d. int x = -4096; 0xFFFFF000 e. unsigned char x = 193; 0xC1 f. int x = -1; 0xFFFFFFFF g. unsigned char x = ‘a’; 0x61 h. short int x = 40; 0x0028 i. unsigned char x = ‘0’; 0x30 j. char x = -2; 0xFE 2.) For each of the following C variable types show the maximum (largest) and minimum (smallest) possible values in hex. Type/Size Maximum Minimum char 0x7f 0x80 unsigned short int 0xffff 0x0000 int 0x7fffffff 0x80000000 Arithmetic and Comparison Operations

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 3.) Perform the following hexadecimal operations. For subtraction, find the complement and add . i.) 6 F E 1 3 2 6 D + 1 A 2 4 F ii.) 4 B A 7 + 3 1 6 C 7 D 1 3 iii.) E 1 8 A + B C 5 5 9 D D F iv.) 9 0 D 6 0 0 1 5 + 1 9 0 E C 4.) For the problems above indicate whether overflow occurred if the numbers were representing signed values and then if they were representing unsigned values? Result from 3.) Signed Overflow Occurred Unsigned Overflow Occurred i T T ii F F iii F T iv F T 5.) Convert the powers of 2 shown below to its approximate decimal value using K to represent 10 3 , M for 10 6 , G for 10 9 , and T for 10 12 . (e.g. 2 12 ≈ 4K) a. 2 19 = ? i. 9K ii. 512K iii. 512M iv. 256K v. 256M b. 2 36 = ? i. 64M ii. 64G iii. 8M iv. 8G v. 8T c. 2 43 = ? i. 8G ii. 8T iii. 16M iv. 16G v. 16T d. 2 24 = ? i. 4K ii. 4M iii. 8M iv. 16M v. 16G...
View Full Document

## This note was uploaded on 06/08/2009 for the course EE 357 taught by Professor Mayeda during the Spring '08 term at USC.

### Page1 / 2

ee357_hw1_sol - 3.) Perform the following hexadecimal...

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

View Full Document
Ask a homework question - tutors are online