



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




ECE 575 Exam 1 Monday, October 13, 2003 Due: Monday, 5PM, October 20, 2003 The following is based on the exam of Erik Hix
1 The domain is {a,b,c} and the range is {T1,T2,T3}. object track a c T fully defined___ single-valued_X_ one-one_X_ onto __
object track a T c T fully defined___ single-valued_X _ one-one_X_ onto __ object track a T b T c T fully defined_X_ single-valued_X_ one-one_X_ onto X object track a b T c T fully defined___ single-valued_X_ one-one_X_ onto __ object track a T b T c T fully defined_X_ single-valued_X_ one-one___ onto __
int : S S is given by int :(a) = b, int :(b) = a ext : Q Xb^ S not needed since X is empty : conS : Q Y b (^) is given by Xb^ S not needed since X is empty (a) = 0, (b) = 1 ta : S R +0,
The first column of the following table gives different choices for ta. Fill in the middle column with the requested output value, if it can be uniquely determined; otherwise leave it blank. Fill in the last column with an explanation of your answer in the second column.
Definition of ta : Starting in state a, the output produced just before the transition at t = 2, is:
Explanation
ta (a) = 1 At t = 1, the state becomes b. ta (b) is undefined. The DEVS is illegitimate since it cannot advance past t = 1. ta (a) = 1, ta (b) = 1 1 At t = 2, the state is b and is about to become a. 1 is produced as output before the transition happens. ta (a) = 0, ta (b) = 0 This is an illegitimate DEVS since time cannot advance past 0. ta (a) = 0, ta (b) = 1 1 (partial credit given if you add
Just before t = 2, the state is b. The DEVS outputs 1. After this output, the state becomes a. Now the next DEVS cycle is started and the simulator updates the current time to 2. The model immediately outputs 0 and the state then becomes b – but this output occurs at t=2, not just before as requested. ta (a) = ∞, ta (b) = 1 No output is produced at t = 2. No transition happens at this time. The DEVS remains in state a for ∞. ta (a) = 2, ta (b) = ∞ 0 At t = 2 the state is a and is about to become b. 0 is produced as output, and then the state changes to b. In the following, fill in the right hand column with true or false. Definition of ta : The pair (b,.5) is in the total state set Q ta (a) = 1 F ta (a) = 1, ta (b) = 1 T ta (a) = 0, ta (b) = 0 F ta (a) = 0, ta (b) = 1 T ta (a) = ∞, ta (b) = 1 T ta (a) = 2, ta (b) = ∞ T
int : S S is given by: int (phase , r ) = (passive ,null) //go from either phase to passive and nullify the stored value ext : Q Xb^ S is given by: ext (phase, x , e ,r)= (active, r)//store the value con :^ Q^ ^ Xb^ ^ S^ is given by:^ con (active,x, e, r)= // use the external transition function^ ext (active,x , e ,r) ta : S R +0, is given by: ta (active, r) = 0.10, ta (passive, r) = ∞ Definition for Transducer: Transducer X = R X , S , Y , int , ext , con ,, ta S Y (^) = {}= {active,passive} R bits R time where R bits = N and R time = R +0, ext : Q Xb^ S is given by: ext (active, bits, time, e, r ) = (active, bits + 164, time + e) tacon : S : (^) Q R X + b^ S is given by: con (active, bits, time, e , r ) = ext (active, bits, time, e , r ) 0, is given by:^ ta (…) = ∞ Can also add an output port to the transducer to enable it to turn off the generator after a given observation time
b) Implements the coupled model in DEVSJAVA. With w = 1, run your coupled model long enough so that the transducer gives a good estimate for the bandwidth consumed by sending the generator’s output across the network to the processor. The coupled model is provided in the file GenTransDisp.java. The bandwidth remains constant at 16,400 bits/second. This calculation is based on the assumption that every packet has a 100 bit header and a 64 bit payload (the size of a double). Packets are sent at the rate of 100 packets per second.
c) It ignores subsequent inputs unless and until it encounters one whose absolute difference from the stored A quantizer has the following behavior: it stores and immediately outputs the first input that it receives. value exceeds a positive value, called the quantum. When this happens, the new input replaces the old stored value and is output with a zero delay. 3. Formalize the quantizer as basic DEVS model.
M^ Definition for Quantizer: X , S , Y , X = R int , ext , con ,,^ ta S = {starting, active R , outputting R } Y = R - int :^ S^ ^ S^ is given by:^ int (outputting, R) = (active, R) ext :^ Q^ ^ Xb^ ^ S^ is given by ^ extext (active, R , e, (starting, e,^ R R )=(outputting,)=(outputting,^ R R ) //initially store the first input)if abs( R - R)≥ quantum ext (active, R, e, R )=(active, R) //no change otherwise else con : S :^ Q^ Yb^^ X is given by b^ ^ S^ is given by: ( outputting, R^ con =^ ext^ (^ int (), e,^ R^ ) ta : S R +0, is given by: ta (outputting, R) = 0.0 )^ = R ta ta (active(starting) = ∞ R) = ∞
e) Extend your DEVSJAVA coupled model in b), so that the output of the generator is fed to the quantizer with quantum = 0.1 whose output feeds the display processor. Also couple the quantizer’s output to the transducer’s input. The solution to this is provided by GenQuanTransDisp.java
f) With w = 1, run your coupled model long enough so that the transducer gives a good estimate for the bandwidth consumed by sending the quantized output across the network to the processor. Repeat with w = .1, .01, and .001 to obtain a table which for each value w gives the bandwidth consumed. Discuss any trend you see in the table. Value of w Throughput (at t = 1000) 1.0 940 bits/sec 0.1 93 bits/sec 0.01 9 bits/sec 0.001 1 bits/sec As the frequency decreases, the bandwidth used decreases linearly with it. This makes sense. When we scale the frequency down by a factor of 10, the values generated will change at one tenth the previous rate. Since the Quantizer filters on a fixed quantum, scaling the rate of change results in scaling the output rate by approximately the same factor. We can specify an observation time as small as one quarter cycle – pi/2w.
g) What effect does placing the quantizer in between the generator and processor have on the display? Suggest a way that this problem can be ameliorated.
The quantizer creates a longer delay between outputs. Because the generated values ore not linearly distributed, the outputs past through the quantizer are not generated at a defined interval. Consequently, the Display is prone to spending the majority of it’s time displaying no (or a null) value. One solution would be to modify Display so that it continues to display the last value it has received for an infinite amount of time until a new input is received. Another is to add an input controlled generator that provides the screen refreshing needed. Both approaches are provided in the files.