Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use C in all the questions. Thanks. Q1. Refer to the image Lab3_resister_network uploaded. Prompt the user to enter the three resistor values and then

image text in transcribedUse C in all the questions. Thanks.

Q1. Refer to the image Lab3_resister_network uploaded. Prompt the user to enter the three resistor values and then return the equivalent resistance (Note - What data type would you use here ?).

  1. Each resistors value is of type - _____.

Q2. You have an integer - 0xA53C0E69.

  1. Retain the lowest 26 bits and set all the remaining MSB bits (for 32 bit integer - 6 bits )
  2. Retain the lowest 26 bits and reset all the remaining MSB bits (for 32 bit integer - 6 bits )
  3. Retain the lowest 26 bits and invert all the remaining MSB bits (for 32 bit integer - 6 bits )

(If you plan to write the final result back to same integer, you may want to copy the original integer in a backup integer variable before carrying out each masking operation and then copy it back into the integer variable being operated upon. Else define and use separate integer variable for the masked output )

  1. For setting a bit, we carry out _____ operation of the bit with ______.
  2. For resetting a bit, we carry out _____ operation of the bit with ______.
  3. For inverting a bit, we carry out _____ operation of the bit with ______.
  4. When a group of the MSB bits of the mask are required to be 1, how is the mask modified to make it platform independent ?

Q3. You have a signed integer - 0xA53C0E69 and an unsigned integer - 0xA53C0E69.

  1. Print each of them in hex and decimal format.
  2. Shift each of them right by 4 bits and print the output in hex and decimal format.
  3. Shift each of them left by 4 bits and print the output in hex and decimal format
1 2 1 2

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

Step: 3

blur-text-image

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

T Sql Fundamentals

Authors: Itzik Ben Gan

4th Edition

0138102104, 978-0138102104

More Books

Students also viewed these Databases questions