Question

2. There are a large number of algorithms for generating random numbers. The Linear Congruential Method...

2. There are a large number of algorithms for generating random numbers. The Linear Congruential Method is one of them, and it has the following form: In+1 = modm(a In + c) This generates the next number in the sequence by multiplying the previous number In by a, adding c, and taking modulo m. Write an assembly code for a subroutine which generates 8 bit random numbers with m=256, a=5, and c=67.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Solution: Subroutine random 8-bit random number generator. : in order for this routine to work, there are 2 things to consideMOV A, RN4 RRC MOV RN4. A MOV A. RN3 RRC ; rotate RN4 MOV RN3. A MOV A. RN72 RRC MOV RN2, A MOV A, TEMP1 RLC MOV RN1. A MOV RThis generates the next number in the sequence by multiplying the previous number in bv a, adding c. and taking modulo m m-25

Add a comment
Know the answer?
Add Answer to:
2. There are a large number of algorithms for generating random numbers. The Linear Congruential Method...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Problem 8 (Pseudorandom Numbers). Randomly chosen numbers are often needed for computer simulations of physical phenomena,...

    Problem 8 (Pseudorandom Numbers). Randomly chosen numbers are often needed for computer simulations of physical phenomena, and they are needed to generate random keys for cryptography. Different methods have been devised for generating numbers that have certain properties of randomly chosen numbers. Because numbers generated by systematic methods are not truly random, they are called pseudorandom numbers. There are fundamental properties we would like the pseudorandom sequence/pseudorandom number generator to possess for cryptographic purposes. 1. It is easy to compute...

  • This homework is an approach to generating random numbers. In this technique a seed value is...

    This homework is an approach to generating random numbers. In this technique a seed value is used to construct a new (seemingly random) value in the following manner:  The seed, s, is written down in n-bit binary.  Several bit positions, called taps, are used to generate a feedback bit. Bit n-1 is always one of the taps.  The feedback bit, f is the exclusive-or of the tap bit values  The seed is shifted to the left...

  • 5000) of uniformly distributed random numbers between 1 Generate a large number (1000 or and 2...

    5000) of uniformly distributed random numbers between 1 Generate a large number (1000 or and 2 (HINT: use the rand command for generating a uniformly distributed random variable between 0 and 1 and then move it!). b Plot the pdf of the distribution. Use the hist command to obtain the number of samples in a random numbers, define binx as a vector with bins on the x-axis (binx = 1:0.01:2). P histx,binx) will provide you the weights pdf. Compare with...

  • 2. Generate a large number of Gaussian distributed random numbers with mean 0 and variance 1....

    2. Generate a large number of Gaussian distributed random numbers with mean 0 and variance 1. (HINT: use the randn command) a) Provide a scatter plot of the random numbers b) Plot the pdf of the distribution (similar to 1) and compare with theoretical pdf given in the class handout. c) If I want to generate a Gaussian distributed random numbers with mean 2 and variance 9 from the previously generated set of random numbers, how would I do it?...

  • use c++ language, keep it simple i am using code block Exercise#2: Arrays with Random Numbers...

    use c++ language, keep it simple i am using code block Exercise#2: Arrays with Random Numbers Write a program that generates n random numbers as follows: Asks the user to input a positive integer n Asks the user to input the maximum value (say m) for the integers to be generated. Write a program that generates the n numbers in the range 0 to m. The program stores the generated numbers in an array A[ Asks the user to enter...

  • Some Extra Definitions Recall that, for a nonrandom real number c, and a random variable X,...

    Some Extra Definitions Recall that, for a nonrandom real number c, and a random variable X, we have Var (cX) = e Var (X). In this problem we'll generalize this property to linear combinations! Let be a vector of real nonrandom numbers, and let be a vector of random variables (sometimes called a random vector). Last, define the covariance matrix to be the matrix with all the covariances ar- ranged into a matrix. When we talk about taking the taking...

  • (5) Fibonacci sequences in groups. The Fibonacci numbers F, are defined recursively by Fo = 0,...

    (5) Fibonacci sequences in groups. The Fibonacci numbers F, are defined recursively by Fo = 0, Fi-1, and Fn Fn-1 + Fn-2 for n > 2. The definition of this sequence only depends on a binary operation. Since every group comes with a binary operation, we can define Fibonacc type sequences in any group. Let G be a group, and define the sequence (n in G as follows: Let ao, ai be elements of G, and define fo-ao fa and...

  • Create a NOTEPAD or PDF file that restates the problem in your own words, specifies what input is needed, w...

    Create a NOTEPAD or PDF file that restates the problem in your own words, specifies what input is needed, what output is expected, the step by step process (algorithm) to get the output from the input, and test data (input for which you know the expected output) for each of the 3 problems given below. You should not write any actual C++ code. Make sure the problem statement is in your own words and is descriptive enough so someone not...

  • You may import the following library functions in your module: from fractions import gcd from math...

    You may import the following library functions in your module: from fractions import gcd from math import log from math import floor You may also use: • the .bit_length() method to efficiently obtain the bit length of an integer, • the abs() function for computing the absolute value of an integer, • and the // operator for integer division (you should avoid using / because it does not work for very large integers). Implement the following Python functions. These functions...

  • Implement the following Python functions. These functions take advantage of the generalized Euclid's lemma to make...

    Implement the following Python functions. These functions take advantage of the generalized Euclid's lemma to make it possible to generate a random number within a specified range. Your implementations must be extremely efficient, and must handle very large inputs, as shown in the examples below. Implementations that perform exhaustive, exponential-time searches will receive no credit. a. Implement a function closest(t, ks) that takes two arguments: a target integer t and a list of integers ks. The function should return the...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT