Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

URGENT: please solve this in C language thank you so much Q4. (25 marks) Write a C program that - reads an integer value in

URGENT: please solve this in C language thank you so much

image text in transcribedimage text in transcribed

Q4. (25 marks) Write a C program that - reads an integer value in decimal - displays this value in binary 2-byte format - defines the MASK to do the followings: (students are requested to explain the detailed solutions in a Word file as instructed in the class) a. Check either one of four bits 2, 5, 7 or 15 is true. Test with two values: 23094 and 26963 (5 marks) b. Check three bits 3, 7 and 13 are all false. Test with two values: 39478 and 22933 (5 marks) C. Set four bits 1, 8, 12 and 14. Check with value: 39606 (5 marks) d. Toggle four bits 2, 7, 11 and 12. Check with value: 21308 (5 marks) a. Either one of four bits 2,5, 8 or 15 is true Bit 15 13 12 11 10 14 9 9 Co 7 7 6 6 5 4 4 3 2 1 0 MASK nVal 23094 Result nVal 26963 Result b. Check three bits 3, 7 and 13 are all false 15 14 13 12 11 10 Bit 9 8 N 6 5 3 2 2 7 0 MASK n Val 39478 Result n Val 22933 Result c. Set four bits 1, 3, 12 and 14 Bit 15 14 13 12 11 10 9 9 8 Co 7 6 6 5 5 4 3 2 2 1 0 MASK nVal 39606 Result

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

Automating Access Databases With Macros

Authors: Fish Davis

1st Edition

1797816349, 978-1797816340

More Books

Students explore these related Databases questions

Question

What is Centrifugation?

Answered: 3 weeks ago

Question

To find integral of ?a 2 - x 2

Answered: 3 weeks ago

Question

To find integral of e 3x sin4x

Answered: 3 weeks ago

Question

What are Fatty acids?

Answered: 3 weeks ago