Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2.II.3. [5 pts] Imagine that x is an integer. It is a fact that (x < < 2) + x = cx for some integer

2.II.3. [5 pts] Imagine that x is an integer. It is a fact that (x << 2) + x = cx for some integer c. What is the value of c, and why?

2.II.4. [5 pts] Imagine that x contains a color, represented as a 24 bit integer. (x >> 8) & 0xff gives me the amount of green in the color. What do I need to do to get the amount of red in the color?

2.II.5. [5 pts] What about the amount of blue in a color?

2.II.6. [5 pts] In the negative of an image, every color is replaced by its opposite. White becomes black, black becomes white, red becomes cyan, yellow becomes blue, magenta becomes green. Imagine you have a color stored in a variable x. Imagine that some members of your team advocate using ~x to compute the negative, others advocate using 0xffffff - x. Which one is right, or does it not matter?

2.II.7. [5 pts] Let x be some integer that is represented using 32 bits. What is the result of ~x | x?

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Objects And Databases International Symposium Sophia Antipolis France June 13 2000 Revised Papers Lncs 1944

Authors: Klaus R. Dittrich ,Giovanna Guerrini ,Isabella Merlo ,Marta Oliva ,M. Elena Rodriguez

2001st Edition

3540416641, 978-3540416647

More Books

Students also viewed these Databases questions

Question

Develop successful mentoring programs. page 400

Answered: 1 week ago