Microprocessors: From Assembly Language to C Using thePIC18Fxx2

I.7: CHAPTER 7

I.7 CHAPTER 7

1.

What is the 16-bit result for 0x39 * 0xAD if these numbers represent unsigned 8-bit integers?

2.

What is the 16-bit result for 0x39 * 0xAD if these numbers represent signed integers using two's complement representation?

3.

What data type in C is needed for a multiplication result of a char variable (8-bit) times an int variable (16-bit) if overflow is to be avoided?

4.

Extend the 16x16 unsigned multiply of Listing 7.2 to a 16x16 signed multiply.

5.

What is the value 0x93AD divided by 0xC5 if these numbers represent unsigned 8-bit integers? Give both quotient and remainder.

6.

What is the value 0x93A9 divided by 0x3B if these numbers represent signed integers using two's complement representation? Give both quotient and remainder.

7.

Divide by zero is an illegal operation; what does the code of Listing 7.4 do if the divisor is zero?

8.

Extend the code of Listing 7.4 to perform signed division.

9.

What is the value 0xC4 as a 0.8 fixed-point number?

10.

What is the value 0xC4 as a 4.4 fixed-point number?

11.

Saturating signed addition is defined as saturating to either the maximum positive value or maximum negative value in the case of overflow using two's complement encoding. What is the result for 0x39 + 0x59 using saturating signed addition?

12.

Write a PIC18 instruction sequence that implements signed saturating addition as defined by the previous problem.

13.

What is the value -0.15625 in single precision floating-point...

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: SCSI Converters
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.