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.
A random variable (X) is modelled as an exponentially distributed with mean 30 units. Simulate N = 50 samples from this distribution, and every sample must have m = 20 simulated va
Normal 0 false false false EN-IN X-NONE X-NONE
Accumulator is the register in which Arithmetic and Logic calculations are completed.
Q. Determine the complete OR gate and AND gate decoder count for an IC memory with 4096 words of 1 bit each, using the Linear select memory organization and Two dimensional Memory
Explain the Quantization error of an ADC. Ans. Quantization error- An analog voltage is within the range of 0 to 1V and for 3 bit output, the size of all intervals are
This boils down to the concept of Binary digits. Take an array size of 64 for example. We begin from 0 and end at 63. We need 6 bits.But, if we were to begin from 1 and end at 64,
Define various system? Single job system: Only one program may be run at a time, and therefore only one person might be work on a machine at one time. Multi job system:
The next type of input is a Pull Down List. With this type you have to employ in place of and it also has a closing tag. This control is used when we have a
What are kinds of models? Class model - Objects in the system and their relationships. State model - Life history of the objects. Interaction model - Interactions between
Design an OR to AND gates combinational network and NAND only n/w for the following Boolean expression: A'BC'D + ABC'D' + A'B'CD' + A'BCD'
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