Question

In: Electrical Engineering

5.29) Explain what the following fragment of code achieves. Note that the data is signed and...

5.29) Explain what the following fragment of code achieves. Note that the data is signed and that the packed shift right arithmetic instruction operates on word (16-bit) operands.

MOVQ MM0, MM1

PSRAW MM0, 15

PXOR MM0, MM1

5.30) Consider the following block of operations that might be found inside a loop. Explainf what the instructions do and what operation is being performed on the data.

MOVQ MM1, A ; move 8 pixels of image A

MOVQ MM2, B ; move 8 pixels of image B

MOVQ MM3, MM1

PSUBSB MM1, MM2

PSUBSB MM2, MM3

POR MM1, MM2

Solutions

Expert Solution


Related Solutions

The following code fragment is expressed in arm assembly code. Fill in the blanks, so that...
The following code fragment is expressed in arm assembly code. Fill in the blanks, so that it is equivalent to the following C code. int counter; int x = 5; int y = 6; for (counter =10; counter >0;counter--) IF(X==Y) Y = Y + 1 ; ELSE Y = Y + 2} Fill in the blanks in the following code: MOV__________ ;loop counter into r0-ten times round the loop MOV__________ ;Value of y loaded into r1 MOV__________ ;Value of x...
What output is produced by the following code fragment? int num = 0, max = 20;...
What output is produced by the following code fragment? int num = 0, max = 20; while (num < max) { System.out.println(num); num += 4; }
The following code fragment is expressed in arm assembly code.Fill in the blanks, so that...
The following code fragment is expressed in arm assembly code. Fill in the blanks, so that it is equivalent to the following C code.int counter;int x = 5;int y = 6;for (counter =10; counter >0;counter--)IF(X==Y)Y = Y + 1 ;ELSEY = Y + 2}Fill in the blanks in the following code:MOV__________ ;loop counter into r0-ten times round the loopMOV__________ ;Value of y loaded into r1MOV__________ ;Value of x loaded into r2Next CMP ____________ ;assume r1 contains y and r2 contains...
5. Explain how a currency swap works, and what it achieves.
5. Explain how a currency swap works, and what it achieves.
Given the following code fragment: x = (1,2,3) Match the syntax with the action: value =...
Given the following code fragment: x = (1,2,3) Match the syntax with the action: value = x{0} (a) value is bound to the value 1 (b) SyntaxError: invalid syntax (c) TypeError: 'tuple' object is not callable value = x(0) (a) value is bound to the value 1 (b) SyntaxError: invalid syntax (c) TypeError: 'tuple' object is not callable value = x[0] (a) value is bound to the value 1 (b) SyntaxError: invalid syntax (c) TypeError: 'tuple' object is not callable
Javascript. Consider the following code fragment, that is supposed to compute the pixel value let c...
Javascript. Consider the following code fragment, that is supposed to compute the pixel value let c = image.getPixel(x, y); const m1 = (c[0] + c[1] + c[2]) / 3; c = image.getPixel(x + 1, y); const m2 = (c[0] + c[1] + c[2]) / 3; image.setPixel(x, y, [m1 - m2, m1 - m2, m1 - m2]); Give three pairs of pixel values (x, y) = [?, ?, ?] and (x+1, y) = [?, ?, ?] in the input image, for...
[after §3.22 − easy] String Processing : Consider the following code fragment: 1 int a =...
[after §3.22 − easy] String Processing : Consider the following code fragment: 1 int a = 20; 2 int b; 3 double x = 3.5; 4 String s = "All"; 5 char ch; 6 7 x += a; 8 x--; 9 a /= 4 - 1; 10 b = s.length(); 11 b += 4; 12 s += "is well"; 13 ch = s.charAt(b); 14 System.out.println("a = " + a + ", b = " + b); 15 System.out.println("x = "...
3) Consider the following IA32 assembly language code fragment. Assume that a, b and c are...
3) Consider the following IA32 assembly language code fragment. Assume that a, b and c are integer variables declared in the data segment. movl a, %eax movl b, %ebx cmpl %ebx, %eax jge L1 movl %eax, %ecx jmp L2 L1: movl %ebx, %ecx L2: movl %ecx, c Write the C code which is equivalent to the above assembly language code. You don't need to include the variable declarations, a function or anything like that, just show the 1 to 4...
Determine the output using C++ of the following code fragment i) double *pt; double a[3] =...
Determine the output using C++ of the following code fragment i) double *pt; double a[3] = {1.2, 2.3, 3.4}; pt = &a[1]; pt += 1; cout << *pt << endl; ii) int i = 1; while (i <= 4) { int num = 1; for (int j = 1; j <= i; j++) { cout << num << "bb"; num *= 3; } cout << endl; i++; }
What is Data Fragmentation. Consider the following Student relation. How would you fragment Student relation horizontally...
What is Data Fragmentation. Consider the following Student relation. How would you fragment Student relation horizontally based on Student’s Branch? Give a short discussion of your decision. StudentID Name DoB Branch Course ID Teacher Name 1 Amal 11/02/1998 Abha IT344 Dr Rana 1 Amal 11/02/1998 Abha IT340 Dr Khalid 2 Ahmed 15/11/2000 Jeddah IT210 Dr Ali 3 Aysha 09/09/2000 Riyadh IT344 Dr Rana 4 Bader 05/12/1997 Riyadh IT242 Dr Fahad
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT