This is the 26th day of my participation in Gwen Challenge

Title 1

Assume that signed integers in a 32-bit machine are represented by complementary codes, and registers R1 and R2 are R1:0000108BH and R2:8080108BH respectively. Different instructions operate on registers differently, so different instructions execute registers with different truth values.

What are the true values of the contents of registers R1 and R2 when executing the following instructions?

① Unsigned number addition instruction

② Signed integer multiplication instruction

③ single-precision floating-point subtraction instruction (IEEE754)

Answer to question 1

R1:0000108BH R2:0000108BH Bh (1) 8080108 + 108 + 8080108 bh b (2) + 108-7 f7fef75h b (3) 0 0000 0000 0000 0000 0010 0001 0001 011 | 1000 0000 1000 0000 0001 0000 1000 1011 + 0.002116h x2^ -126-1.002116h x2^-126Copy the code

Topic 2

Suppose you define variables x, y, and I in a program where x and y are float variables (represented by IEEE754 single-precision floating-point numbers) and I is 16-bit short variables (represented by complement). At some point in the program execution, x=-0.125, y=7.5, and I =100 are all written to main memory (byte addressed) at addresses 100, 108, and 112, respectively. Please draw the memory storage of variables X, y and I on the big and small endmachines respectively.

Answer to question 2

X = -0.125 = -0.001B = -1.0 * 2^-3

x = 1 0111 1100 000 0000 0000 0000 0000 0000 (BE000000H)

Y = 7.5 = +111.1B = +1.111 * 2^2

y = 0 1000 0001 111 0000 0000 0000 0000 0000 (40F00000H)

I = 100 = 0000 0000 0000 0000 (0064H)

Big end machine small end machine

Address content

100 BEH 00H

101 00H 00H

102 00H 00H

103 00H BEH

108 40H 00H

109 F0H 00H

110 00H F0H

111 00H 40H

112 00H 64H

113 64H 00H

Topic 3

Assume that the data to be transmitted is 100011. If the generation polynomial is G(x)= x^3+ 1, the verification code is 111. Assume that the data information received at the receiving end is 100010, explain how to correctly detect its error, write the detection process.

Answer to question 3

Divide 100010 111 by 1001, the remainder is 001, not 0, indicating an error.