FIFO algorithm, the whole program. Get another 300 points!

Updated on technology 2024-04-06
11 answers
  1. Anonymous users2024-02-07

    FIFO? Isn't it just a queue?

  2. Anonymous users2024-02-06

    *I know the principle of the FIFO algorithm, but I still don't understand this**, which master finger teaches the meaning of each program segment? Much appreciated! */

    #include

    #include

    define msize 3 allocates three memory page boxes define psize 12 total of 12 processes static int memery[msize] = ;

    static int process[psize] = ;Page visit sequence.

    void fifo();

    int main()

    get() The sequence of resources that need to be accessed.

    int i,n;

    for(i=0;i<12;i++) output sequence }void fifo().

    The assigned three page boxes are initialized to 0

    int i = 0, j = 0;

    int m = -1, n = -1;

    int max = -1,maxtime = 0;

    int count = 0;

    for(i = 0;imaxtime) } if(n == -1) A page missing break occurs because the required resource is not found in the page box and the table is also full.

    m = -1;

    elsemax = -1;

    maxtime = 0;

    count++;

    elsen = -1;

    for(j = 0 ;j < msize; j++)printf("\t%d",count);

  3. Anonymous users2024-02-05

    Hello, the Tieba team of experts is happy to be able to answer your questions. Your filial piety is the driving force for us to move forward.

    public class lru ;;

  4. Anonymous users2024-02-04

    Hahaha, who the hell are you, I'm going to tell Mr. Summer.

  5. Anonymous users2024-02-03

    The principle of calculating the minimum depth of asynchronous FIFO.

    If the data stream is continuous, no matter how deep the FIFO is, as long as the read and write clocks are of different sources and the same frequency, the number will be lost.

    FIFO is used to buffer block data streams, and is generally used when writing fast and reading slow, following the following rules:

    That is, make sure that there is no overflow when writing data to the FIFO and no underflow when reading data from the FIFO

    For example, if a D sample rate is 50 MHz and DSP reads A D read at 40 MHz, if you want to send 100,000 sample data to DSP without loss, how much FIFO of at least a large capacity (depth) should be added between A D and DSP?

    100,000 / 50mhz = 1/500 s = 2ms

    50MHz - 40MHz) *1 500 = 20k is both FIFO depth.

    A wrong algorithm (I also made the same mistake):

    100,000 / 40mhz= 1/400s =

    50m - 400m)*1/400 =25k.Then the data that goes in this way is not 100k, but 100k+50m*(, 000bit, the error in the calculation of time.

  6. Anonymous users2024-02-02

    FIFO is a first-in-first-out algorithm, when the page that the CPU needs to access is not in memory, a page missing interrupt is a program that calls the pages in the external memory into the memory, and the original pages in the memory need to be put back into the external memory. The page missing interruption rate is the number of missing pages during the execution of a process divided by the total number of pages to be accessed to obtain the missing page interruption rate, the lower the value, the better.

  7. Anonymous users2024-02-01

    Don't get me wrong.

    Page replacement! = Number of missing pages Page replacements Both are 6 times f i.e. Number of missing pages Number of failed page visits = Number of page replacements (respectively) + Number of times to fill in physical blocks at the beginning (respectively

    s is the number of hits and the number of successful page visits = respectively, so the page missing rate f is and respectively.

  8. Anonymous users2024-01-31

    In a request paging system, when using a simple clock algorithm, suppose the page direction of a job is page buffering algorithm (PBA) [I don't know if it's your PBA] and an improved clock algorithm as for the C program.

  9. Anonymous users2024-01-30

    m=3.

    Dial In Recall Replace Replace Replace Replace Hit Hit Replace Replace Hit.

    Missing page rate = 9 12 = 75% m = 4.

    Dial In Recall Recall Hit Hit Replace Replace Replace Replace Replace Replace Replace

    Page Missing Rate = 10 12=

  10. Anonymous users2024-01-29

    The missing page rate is first of all, to know what is called missing pages, the simplest explanation is that there is no hit page, that is, the page is replaced.

  11. Anonymous users2024-01-28

    Hello: China Unicom New Forces 2011 New Campus Card. Choose a 4 happy number, 6 yuan per month to send caller ID, local calls in the preferential area are all yuan per minute.

    Send 100 free Internet traffic, if it is not enough, it is recommended to pack 15 yuan 300m traffic, which is equivalent to 21 yuan per month to enjoy 400m Internet traffic.

    There is also a new one launched by Unicom called Ruyitong C card, monthly rent of 10 yuan, send caller ID, send 50M traffic, send 100 free text messages. If the flow is not enough, you can package another 5 yuan 50m, 9 yuan 120m, 15 yuan 300m. If there are more long-distance calls, you can open a 3 yuan long phone package and enjoy the long call 012 yuan per minute.

Related questions
10 answers2024-04-06

Fast row (the most common and the easiest).

The idea of algorithms is divide and conquer. >>>More

4 answers2024-04-06

Time slice rotation scheduling is one of the oldest, simplest, fairest, and most widely used algorithms. >>>More

4 answers2024-04-06

Genetic algorithm is a kind of randomized search method that draws on the evolutionary laws of the biological world (survival of the fittest, survival of the fittest, genetic mechanism). >>>More

5 answers2024-04-06

There are no advantages or disadvantages, this algorithm is just a way to solve the problem of convergence. Advantages and disadvantages need to be compared, and there is no comparison object and the same comparison conditions, how to talk about advantages and disadvantages. There are many algorithms that can be solved for every problem, and it is not necessarily good or bad to iterate. >>>More

5 answers2024-04-06

First, 3 linklist types list, p, and r. are declaredYou can think of list as a table, but at the beginning it is an empty table, list is assigned to r, start a for loop, specify the next node of r as p (head node), and then assign p to r, the next node of the head node is list, list is assigned to p, enter a from the keyboard, if a > 0, then the data part of the second node is the value of a, and the cycle continues, and the condition for the end is to enter the value a>=0, when p is sure to reach the last node after the while loop ends, p is assigned to r, r is the end node, and then output with do while, output the data of each node, and the end condition is p to the end node. To put it bluntly, first create an empty table k-1 node, then input the keyboard to assign the value of the data part of each node to "0", and finally output the input value.