Answer 6
LSR (Logical shift right) divides the value by power of 2 where power is equal to shift amount. It happens as value is shifted towards right by inserting 0 from the left side.
LSL (Logical shift left) multiplies the value by power of 2 where power is equal to shift amount. It happens as value is shifted towards left by inserting 0 from the right side.
R0 = 1024 = 0x00000400
R0 = 0000 0000 0000 0000 0000 0100 0000 0000 (In binary)
a) R0 LSR #6
= 0000 0000 0000 0000 0000 0100 0000 0000 >> 6
= 0000 0000 0000 0000 0000 0000 0001 0000
= 0x00000010
= 16 (base-10)
b) R0 LSR #7
= 0000 0000 0000 0000 0000 0100 0000 0000 >> 7
= 0000 0000 0000 0000 0000 0000 0000 1000
= 0x00000008
= 8 (base-10)
c) R0 LSR #8
= 0000 0000 0000 0000 0000 0100 0000 0000 >> 8
= 0000 0000 0000 0000 0000 0000 0000 0100
= 0x00000004
= 4 (base-10)
d) R0 LSR #9
= 0000 0000 0000 0000 0000 0100 0000 0000 >> 9
= 0000 0000 0000 0000 0000 0000 0000 0010
= 0x00000002
= 2 (base-10)
e) R0 LSR #10
= 0000 0000 0000 0000 0000 0100 0000 0000 >> 10
= 0000 0000 0000 0000 0000 0000 0000 0001
= 0x00000001
= 1 (base-10)
f) R0 LSL #21
= 0000 0000 0000 0000 0000 0100 0000 0000 << 21
= 1000 0000 0000 0000 0000 0000 0000 0000
= 0x80000000
= 2147483648 (base-10 unsigned)
g) R0 LSL #22
= 0000 0000 0000 0000 0000 0100 0000 0000 << 22
= 0000 0000 0000 0000 0000 0000 0000 0000
= 0x00000000
= 0 (base-10)
h) R0 LSL #23
= 0000 0000 0000 0000 0000 0100 0000 0000 << 23
= 0000 0000 0000 0000 0000 0000 0000 0000
= 0x00000000
= 0 (base-10)
i) R0 ASR #8
Arithmetic shift right inserts bit from the left same as sign bit
= 0000 0000 0000 0000 0000 0100 0000 0000 >> 8
= 0000 0000 0000 0000 0000 0000 0000 0100
= 0x00000004
= 4 (base-10)
Now given value of R0 is as below.
R0 = 2952790016 = 0xB0000000
R0 = 1011 0000 0000 0000 0000 0000 0000 0000
j) R0 LSL #2
= 1011 0000 0000 0000 0000 0000 0000 0000 << 2
= 1100 0000 0000 0000 0000 0000 0000 0000
= 0xC0000000
= 3221225472 (base-10)
k) R0 LSR #2
= 1011 0000 0000 0000 0000 0000 0000 0000 >> 2
= 0010 1100 0000 0000 0000 0000 0000 0000
= 0x2C000000
= 738197504 (base-10)
l) R0 ASR #2
= 1011 0000 0000 0000 0000 0000 0000 0000 >> 2
= 1110 1100 0000 0000 0000 0000 0000 0000 (Sign bit copied)
= 0xEC000000
= 3959422976 (base-10)
6. For each of the following operations, show the value of RO in base-10 unsigned representation...
3. For each of the following operations, show the value of R0 in base-10 signed representation (e.g., If R0 = -16, then R0 ASR #1 = -8). Assume that the register R0 contains a signed 32-bit integer (e.g., int32_t) with a value of 2 (0x00000002). i. R0 ASR #1: _______________________________ j. R0 ASR #2: _______________________________ k. R0 ASL #1: _______________________________
21. What is AA BA in 8-bit unsigned representation? [all numbers are given in hex] a. Overflow b. 10 1A C. d. A1 22. What is the 8-bit 2's complement representation of a number which is represented as 811s in 8-bit sign- magnitude integer representation? а. FF16 b. 1816 1116 C. d. Cannot be determined 23. What is 3B16 AB16 in 8-bit sign-magnitude representation? а. DB:6 b. 1016 2B16 C. d. Cannot be determined 24. What is 1100 - 0001...
(3 pts) Consider an unsigned fixed point decimal (Base10) representation with 8 digits, 5 to the left of the decimal point and 3 to the right. a. What is the range of the expressible numbers? b. What is the precision? c. What is the error? ______________________________________________________________________________ (3 pts) Convert this unsigned base 2 number, 1001 10112, to each base given below (Note: the space in the binary string is purely for visual convenience) Show your work. Using...
Assume a 10-bit floating point representation format where the Exponent Field has 4 bits and the Fraction Field has 6 bits and the sign bit field uses 1 bit S Exponent Field: 4 bits Fraction Fleld: 5 bits a) What is the representation of -8.80158 × 10-2 in this Format - assume bias =2M-1-1=24-1-1=7 (where N= number of exponent field bits) for normalized representation 1 -bias =-6 : for denormalized representationb) What is the range of representation for...
Perform the following 5-bit binary addition showing the carry bit that propagates to each column. Assume that the numbers are unsigned binary quantities: 01110 + 01011 What does the three-character string “X+Y” look like internally using the 8-bit ASCII code given in table below? What does it look like in 16-bit Unicode? Using 10 bits to represent the mantissa (sign/magnitude) and 6 bits for the exponent (also sign/magnitude), show the internal representation of the following two values: +0.25 −32 1/16...
10.11 (Left Shifting Integers ) Left shifting an unsigned int by
1 bit is equivalent to multiplying the value by 2. Write function
power2 that takes two integer arguments number and pow and
calculates number * 2pow. You should declare pow as an unsigned
integer , but remember that the result may be a negative value .
Use the shift operator to calculate the result. Print the values as
integers and as bits . Assume that an integer is of...
1 to 15 blanks thank you!
(1 point) For registers, Integers are encoded in one of two basic types 1. and 2. (1 point) The number 201 as a one byte unsigned integer is represented as in binary and in hexadecimal. (1 point) The 2 methods for representing signed integers are 3. and (5 points) What is the 16 bit representation of -125 in 2's complement notation? 4. (5 points) What is the decimal representation of the signed integer 10000001?...
Please answer all the questions! Thank you.
For the following C statement, what would be the corresponding MIPS assembly code? Assume that the variables a, b, c, and d are given and were declared as 32-bit integers a - b - (c + 7)+ d; 1. 2. Show how the value 0xB47CA034 would be arranged in a little-endian and big-endian machine Assume the data is being stored starting with address 0 3. Convert the following base-16 numbers to base-2 a....
2. Perform the following binary multiplications, assuming unsigned integers: B. 10011 x 011 C. 11010 x 1011 3. Perform the following binary divisions, assuming unsigned integers: B. 10000001 / 101 C. 1001010010 / 1011 4. Assume we are using the simple model for floating-point representation as given in the text (the representation uses a 14-bit format, 5 bits for the exponent with a bias of 16, a normalized mantissa of 8 bits, and single sign bit for the number ):...
I need the following problems worked out (show work). Thee answers are provided, I just need the work explained briefly for each one. 4 - What is the decimal representation of each of the following unsigned binary integers? a. 00110101 (53) b. 10010110 (150) c. 11001100 (204) 6 - What is the sum of each pair of binary numbers? a. 10101111 + 11011011 (110001010) b. 10010111 + 11111111 (110010110) c. 01110101 + 10101100 (100100001) 8 - How many bits are...