The following code computes the 128-bit product of two 64-bit signed values x and y and stores the result in memory:
Gcc generates the following assembly code implementing the computation:
Thus code uses three multiplications for (he multiprecision arithmetic required to Implement 128-bit arithmetic on a 64-bit machine. Describe the
Want to see the full answer?
Check out a sample textbook solutionChapter 3 Solutions
Computer Systems: A Programmer's Perspective (3rd Edition)
Additional Engineering Textbook Solutions
Introduction To Programming Using Visual Basic (11th Edition)
Web Development and Design Foundations with HTML5 (8th Edition)
Digital Fundamentals (11th Edition)
Computer Science: An Overview (13th Edition) (What's New in Computer Science)
Starting Out with C++: Early Objects
Starting Out with C++: Early Objects (9th Edition)
- Fetch Decode Execution Cycle Assignment Disassemble the following program (i.e., convert it back to assembly language) and determine what the program does. Refer to op-codes chart provided. (A Number Bit set to 1— Operand is a number) # Machine Code 0 001 1 000111 1 010 0 001101 2 001 1 000100 3 010 0 001110 4 001 0 001101 5 100 0 001110 6 010 0 001111 Op-code Mnemonic 001 LOAD 010 STORE 011 ADD 100 SUB 101 EQUAL 110 JUMP 111 HALT NB: Every stage must be present in a separate diagram with the description of the stage’s processes below. Extra marks would be allocated for neat and detailed work presented.arrow_forwardThis is Machine Architecture! ***WRITE THE CODE ON YOUR OWN*** Create a MIPS program that demonstrates that the associative law fails in addition for floating point numbers (single or double precision). You only need to demonstrate it for single precision. Remember the associative law is a + (b + c) = (a + b) + c. The program’s output should look something like the following where the xxx’s are the numbers you chose. The resulting numbers may be different than mine depending on your choice of a, b, and c. Using a = xxx, b = xxx, and c = xxx a + (b + c) = 0 (a + b) + c = 1 The key is to have two of the number large (one positively and one negatively but equal in magnitude) floating point numbers and the third floating point number very small in comparison. As a side note, the associative law will also fail for multiplication for floating point numbers, but you do not need to demonstrate that. Please don't forget to include comments in this codearrow_forwardLo = Ro What is the result of applying the expansion box to R,? E(Ro) = What is the result of XORing the subkey with E(Ro)? ko O E(Ro) = We now apply the S-box transformation. S(ko Ð E(Ro)) = Finally we apply the permutation box to complete the function f. f(Ro) = P(S(ko Ð E(Ro))) = We can now compute the state of DES going into the next round. L = R1 =arrow_forward
- Using C language barcode scanner for Universal Product Codes(UPCs) verifies the 12-digit code scanned by comparing thecode’s last digit (called a check digit ) to its owncomputation of the check digit from the first 11 digits asfollows:I. [step 1]Calculate the sum of the digits in theodd-numbered positions (the first, third, …,eleventh digits) and multiply this sum by 3.II. [step 2]Calculate the sum of the digits in theeven-numbered positions (the second, fourth, …,tenth digits) and add this to the previousresult(result of step1).III. [step 3]If the last digit of the result from step2 is 0, then 0 is the check digit. Otherwise,subtract the last digit from 10 to calculate thecheck digit.IV. [step 4]If the check digit matches the final digitof the 12-digit UPC, the UPC is assumed correct.1. Write main function that prompts the user to enterthe 12 digits of a barcode. The program shouldstore the digits in an integer array.2. Write a “check” function to calculate the checkdigit, and…arrow_forwardsubject: microprocessor and assembly language Data transmission systems and file subsystems often use a form of error detection that relies on calculating the parity (even or odd) of blocks of data. Your task is to create a procedure that returns True in the EAX register if the bytes in an array contain even parity, or False if the parity is odd. In other words, if you count all the bits in the entire array, their count will be even or odd. Preserve all other register values between calls to the procedure. Write a test program that calls your procedure twice, each time passing it a pointer to an array and the length of the array. The procedure’s return value in EAX should be 1 (True) or 0 (False). For test data, create two arrays containing at least 10 bytes, one having even parity, and another having odd parity.arrow_forwardThe 32-bit RISC-V base integer instruction set (rv32i) does not support multiplication and division operations. To deal with this, a compiler may call a function when a multiplication is needed. For example, gcc expects that a function - mulsi3(unsigned int a, unsigned int b) is provided to multiply two integers. A multiplication can be carried out by repeated additions and shifts: unsigned int -_mulsi3 (unsigned int a, unsigned int b) { unsigned int r = 0; while (a) { if (a & 1) { r += b; } a >>= 1; b <<= 1; } return r; } a) Translate the above C code into equivalent RISC-V rv32i assembler code. Comment the as- sembler code to explain how the calculation proceeds. Note that the arguments are passed via the registers a0 (x10) and a1 (x11) and that the result is returned in a0 (x10). b) Does the function need function call prolog and epilog? Explain why or why not. You are invited to use emulsiV to develop and test your assembler code.arrow_forward
- You are asked to design a system of FP numbers representation (with your own design choices), labeled Custom_FP_48, for which we have 48 bits at our disposal in order to represent a number, in analogy with the IEEE 754 prototype. You are asked to provide: a) The types for evaluating this number b) The width of representation of these numbers (upper and lower) c) The maximum precision (i.e., the minimum difference between two successive numbers).arrow_forwardImplement the modular exponentiation (a.k.a. fast exponentiation) function mod_exp (b, n, m) to compute bn (mod m) more efficiently. (Hint: to read n bit-by-bit, use / and % operations repeatedly) a) Test your function for b = 3, n = 231 – 2, m = 231 – 1. b) Report the result and the time (in seconds) it takes to find the result. Q3. [30 pts] Modify your is_prime function to use the mod_exp (b, n, m) instead of the standard power operation (b**n % m). Rename it as is_prime2. Modify the mersenne (p) function to use is_prime2, and call it mersenne2. a) Use the modified function mersenne2 to print all the Mersenne primes Mp for p between 2 and 31 if possible, (with k = 3 in the is_prime function). Compare the results with the ones found in Q1. b) Gradually increase the range of p to find more Mersenne primes (say up to p = 101 if possible). What is the largest Mersenne prime you can achieve here? c) Extend the work in part (b) and find the maximum Mersenne prime you can get from this…arrow_forward2 Implement the following operation using arithmetic operation. 8 (AX) - 5 (BX) - (BX) /3 (AX)arrow_forward
- Given: F(a,b,c,d)=(a+b+c'+d')(a'+b'+c')(a+b+d)(a'+c) (a) Express F as a minterm expansion. (use m-notation) (b) Express F as a maxterm expansion. (use M-notation) (c) Express F' as a minterm expansion. (use m-notation) (d) Express F' as a maxterm expansion. (use M-notation)arrow_forwardThe associative memory formed by the four column vectors x1, x2, X3, and x4 is given by (a) X1X2X3X4 (b) x1x1* + x2x2* + X3X3'+ X4X4 (c) x1*x1 + x2*x2 + x3%3 + X4x4* (d) x1x1 - x2*x2 - x3'x3 - x4x4*arrow_forward1.Constrained by the size of the register in your old personal computer at home, youdecide to build a computer with a larger floating point register called R. Five octitscan be represented in R. You decide on the following format for the representation offloating point numbers:R: sign characteristic mantissaYou have available a 1 octit characteristic and a 3 octit mantissa.(a) What is the excess notation for the above registerarrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education