Question
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
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 return the equivalent resistance (Note - What data type would you use here ?).
- Each resistors value is of type - _____.
Q2. You have an integer - 0xA53C0E69.
- Retain the lowest 26 bits and set all the remaining MSB bits (for 32 bit integer - 6 bits )
- Retain the lowest 26 bits and reset all the remaining MSB bits (for 32 bit integer - 6 bits )
- 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 )
- For setting a bit, we carry out _____ operation of the bit with ______.
- For resetting a bit, we carry out _____ operation of the bit with ______.
- For inverting a bit, we carry out _____ operation of the bit with ______.
- 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.
- Print each of them in hex and decimal format.
- Shift each of them right by 4 bits and print the output in hex and decimal format.
- Shift each of them left by 4 bits and print the output in hex and decimal format
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started