A fast algorithni for division by constant divisors is presented. The method has proved very useful implemented as microcode on a binary machine, and can be adapted directly into hardware. The mathematical foundations of the algorithni are presented as well as some performance measures.
A simple scheme for the determination of the location of a block of storage relative to other blocks is described. This scheme is applieahle to the buddy type storage allocation systems.Two storage allocation schemes that have been presented by Knowlton [1] and Hirschberg [2] are similar in many basic features, and both are referred to as buddy systems. The purpose of both these methods is to keep track of a large memory pool used to satisfy storage requests.These two systems have the following basic actions in common:Step A. To satisfy a storage request:1. The smallest block of storage that is at least as big as the request is selected as the candidate block. 2. The candidate is checked for size and, if large enough, is split into two smaller blocks (buddies); otherwise the candidate block is returned as the block satisfying the request and the algorithm terminates. 3. One of the buddies (the smaller of the two, if possible) is selected as the new candidate and the other is inserted into the free storage pool. The algorithm then proceeds from Step A. 2.Step B. To return a block to the storage pool:1. The buddy of the newly returned block is located. 2. The buddy is inspected to see that it is whole (not split into subbuddies) and free (not allocated). If both conditions are met, then the buddy is removed from free storage and merged with the newly returned block to create a larger block. This larger block is then taken as the newly returned block and execution proceeds with Step B.1.3. If it is impossible to merge, then the newly returned block is returned to the free storage area and the algorithm terminates.In both of these schemes it is important to notice that the merges exactly correspond to the splits. For example, if a block at storage location 30 of length 10 is split into buddies starting at 30 and 36 with lengths 6 and 4 respectively, the corresponding merge must be done using exactly these two blocks. In this case it is impossible to merge the block at 30 with length 6 with any other block except that block starting at location 36 and only when that block has a length of 4. This means that sufficient information must be carried in each block to indicate the relative location of the proper buddy.In Knowlton's original buddy system the blocks had lengths of powers of two, and so the addresses of the blocks were an encoding of the relative locations of the blocks. Hirschberg's system used blocks whose length were elements of the familiar Fibonacci series. To locate the buddy of a block, an auxiliary list was consulted that gave the possible starting locations of blocks. Both of the techniques used are special purpose and break down for other sequences of block sizes.Knowlton allowed block sizes SIZEa = SIZEa-1 -}-SlZEn-1 ; SIZE0 = 1. Hirschberg allowed blocks of sizes SIZEa = SIZEr~_I -q-SIZEa_2 ; SIZE0 = 3, SIZEx = 5. This paper describes a very simple and efficient technique for locating buddies that allows sizes to be elements of an arbitrary (but fixed) generalized Fibonacci sequence. These are sequ...
scite is a Brooklyn-based organization that helps researchers better discover and understand research articles through Smart Citations–citations that display the context of the citation and describe whether the article provides supporting or contrasting evidence. scite is used by students and researchers from around the world and is funded in part by the National Science Foundation and the National Institute on Drug Abuse of the National Institutes of Health.
customersupport@researchsolutions.com
10624 S. Eastern Ave., Ste. A-614
Henderson, NV 89052, USA
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.
Copyright © 2025 scite LLC. All rights reserved.
Made with 💙 for researchers
Part of the Research Solutions Family.