Question: Assume we have a machine that uses 1 byte for a short int and 2 bytes for an int. What's the decimal value of z

Assume we have a machine that uses 1 byte for a short int and 2 bytes for an int. What's the decimal value of z after running the following code.

short int x = -27; // binary sequence is 11100101

int y = x;

unsigned int z = y;

would it be 27 since it is an unsigned int?

Please evaluate a binary addition of two 10-digit binary numbers 1011001011 and 1000110101 with Twos Complement. The answer should be a decimal number.

would it be 1280?

Please evaluate a binary addition of two 10-digit binary numbers 0111001001 and 0100110010 with Twos Complement. The answer should be a decimal number.

would this also be 763?

To extract a range of bits from bit 6 to bit 2 on a 10 bit unsigned number, we have (x << A) >> B. What B should be?

would it be 5 bits? since we are counting from 0-9, 6-2 is 4 so that would be A, and if we subtract the result from 9 we get 5? Am i right? would this be replicable for the next question?(4 byte for the next question)

To extract a range of bits from bit 5 to bit 2 on a 10 bit unsigned number, we have (x << A) >> B. What A should be?(4?)

Assume we have a machine that uses 1 byte for a short int. What's the decimal value of y after running the following code with arithmetic shift.

short int x = -47;

short int y = x >> 2;

I run this and it has -12.

Please convert a 8 digit binary number 11011100 to a decimal number with Two's Complement.

would that be 36 since you invert this(00100011) and then add one(00100011 = 36)?

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!