Question: Consider three-bit fields packed into a 32-bit unsigned int u. Using little-endian numbering, field A goes from bit 0 through bit 8, field C goes

Consider three-bit fields packed into a 32-bit unsigned int u. Using little-endian numbering, field A goes from bit 0 through bit 8, field C goes from bit 9 through bit 16, and field R goes from bit 17 through bit 31. Assuming that field C is to be interpreted as a signed number, which code sequence properly extracts field C from u?

a.(u << 15) >> 24

b.((unsigned)(u << 15)) >> 24

c.((signed)(u << 15)) >> 24

d.((signed)u) >> 9

e.None of these

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!