COMPUTER SYSTEMS&MOD MSGT/ET SA AC PKG
COMPUTER SYSTEMS&MOD MSGT/ET SA AC PKG
3rd Edition
ISBN: 9780134671123
Author: Bryant
Publisher: PEARSON
bartleby

Concept explainers

Question
Book Icon
Chapter 6, Problem 6.36HW

A)

Program Plan Intro

Given Information:

The given code is:

//variable declaration

//matrix

Int x[2][128];

int i;

//variable to store sum

Int sum=0;

//iterate through the matrix

for(i=0;i<128;i++)

{

//sum of matrix elements

sum+= x[0][i]*x[1][i];

}

Explanation:

  • The given array is x[2][128]. The cache is initially empty and it begins to store data from “0x0” addresses.
  • Here, size of (int) =4.
  • Only memory accesses entries of array “x”.
  • C arrays allocated in row-major order which means that each row is in their contiguous memory location.

B)

Program Plan Intro

Given Information:

The given code is:

//variable declaration

//matrix

int x[2][128];

int i;

//variable to store sum

int sum=0;

//iterate through the matrix

for(i=0;i<128;i++)

{

//sum of matrix elements

sum+= x[0][i]*x[1][i];

}

Explanation:

  • The given array is x[2][128]. The cache is initially empty and it begins to store data from “0x0” addresses.
  • Here, size of (int) =4.
  • Only memory accesses entries of array “x”.
  • C arrays allocated in row-major order which means that each row is in their contiguous memory location.

C)

Program Plan Intro

Given Information:

The given code is:

//variable declaration

//matrix

Int x[2][128];

int i;

//variable to store sum

Int sum=0;

//iterate through the matrix

for(i=0;i<128;i++)

{

//sum of matrix elements

sum+= x[0][i]*x[1][i];

}

Explanation:

  • The given array is x[2][128]. The cache is initially empty and it begins to store data from “0x0” addresses.
  • Here, size of (int) =4.
  • Only memory accesses entries of array “x”.
  • C arrays allocated in row-major order which means that each row is in their contiguous memory location.

D)

Program Plan Intro

Given Information:

The given code is:

//variable declaration

//matrix

int x[2][128];

int i;

//variable to store sum

int sum=0;

//iterate through the matrix

for(i=0;i<128;i++)

     {

//sum of matrix elements

              sum+= x[0][i]*x[1][i];

     }

  • The given array is x[2][128]. The cache is initially empty and it begins to store data from “0x0” addresses.
  • Here, size of (int) =4.
  • Only memory accesses entries of array “x”.
  • C arrays allocated in row-major order which means that each row is in their contiguous memory location.

E)

Program Plan Intro

Given Information:

The given code is:

The given code is:

//variable declaration

//matrix

Int x[2][128];

int i;

//variable to store sum

Int sum=0;

//iterate through the matrix

for(i=0;i<128;i++)

{

//sum of matrix elements

sum+= x[0][i]*x[1][i];

}

Explanation:

  • The given array is x[2][128]. The cache is initially empty and it begins to store data from “0x0” addresses.
  • Here, size of (int) =4.
  • Only memory accesses entries of array “x”.
  • C arrays allocated in row-major order which means that each row is in their contiguous memory location.

Blurred answer
Students have asked these similar questions
D. S. Malik, Data Structures Using C++, 2nd Edition, 2010
Methods (Ch6) - Review 1. (The MyRoot method) Below is a manual implementation of the Math.sqrt() method in Java. There are two methods, method #1 which calculates the square root for positive integers, and method #2, which calculates the square root of positive doubles (also works for integers). public class SquareRoot { public static void main(String[] args) { } // implement a loop of your choice here // Method that calculates the square root of integer variables public static double myRoot(int number) { double root; root=number/2; double root old; do { root old root; root (root_old+number/root_old)/2; } while (Math.abs(root_old-root)>1.8E-6); return root; } // Method that calculates the square root of double variables public static double myRoot(double number) { double root; root number/2; double root_old; do { root old root; root (root_old+number/root_old)/2; while (Math.abs (root_old-root)>1.0E-6); return root; } } Program-it-Yourself: In the main method, create a program that…
I would like to know the main features about the following 3 key concepts:1. Backup Domain Controller (BDC)2. Access Control List (ACL)3. Dynamic Memory
Knowledge Booster
Background pattern image
Computer Science
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
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Text book image
Systems Architecture
Computer Science
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Cengage Learning
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
New Perspectives on HTML5, CSS3, and JavaScript
Computer Science
ISBN:9781305503922
Author:Patrick M. Carey
Publisher:Cengage Learning