Earliest Deadline Message Scheduling with

4 downloads 0 Views 221KB Size Report
The actual value of B depends on the protocol used and on the frame format. If we assume that all .... frame, the token frame, circulates the ring. The sta- tion that ...
Earliest Deadline Message Scheduling with Limited Priority Inversion Antonio Meschi Marco Di Natale Scuola Superiore S.Anna Via Carducci, 40 - 56100 Pisa - Italy

Marco Spuri Projet Reflecs - INRIA 78153 Le Chesnay Cedex - France

[email protected]

[email protected]

Abstract

work [7] has produced schedulability bounds for realtime messages in timed-token networks. A static technique often employed in real-time systems is also time division, as in the Time Triggered Protocol (TTP) [3], where the assignment of the network is done by TDMA (Time Division Multiple Access) and a xed portion of time is statically assigned to each message. In uniprocessor systems, dynamic techniques have been shown to be more ecient than their static counterparts. Namely, the Earliest Deadline First (EDF) algorithm is guaranteed to nd an optimal schedule up to a 100% of processor utilization, while with the corresponding optimal static algorithm, Rate Monotonic (RM), only task sets with utilization less than 69% can always be guaranteed to be feasibly scheduled [6]. As for processor scheduling, static techniques are less ecient then their dynamic counterparts in scheduling computer networks, especially when the number of messages is changeable and when high urgency messages must be granted an immediate access. It should be noted how the schedulability bounds that are obtainable for static scheduling in computer networks are even lower than the 69% utilization guaranteed for the uniprocessor task scheduling. This is due to a few reasons as the agreement problem, the limited number of priority bits that are made available by the network protocols and the limited preemption allowed by message packetization. A clear description of these phenomena can be found in [4]. In this paper, we will present a dynamic technique to schedule real-time messages in a LAN. The technique is a simple variation of the earliest deadline scheduling policy. We will rst show how to check the schedulability of a set of packetized messages, under the assumption of a \perfect" distributed implementation of EDF. Later, we will remove this assumption and we will show what is the e ect on the schedulability bounds of a limited number of available priorities. The analysis will

This paper presents an innovative approach for scheduling network messages with real-time dynamic algorithms. The solution described in this work takes advantage of the increased network utilization allowed by dynamic scheduling methods and bounds at the same time the priority invertion phenomena caused by the lack of a sucient number of priority levels. We give a very simple formula for checking the schedulability of a set of real-time packetized messages, and we show that the penalty introduced by priority inversion can be bounded within a satisfactory predictable range.

1 Introduction It is commonly believed that distribution is a natural choice for most real-time systems, due to the advantages in robustness, cost, and the physical characteristics of most control architectures, where sensors and actuators are distributed in plants or large machines (for example aircrafts) and connected to a number of cooperating computers. Only in very recent times the need for predictable computing and communication has produced standards aimed at real-time network communications. Accordingly, the problem of how to predictably schedule a set of real-time messages in a distributed system has been studied only in recent times, and the aim of most researchers has been to apply the well-known results obtained for processor scheduling to the existing network standards. The result of their studies has been a set of protocols that use a static priority ordering to solve the contention for the channel. The scheduling of real-time periodic messages has been studied in [9], [10] for the Token-ring and CAN standards. Another  This

work has been supported in part by the Commission of the European Communities under contract ERBCHBGCT930458, proposal ERB4050PL931117.

1

be aimed at the presentation of a priority assignment method that maps deadlines to priorities minimizing the e ect of priority inversion. The nal result will be a mathematical relationship that, given the number of priority bits allowed by the network standard, the size of the packets and the maximum ratio between any two application message deadlines, shows which is the maximum load that is allowed for the channel without missing any message deadline. The paper is structured as follows. Section 2 contains the study on the applicability of EDF techniques to the scheduling of real-time packetized messages in prioritybased networks. Section 3 contains the analysis of the priority inversion e ect caused by a limited number of priority levels. In Section 4 we introduce the new technique for computing message priorities and show how the e ect of priority inversion is limited. Finally, in Section 5 we summarize our main results.

2 Earliest Deadline Approach in Network Scheduling In [8] we analyzed three families of protocols: the EDF/Token-Ring, the EDF/Binary Countdown and the EDF/CSMA-CD. A common characteristic of all these protocols is the following: the contention phase is resolved on the basis of priorities which are dynamically computed according to the message deadlines. The rst two protocols are extensions of the well known token-ring and CAN standards. The third one is a major variation of the CSMA-CD standard, where the resolution of the contention is a binary selection of the earliest deadline contending message (the method is actually a variation of the one proposed in [5]). In all cases the priority assigned to each message Mi in the competition for the shared channel depends on the value of (di ? tSTART ), where di is the absolute deadline of Mi and tSTART is a reference value computed every time there is a contention for the channel, and assumed as the starting time of the contention itself. The priority assigned to messages is inversely proportional to the value of (di ? tSTART ). The transmission of network messages cannot be made fully preemptable because of the additional protocol information necessary to send data through the communication channel. Thus, messages are divided into packets and each packet is inserted in the data eld of a frame, which is the elementary unit of transmission. The shorter is the transmission unit, the higher is the cost of the protocol management. This is the reason why preemption is essentially limited to packet boundaries.

Since every message queued and waiting to be sent must wait the transmission of the current packet before being allowed to contend for the channel, it can happen that a message with the highest priority is not transmitted immediately. This causes a priority inversion phenomenon, which is limited to a time interval at most large B , the worst-case remaining time for the current packet to leave the network. The actual value of B depends on the protocol used and on the frame format. If we assume that all the frames of a message get queued at the same time, then the priority inversion can happen only at the time a message is ready to be sent and before the transmission of the rst frame. That is, only the rst frame of each message can potentially su er from priority inversion. Once the rst frame has gained access to the network, it is not possible that any other lower priority message gets the channel. This situation is similar to the one presented in a uniprocessor environment when tasks share critical sections. In [1] Baker describes the SRP algorithm, a protocol ables to limit the priority inversion among tasks accessing pools of shared resources. In this case Baker proves the suciency of the following schedulability test:

8j = 1; : : : ; N

j X

Ci + Bj  1; D Dj i=1 i

where Ci is the worst case computation time of the ith task, Di is its deadline, and Bj is the worst case blocking time of the j th task. We will show how this

test can be applied to the network scheduling problem, when the EDF algorithm is used to schedule messages on a single shared channel. In this case Bj is the worst case blocking time B addressed before. Ci corresponds to the time the channel is occupied by the transmission of message Mi , and includes the protocol overheads associated to the transmission of the message. For the computation of Ci we distinguish two types of overheads: those associated to each frame and those associated to the whole message. In Section 2.1 we show how these values can be determined for the EDF/Token-Ring protocol. Assume now that the protocol is able to implement a \perfect" distributed EDF message scheduling. We apply the same argument as Baker did, in order to nd a rst guarantee test, which we will later extend to a more realistic scenario.

Theorem 2.1 Given a set of N periodic messages, M1 ; M2; : : : ; MN ordered by increasing relative deadlines D1 ; D2 ; : : : ; DN , they can be feasibly sent within

Since bX c  X , we have

their deadlines, if j X

Ci + B  1 8j = 1; : : : ; N D Dj i=1 i

(1)

(Di is the relative deadline of message Mi in each period Ti ; we assume Di  Ti ).

Proof. Assume the test is true but the set of messages

is not feasibly scheduled. Let t be the rst time a message misses its deadline. Let t0 be the last time before t such that there are no pending sending requests with arrival times before t0 and deadlines before or at t. By choice of t and t0 , there is no channel idle time in [t0 ; t]. Let M be the set of messages ready to be sent in [t0 ; t] and having deadlines before or at t. By choice of t0 , there are pending requests of messages in M at all times during the interval [t0 ; t]. Thus, according to the EDF priority assignment, the only messages that are allowed to be sent in the interval are those in M. These messages can only be preempted by other messages in M. If a message not in M is sent in [t0 ; t], its transmission must have started before t0 . By choice of t0 , this message must have a deadline higher than t, so it will be later preempted by the messages in M. Since each message can be blocked by another lower priority message only at the moment it is ready to be sent and for a maximum time interval B , in the worst case a message in M gets the channel at time t = t0 + B . In [t ; t] the channel is always used by messages in M. Let  = t0 ? t. By choice of t0 , Di   for every Mi in M. Since the messages are ordered by increasing value of Di , it follows that there exists an index j such that all messages in M are instances of messages in fM1 ; M2; : : : ; Mj g, and Dj  . For every Mi in M, the demand for channel time in [t0 ; t] is not larger than Ki  Ci , with 



Ki =  ?T Di + 1: i

Let Mhnot inM be the message (if it exists) whose transmission is started before t0 , and that continues to be sent at t0 . In [t0 ; t] there is no idle time and the only messages that are sent are Mh and those in M. Since there is an over ow, the total demand for channel time in [t0 ; t] exceeds , thus also

B+

j X i=1







 ? Di + 1 Ci > : T i





j B +X Ti ? Di Ci > 1:  i=1 1 +  Ti

As Di   for i = 1; : : : ; j , it follows 



j j X B +X T Ci B i ? Di Ci Dj i=1 1 + Di Ti = Dj + i=1 Di > 1:

This contradicts the hypothesis that the test (1) is veri ed. 2

2.1 The EDF/Token-Ring case

Let us brie y illustrate how the quantities just described can be determined for one of the mentioned EDF protocols, namely the EDF/Token-Ring protocol. The protocol is very close to the Token-Ring standard [2]. The network has a ring topology and a special frame, the token frame, circulates the ring. The station that gets the token is given the rights to transmit. The token has few bits representing the priority of the nodes that are willing to transmit. In our case the priority bits are 8 (allowing the representation of 256 priority levels), in contrast to the 3 bits reserved by the IEEE 802.5 standard. A station gets the token if the priority of its outgoing message is equal to the one represented by the priority bits of the token. Once the station gets the token, it appends the outgoing message frame behind it. The message frame contains a number of reservation bits that allow other nodes to signal the priority of newly arrived messages, thus reserving the next transmission phase. To apply the test (1) we need to de ne the variables Ci , the transmission time, and B , the worst case blocking factor. These variables can be evaluated by analysing the time properties of the EDF/Token-Ring protocol. We de ne:

      

Vp = signal propagation speed in the ring; Br = transmission bit-rate; L = channel physical length; N = number of stations connected to the ring; d = number of protocol bits in each frame; d = number of data bits in each frame; mi = size of message Mi .

Since each station produces one bit transmission delay, the highest propagation time for a bit in the ring is Wt = VLp + BNr . The time needed to send message Mi is m l Ttri = mdi Bd ; r

plus all protocol overheads associated to the message transmission. The protocol overheads can be divided in frame overheads and message (or token) overheads. The frame overheads are represented by the time needed to send the bits the protocol adds to each packet (the starting delimiter, the reservation bits, the destination and source address elds, the frame control sequence, the ending delimiter and the frame status), plus the time needed for the sending station to check the correct reception of its frame (by getting back the source address eld of its circulating frame). Let Ovt be the overall frame overhead, then

Ovt = Ov0 + Ov00 ; where Ov0 is the overhead caused by the protocol bits (Ov0 = Bd r ) and Ov00 is the waiting time that the sending station must spend to check the reception of its frames (Ov00 = maxf0; Wt ? d+Bdrar g, where dar are the protocol bits that follow the reservation eld). By adding the frame overheads, we can compute the overall time overhead for each message Mi : m l Ovi 1 = mdi Ovt :

We must now consider the message overhead caused by the token transmission. The token is not necessarily sent behind every frame, but it is transmitted whenever the current message ends or there is \preemption" on the ring, that is, another node puts a higher priority value in the reservation bits of the transmitted message. We can assign each message a token overhead on its rst frame assuming it preempts another lower priority message and another overhead when its transmission is over and the preempted message (or another one) gets back the ring. Since each message preempts and ends only once, we have considered all possible token overheads. The worst case bound on the the token overhead is then given by twice the token transmission time Wt , that is, 



N : O = 2Wt = 2 VLp + Br i v2

The token overhead includes the rotation time that is necessary to receive the last bit of a message.

At this point, we can evaluate Ci as the sum of the previous factors:

Ci = Ttri + Ovi 1 + Ovi 2    lm m  d L N i = d B + Ovt + 2 V p + Br : r To evaluate B , the maximum time a highest priority station must wait before beeing able to send a message, we consider the worst case as described by Strosnider and Marchok [9]. We found [8] that the value of B is given by twice the frame rotation time Tf r , frame overheads included, minus the time T  needed to send the frame bits that are prior to the reservation bits:

B = 2Tf r + 2Ovt ? T  : Once the values Ci and B are known, the schedulability of a given set of messages can be checked according to Theorem 2.1.

3 Priority Inversions Deadline Scheduling

with

Computer networks allow only a limited number of priority bits. The priority bits need to be transmitted in the contention phase to reach an agreement on the next message to be sent. The more the priority bits are, the more network bandwidth is subtracted from the transmission of actual data. In this section we analyse how this limitation modi es the schedulability bound previously shown.

3.1 Time scale with constant units

A natural way to compute the priorities of the messages from the value (d ? tSTART ) is to divide the temporal axis in equal size units. If U is the size of one unit, the value of the priority p is then 

p = d ? tUSTART



(lower values stand for higher priorities). The priority p computed in this way su ers from a quantization error: in the worst case there is an error equal to U . This granularity may cause priority inversions because the same value of p may be assigned to all messages having a deadline inside the same time unit. It may happen that a message M1 having an earlier deadline than M2 gets the same priority. At run time M1 should preempt M2 but it doesn't.

3.2 Evaluation of the time unit

With n priority bits, the number of available priority levels is 2n. Given the greatest relative deadline Dmax , a sensible choice for U would be1

U = D2max n :

(2)

That is, the approximation in computing the priority of each message instance depends on the maximum relative deadline and, as expected, on the number of available priority levels.

3.3 E ects of time granularity on the schedulability test

The unit U can be considered as the maximum approximation made in computing a message priority. We must evaluate the e ect that this lack of precision has on the schedulability test. Each time a priority for a message Mi is computed, the error can be as big as U . In other words, it is like if the deadline of the message were not Di , but Di ? Wi , where Wi is a positive value lower than or equal to U . This means that the relative deadline is not constant, but can be as low as Di ? U , depending on the approximation error made in its computation. Let us consider a set of periodic messages. If we guarantee the correct schedulability when each deadline can be randomly decreased by a quantity lower than or equal to U , then we are sure that each message will be scheduled within its real deadline Di . In fact, we will guarantee the worst case condition where the message deadlines are decreased by a quantity U on every period. Theorem 3.1 Given a set of N periodic messages, M1 ; M2 ; : : : ; MN with relative deadlines randomly assigned to the interval [Di ? U; Di ] at each occurrence, and ordered by increasing values of Di , they can be feasibly sent if

8j = 1; : : : ; N

j X

Ci

B  1: (3) + D ? U Dj ? U i=1 i

Proof. It is very similar to that of Theorem 2.1. Essentially, for each message we consider the new worst case when the relative deadline is Di ? U instead of Di , and we apply the same argument. The interested reader can nd the details in [8]. 2

1 Note that with the value assigned in equation (2), all messages with relative deadline Dmax should receive a priority p = 2n , which cannot be represented with n bits. In this case we assume a priority p = 2n ? 1, which is anyway whithin the approximation of one unit of time.

3.4 Quantization cost

Let us introduce a new parameter xi , which is de ned as xi = DU : (4) i

We will brie y see how xi is an additional penalty to the worst case network utilization bound introduced when computing the deadline with a quantization error U . Since U < Di for the test (3) to be meaningful, xi can only be lower than 1. The test (3) can be rewritten as

8j = 1; : : : ; N

j X

B + D (1 ? xi ) Dj (1 ? xj )  1: i=1 i Ci

If we take the maximum of the xi 's values, referred to as x, from the previous equation we have

8j = 1; : : : ; N

j X

Ci + B  1 ? x; D Dj i=1 i

(5)

in which we clearly see that the role played by x is the cost payed in terms of network utilization. >From equation (4) and equation (2) we have max : x = 2D nD min

(6)

Consequently, the test (5) depends on the variable n, the number of priority bits, and on the ratio between the largest and the smallest deadlines, which is a parameter characteristic of the type of load we have on the channel. This is the mathematical con rmation of our intuition: the less is the number of priority bits and/or the more is the range of the relative deadlines, the harder is to guarantee the feasibility of the messages schedule. If we apply equation (6) to a protocol whith 8 priority bits (n = 8), we have

Dmax : x = 256 D min

In a distributed control system, we must usually schedule a set of messages whose deadlines vary in a wide range. For example in a visual control system, control messages may have relative deadlines of a few milliseconds, while information messages can have relative deadlines even thousands of times higher. In this sort of environment an a-priori assignment that makes use of linear time units is certainly not acceptable. In fact, if we consider DDmax min > 256, we have x > 1. Since the test (5) requires x < 1, it is not possible to guarantee the schedulability of the set of messages on the channel.

4 A Solution with Limited Pri- 4.2 Limited quantization cost ority Inversion In the test (3) the variable U stands for the maximum In this section we show a new technique for computing message priorities, whose aim is to minimize the cost x of the limited granularity in the evaluation of the actual deadlines. In fact, we will prove that the technique is indeed e ective by showing that it reduces exponentially the cost x in terms of network utilization.

4.1 Temporal scale with exponential intervals The basic idea of our technique is to use a logarithmic scale, that is, a scale in which the unit is not constant, but varies exponentially. More speci cally, we divide the temporal axis in sections of exponentially increasing length, which are all further divided in a constant number of units. In this way we have a ner resolution for nearer deadlines, and a coarser resolution for further deadlines. This should prevent the occurrence of large priority inversions. The formal de nition follows. Let q be a variable that can only assume values such that q1 is integer. The temporal axis is divided in sections, each one containing a constant number of 1q temporal units. We will show that the maximum quantization cost in computing message priorities is x = q and we will see how x is tied to the number of priority bits, and to the rate DDmax min . Let U = D1min =q be the rst time unit. The rst time section is large Dmin and is divided in q1 units large U . Assuming tSTART = 0, the second time section is the interval [Dmin; 2Dmin), and is divided in 1q units of length U0 = U . More generally, the generic section [2hDmin; 2h+1 Dmin) gets divided by q1 time units of length Uh = 2h U . See Figure 1. When we compute the priority corresponding to (di ? tSTART ), we have to nd its correct place in the temporal axis. The computation is done in two steps. We rst evaluate ( j

h=

0

log2 di?DtSTART min

k

if di ? tSTART  Dmin otherwise

in order to nd the section where di \falls," and the priority p is then computed as 



? 2h Dmin : p = h 1q + di ? tSTART h 2U

approximation that can be made in computing the priority of message Mi (the test always considers the worst case). With the exponential intervals, the higher is the value of (di ? tSTART ), the larger is the time unit used to compute the priority. The largest granularity is assigned to the intervals where the highest values of (di ? tSTART ) fall. The maximum quantization error corresponds to the time unit of the temporal interval where Di falls. Assume that 2hi Dmin  Di < 2hi +1 Dmin: In this interval the time unit is 2hi U , so this must be the value to use for the schedulability test (3), which becomes:

8j = 1; : : : ; N

j X

Ci + B hi U D ? 2 D ? 2hj U  1: i j i=1

In Section 3.4 we de ned xi as the maximum quantization cost in computing the priority of Mi . When using temporal units varying in an exponential way, the value of xi is: hi x = 2 U:

Di

i

Similarly to what we have seen previously, the schedulability test (3) becomes

8j = 1; : : : ; N

j X

Ci

B + D (1 ? xi ) Dj (1 ? xj )  1: (7) i=1 i

Since Di  2hi Dmin, we have hi hi xi = 2DU  2h2i DU = DU = q: min i min It follows that for each message Mi , the quantization cost is lower than or equal to q. Consequently, the

test (7) can be rewritten as

8j = 1; : : : ; N

j X

Ci + B  1 ? q: D Dj i=1 i

Thus, the loss x in network bandwidth is equal to q. We can prove that this loss is an \exponential improvement" over the quantity found in equation (6). In fact, in Appendix A we show that under the same assumption of Section 3, the loss in the network utilization factor (from now on referred as bandwidth loss) is

1/q

1/q

1/q h 2 Dmin

Dmin

0

Dmin

2Dmin

h 2 Dmin

Tstart

h+1 2 Dmin

Figure 1: Distribution of the time units in the time axis. 1

x= 

2n



;

(8)

blog2 kmaxc+ 2blogk2max kmax c

where kmax = DDmax min . If we compare this value of x with the corresponding quantization cost incurred with constant units, we can easily realize that this is an exponential improvement, as previously claimed. For example, if we apply equation (8) to a protocol with n = 8 and a task set with kmax = 256, we obtain x = 281 ' 0:03571. Recall that with the same values we were not able to give any guarantee at all when using constant unit times, while with the exponential technique the loss in the overall network utilization is only 3.571%.

5 Conclusion In this paper we have analysed the e ects of a limited number of priority levels, when a dynamic algorithm is used to schedule a set of periodic messages on a shared communication channel. We have shown how the use of a limited number of priority bits produces priority inversions, and we have expressed the e ects of the priority inversion on the schedulability test in terms of loss in the allowed channel utilization. In particular, we have shown how the computation of priorities with constant time units makes more dicult to guarantee the schedulability of a set of messages. In order to avoid this problem, we have designed a new technique that uses a time scale with exponentially increasing units, and we have shown its e ectiveness by proving that it reduces the nasty e ects of priority inversion to a minimum.

References [1] Baker T.P., \Stack-Based Scheduling of Realtime Processes," The Journal of Real-Time Systems, 3, pp. 67-99, 1991.

[2] IEEE 802.5: Token Ring Access Method, IEEE, New York 1985. [3] Kopetz H. and Grunsteidl G., \TTP - A TimeTriggered Protocol for Real-Time Systems," Proc. of the 23rd Symposium on Fault-Tolerant Computing, Toulouse, June 1993. [4] Lehoczky J.P. and Sha L., \Performance of realTime Bus Scheduling Algorithms," ACM Performance Evaluation Review, 1986. [5] Le Lann G. and Rivierre N., \Real-time Communications over Broadcast Networks: the CSMADCR and the DOD/CSMA-CD Protocols," Rapport de recherche N.1863, March 1993, INRIA. [6] Liu C.L. and Layland J.W., \Scheduling algorithms for multiprogramming in a hard real-time environment," Journal of ACM, 20(1), pp. 40-61, January 1973. [7] Malcolm N. and Zhao W., \The Timed-Token Protocol for Real-Time Communications," IEEE Computer, January 1994. [8] Meschi A. \Progetto di protocolli di comunicazione in sistemi real-time," Thesys dissertation, Universita di Pisa, November 1995. [9] Strosnider J.K. and Marchok T.E., \Responsive, Deterministic IEEE 802.5 Token-Ring Scheduling," The Journal of Real-Time Systems, 1, pp. 133-158, 1989. [10] Tindell K.W., Hansson H. and Wellings A.J., \Analisying Real-Time Communications: Controller Area Network (CAN)," Proc. of the IEEE Real-Time Systems Symposium, 1994.

A Bandwidth Loss Evaluation In this appendix we express the bendwidth loss x, or q, which is equal to it, as a function of the number of

number of time units 1/x priority

1/x 1/x

0

h 2 /x

2/x

Dmin

2Dmin

n 2 Dmax

h 2 Dmin

Tstart

2

h+1 Dmin

y units

Figure 2: Maximum priority evaluation. priority bits n and the ratio kmax between the largest and the smallest relative deadlines. As previously addressed, with n priority bits we can only have 2n priority values, from 0 to 2n ? 1. If 2hmax Dmin  Dmax < 2hmax+1 Dmin, we have the situation depicted in Figure 2. Since every interval [2h Dmin; 2h+1Dmin) is divided in x1 units, including the rst one [0; Dmin), we have (see Figure 2)2 2n = 1 + h 1 + y = (h + 1) 1 + y; (9)

x

max x

max

1

x

We can nd a relationship among kmax (the ratio between Dmax and Dmin), n and x, with the following algebraic transformations: Dmax = 2hmax Dmin + (Dmax ? 2hmax Dmin) = 2hmax Dmin + y2hmax U  = 2hmax Dmin + 2n ? (hmax + 1) x1 2hmax U; since in the interval [2hmax Dmin; 2hmax+1 Dmin) the time unit is 2hmax U and y can be replaced with the value obtained from equation (9). Substituting U = D1min =x , we obtain

Dmax = 2hmax Dmin + 2n 2

max hmax n kmax = D D = 2 (2 x ? hmax ) ; min

which, replacing hmax with the value obtained in equation (10), gives us the relation we were looking for:

kmax = 2b2n xc?1 (1 + 2n x ? b2nxc) :

hmax

Dmin

1

x

?(hmax + 1)2hmax Dmin = 2hmax Dmin (1 + 2n x ? (hmax + 1)) = 2hmax Dmin (2n x ? hmax ) :

2 We make the same assumption as in Section 3.2.

(11)

The solution of the equation

x

where the rst addendum x1 is the number of units in the rst interval [0; Dmin), and the term y is the number of units taken in the last interval [2hmax Dmin; 2hmax+1 Dmin) to represent Dmax . Since y < x1 we have  n (10) h +1= 2 : max

Consequently

w = 2bzc?1 (1 + z ? bz c) is

z = blog2 wc + 2blogw2 wc :

Hence, the solution of equation (11) is

blog2 kmax c + 2blogk2max kmax c

: 2n This value might not be suitable for our needs, since we have the further constraint that x1 (actually 1q ) must be integer. For this reason the actual value of x must be 1 : x=  x=

2n

blog2 kmaxc+ 2blogk2max kmax c

Suggest Documents