Already have an account? Get multiple benefits of using own account!
Login in your account..!
Remember me
Don't have an account? Create your account in less than a minutes,
Forgot password? how can I recover my password now!
Enter right registered email to receive password!
Q. Show the Programmes for Parallel Systems?
Adding elements of an array using two processor
int sum, A[ n] ; //shared variables
void main ( ){
int i ;
for (i=0; i scanf ("%d",&A[i] ); sum=0; // now create process to be executed by processor P1 fork(1) add (A,n/2,n-1, sum); // process to add elements from index n/2 to - 1.sum is output variable // now create process to be executed by processor P0 add (A,0,n/2-1, sum); join 1 ; printf ("%d", sum); } add (int A[ ], int lower, int upper, int sum) { int sum1=0, i; for (i=lower; i<=upper; i++) sum1=sum1+A[i]; lock sum; sum=sum+sum1; unlock sum ; } In this program last half of array is passed to processor P1 that adds them. For the meantime processor P0 adds the first half of array. The variable sum is locked to avoid inconsistency.
scanf ("%d",&A[i] );
sum=0;
// now create process to be executed by processor P1
fork(1) add (A,n/2,n-1, sum); // process to add elements from index n/2 to -
1.sum is output variable // now create process to be executed by processor
P0 add (A,0,n/2-1,
sum);
join 1 ;
printf ("%d", sum);
}
add (int A[ ], int lower, int upper, int sum)
{
int sum1=0, i;
for (i=lower; i<=upper; i++)
sum1=sum1+A[i];
lock sum;
sum=sum+sum1;
unlock sum ;
In this program last half of array is passed to processor P1 that adds them. For the meantime processor P0 adds the first half of array. The variable sum is locked to avoid inconsistency.
Q. How can one decide this decimal position? Decimal position can be signified by a position between flip-flops (storage cells in computer). However how can one decide this dec
Computer Arithmetic Data is manipulated with the help of arithmetic instructions in digital computers. Data is manipulated to produce the results necessary to provide solut
Virtual Private Networks (VPN) In order to encrypt/decrypt all the communication network traffic that passes through the Internet or Intranet, a VPN uses software or hardware.
design modulo 12 up synchronous counter using t flip flop
Q. Explain Register Indirect Addressing? In this addressing technique the operand is data in memory pointed to by a register. Or we can say in other words that the operand fie
What logic is inferred when there are multiple assign statements targeting the same wire? It's illegal to specify multiple assign statements to the same wire in a synthesizable
Application layer (layer 4) in TCP/IP model corresponds to? In OSI model, application layer (layer 4) in TCP/IP model corresponds to layer 6 and layer 7.
SEARCH is a sequential search from the starting of the table. SEARCH ALL is a binary search, continually dividing the table in two halves until a match is found. SEARCH ALL is more
(a) Write short notes on displacement only addressing mode. (b) Explain the formats of a 80-bit floating point number. (c) Given the following assembly program. Instructi
Q. Explain about Multiple Program Multiple Data? Like SPMD, MPMD is in fact a 'high level' programming model that can be built on any combination of previously described parall
Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!
whatsapp: +91-977-207-8620
Phone: +91-977-207-8620
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd