
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
![6.
Comment on each snippet with what the snippet does. Assume that there is an
array, int arr [6] = (3, 1, 4, 1, 5, 9}, which starts at memory address
0xBFFFFF00. You may assume that each integer is stored in 4 bytes. Register a0 contains
arr's address 0xBFFFFF00.
a)
b)
1w
1w
add
SW
loop:
end:
to, 0 (a0)
t1, 8 (20)
t2, to, t1
t2, 4 (a0)
add
slti
beq
slli
add
1w
sub
SW
addi
j
to, x0, x0
t1, to, 6
t1, x0, end
t2, to, 2
t3, a0, t2
t4, 0 (t3)
t4, x0, t4
t4,
0 (t3)
to, to, 1
loop](https://content.bartleby.com/qna-images/question/9f5c46b0-e9ff-4672-89bb-36325b9de9d1/8cd5bfd2-35d7-432a-b5e7-f4d5594febe1/e6hr08c_thumbnail.png)
Transcribed Image Text:6.
Comment on each snippet with what the snippet does. Assume that there is an
array, int arr [6] = (3, 1, 4, 1, 5, 9}, which starts at memory address
0xBFFFFF00. You may assume that each integer is stored in 4 bytes. Register a0 contains
arr's address 0xBFFFFF00.
a)
b)
1w
1w
add
SW
loop:
end:
to, 0 (a0)
t1, 8 (20)
t2, to, t1
t2, 4 (a0)
add
slti
beq
slli
add
1w
sub
SW
addi
j
to, x0, x0
t1, to, 6
t1, x0, end
t2, to, 2
t3, a0, t2
t4, 0 (t3)
t4, x0, t4
t4,
0 (t3)
to, to, 1
loop
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- DO NOT COPY FROM OTHER WEBSITES Correct and Detailed answer will be Upvoted else downvoted. Thank you!arrow_forward******THIS IS ASSEMBLY LANGUAGE******** Create a new project to run the following program Declare an array: .DATA arrayB WORD 1,2,3,4 Write code to Rearrange the array as follows: 4,3,1,2 Debug the code until you reach “INVOKE ExitProcess, 0”arrow_forwardSorted Names Problem:Assume that you already have the bubbleSort () ans swapS() modules. Design the main() program that allows the user to enter 20 names into a String array. Sort the array in ascending (alphabetical) order and display its contents. // The bubbleSort module accepts an array of Strings and array size// and sorts array in ascending orderModule bubbleSort(String Ref array[], integer arraySize) Declare Integer index1, index2 // bubblesort scores For index1 = arraySize – 1 to 0 Step -1 For index2 = 0 to index1 – 1 If array[index2] > array[index2 + 1] Then Call swapS(array[index2], array[index2 + 1) End If End For End ForEnd Module// The swapS module accepts two String elements and swaps their contentsModule swapS(String ref a, String ref b) Declare String temp // Swap a and b Set temp = a Set a = b Set b = tempEnd Modulearrow_forward
- 12arrow_forwardSorted Names Problem Assume that you already have the bubbleSort () and the svap() modules. Use pseudocode to design the main() program that allows the user to enter 20 names into a String array. Sort the array in ascending (alphabetical) order and display its contents. // The bubbleSort module accepts an array of Strings and array size // and sorts array in ascending order Module bubbleSort(String Ref array[], integer arraySize) Declare Integer index1, index2 // bubblesort scores For index1 = arraySize – 1 to 0 Step -1 For index2 = 0 to index1 – 1 If array[index2] > array[index2 + 1] Then Call swapS(array[index2], array[index2 + 1) End If End For End For End Module // The swapS module accepts two String elements and swaps their contents Module swapS(String ref a, String ref b) Declare String temp // Swap a and b Set temp = a Set a = b Set b = temp End Modulearrow_forwardGiven the declaration: int matrix[7][5]; a) How many elements does matrix have? b) Write the statement to read an integer entered at the keyboard into the second row and second column of the array matrix. c) Assume that the array matrix has already been assigned values. Write a statement that outputs the number stored in the first column of the last row in the array matrix. d) Assume that the array matrix has already been assigned values. Write a for loop to calculate the total of the integers stored in the first row of matrix.arrow_forward
- MIPS Assembly The program: Write a function in MIPS assembly that takes an array of integers and finds local minimum points. i.e., points that if the input entry is smaller than both adjacent entries. The output is an array of the same size of the input array. The output point is 1 if the corresponding input entry is a relative minimum, otherwise 0. (You should ignore the output array's boundary items, set to 0.) My code: # (Note: The first/last entry of the output array is always 0# since it's ignored, never be a local minimum.)# $a0: The base address of the input array# $a1: The base address of the output array with local minimum points# $a2: Size of arrayfind_local_minima:############################ Part 2: your code begins here ###la $t1, ($t2)la $t1, ($t2)move $a1, $s0 li $a2, 4jal find_local_minima print:ble $a2, 0, exitlw $a0, ($s0)li $v0, 1syscall addi $s0, $s0, 4addi $a2, $a2, -1 ############################ Part 2: your code ends here ###jr $ra I am not getting the correct…arrow_forwardSegmentation: Select all of the following statements that are true. In segmentation, a logical address always has a length of 32 bit. In order to translate logical into physical addresses, the memory management unit uses the segment part of the logical address to determine the start address in the segment table and adds the offset to this to get the physical address. In segmentation, the logical address consists of a segment part and an offset. The segment length is limited by the maximum possible segment number. When applying segmentation, processes are only allowed to access the memory within their segments. Segments can be assigned access rights and privilege levels.arrow_forwardc) Declare a 2-D array of size 5*5 and fill it randomly with values 0,1 and then print the sum of all elements of the array in the output. Hint: Use rand() function to fill the array. Programming language: C++arrow_forward
- 1) Code that takes number of rows and columns from the user using the concept of multidimensional arrays using java. 2) Ask the user for the elements to be stored 3) Print the elements by row 4) Print the sum of the elements by row Enter number of rows: 3 Enter number of columns : 3 Enter contents of the table: a[0][0]: 1 a[0][1]: 2 a[0][2]: 3 a[1][0]: 4 a [1][1]: 10 a[1] [2]: 20 a[2][0]: 30 a[2][1]: 70 a[2][2]: 5 The contents of the table are: Row 0 ==Y [ 1 2 3 Row 1 ==V Row 2 ==> [4 10 20 [ 30 70 5 ]Sum of Row 0 is = 6 ] Sum of Row 1 is = 34 ]Sum of Row 2 is = 105arrow_forward6) Write a program that declares a 10-element integer array. Initialise the arrays with the values: 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 using a for loop. Then output the array values.arrow_forwardAssume an int is size 4 bytes on our system. What is the size in bytes of the following array: int results[3][4]; A.) 12 B.) 3 C.) 4 D.) 48 E.) 24arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- 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

Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education