[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
WTF? Does this have a straightforward answer?
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /sci/ - Science & Math

Thread replies: 18
Thread images: 1
File: Capture.png (17 KB, 1624x182) Image search: [Google]
Capture.png
17 KB, 1624x182
WTF? Does this have a straightforward answer?
>>
Or does it require shenanigans? I thought about different frequencies and shit.
But strictly mathematically, I don't think you can solve this
>>
I don't understand what's supposed to happen
what does a process do if it recieves a pulse from the timer?
>>
>>8108731
I am confident that the pulse must cause some process to start running.
I am not even fucking sure what's in the rules and what's not. It doesn't specify.
Has anyone encountered something similar? And what were the rules?
>>
You have some central clock. When the clock edges on some value, it sends a start signal to each process to start running. When I've seen this problem type before, if a machine was already running it's process the signal has no effect. So the task is to time it using that info to meet the specifications
>>
>>8108882
it's literally impossible unless the clock ticks every second.
4,7 and 11 are coprime.
>>
>>8108707
Fire every second

>Proc A
static count=3;
if (count==3){
count=0;
goto run;
}
else{
count++;
goto sleep;
}

>Proc B
static count=6;
if (count==6){
count=0;
goto run;
}
else{
count++;
goto sleep;
}

>Proc A
static count=10;
if (count==10){
count=0;
goto run;
}
else{
count++;
goto sleep;
}

if the processes don't get notified when the timer fires:

>Proc A
static count=1;
if (count==1){
count=0;
goto run;
}
else{
count++;
goto sleep;
}

>Proc B
static count=2;
if (count==2){
count=0;
goto run;
}
else{
count++;
goto sleep;
}

>Proc C
static count=3;
if (count==3){
count=0;
goto run;
}
else{
count++;
goto sleep;
}
>>
>>8108882
why not just fire a constant pulse or 1pulse/sec

the rules don't punish pulse saturation. bad question wording
>>
>>8108910
because the first process for instance will start after 3 seconds instead of 4.
>>
>>8108934
do you even know what a static count is you nigger
>>
>>8108707
impossible; 4, 7, and 11 are coprime, as another anon said. we MUST send a pulse every four seconds to satisfy the first process' condition, but then second process' condition.

if we have some small program for each process which verifies whether or not the process should run at a given time (perhaps via counters), then it would have to fire every second.
>>
>>8108940
you're going to have to explain.
>>
>>8108909
>static count
>not using "count == 3 ? count = runProcessA() : ++count;" instead of that ugly as fuck if/else
real shit program buddy
>>
>>8108893
what are fractions..

In any case, what's wrong with every 1 second? I don't really understand the question... what difference does it make how long each process lasts? How is that relevant?
>>
>>8108976
>what are fractions..
you're an idiot; clock must tick in whole seconds.
>what's wrong with every 1 second
>what difference does it make how long each process lasts
you're beyond saving. reread the question. if you don't understand it, keep trying, and certainly don't have the audacity to criticize another's solution.
>>
>>8108976
t=0 first pulse
all 3 processes start

t=1 another pulse
all processes are still running so nothing happens

t=2 second pulse
all processes are still running so nothing happens
Process A stops
Processes B and C keep running

t=3 another pulse goes
Process A starts again.
While it should have waited until t=4.
>>
>>8108993
Someone has a bee in her bonnet!

>you're an idiot; clock must tick in whole seconds.

I've read the problem many times and don't see that in the text.

I didn't criticize any solution. I said every 1 second seem fine.

>>8108995
So we also assume that the processes can't count the number of times they've been signaled? OK.

What about the possibility that at the start they are not firing correctly, but after a finite number of pulses they are on track?
>>
>>8108707
Well, what is the problem?
Each process is completed within their respective repetition time. So you need one long array that is divisible by all 3 periods and pattern out each pattern.
Thread replies: 18
Thread images: 1

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.