RIP #02
29 ноября 1997 |
|
School Hacker - Cycle BASE -1 ": Ukraschenie Dragon Attack Dragon.
BASE-1 The first seminar. Base. (Continued from in RIP # 1) All rights training materials Hekerskoy Schools belong Arvi Hacker (Ilya Vasilyev), Moscow, 2:5020 / 287 @ fidonet, arvi@hsys.msk.ru, ath@verte.dnntm.rssi.ru. If you use any part of this material for any purpose obligatory link to the source. In the case of commercial use or for teaching more than one Rights required a preliminary agreement with the author. This material was originally intended for students and students, pupils Hekerskoy School. B1: 3 Taming the Dragon. ======================= Translation algorithm from any system to decimal we call algorithm Taming the Dragon: X_n-> Y_10. Called because long line computation resembles a dragon's back lying and Reply - dragon's head resigned. It is based on the observation that: 34947 = 30000 +4000 +900 +40 +7 = 3 * 10 ^ 4 + 4 * 10 ^ 3 + 9 * 10 ^ 2 + 4 * 10 +7 That is, the number is the sum of its digits multiplied by appropriate to the ground. Transfers of numbers and 1210_3 C00L_22: 1210_3 = 1 * 3 ^ 3 + 2 * 3 ^ 2 + 1 * 3 + 0 = 27 + 18 + 3 = 48_10 C00L_22 = 12 * 22 ^ 3 + 0 * 22 ^ 2 + 0 * 22 + 21 = 127776 + 21 = 127797 Many of the books that version of the algorithm Taming the Dragon used to determine what the number system. Try poperevodit larger numbers of the different systems notation. Preferably without using a calculator, performing all arithmetic operations in the mind or on a leaflet. Larger binary numbers - they give us more useful! >>> Applying Horner's scheme (B1: 1) we get a lot more efficient version of the algorithm Taming the Dragon. 1210_3 = ((1 * 3 +2) * 3 +1) * 3 +0 = 16 * 3 = 48 C00L_22 = (((12 * 22 +0) * 22 +0) * 22 21 = 127 776 + 21 = 127797 What is its efficiency? Now you do not need surgery exponentiation! When programming in assembly language is just shine! Even high-level language translation software obtained much faster and shorter. Try to make This program takes the number from any number system to you familiar decimal language. It almost duplicates the program for Horner scheme. Hacker to be constantly on alert - who knows where he will demonstrate the art. Quite it is possible that you will be asked to repair or remove the virus from computer at a strange place-in the supermarket or at home your girl. (In the movie "War Games" a young hacker, David, Accidentally connecting the recorder to a combination lock, able to record and repeat signals open the door and escape from under arrest.) If the hand is only a primitive calculator, with only four arithmetical operations (such as let into hours), then by the traditional method you have somewhere to write, and then type intermediate results. The new method you only need to dial numbers between the multiplication sign, radix and the sign of addition. If the hand was not even a primitive calculator, the new algorithm can Taming the Dragon used to transfer the number of bars. The result of one example is the initial value for the next. January 1912 * 3 * 22 --- --- March 1924 24 +2 --- --- 5 264 * 3 +0 Of course, the zeros I add here only for training, --- ---- In real life do not necessarily. :-) 15 264 +1 * 22 --- --- 16 528 * 3528 --- --- 18 5808 3 +0 --- --- 48 5808 +0 * 22 --- --- 48 11616 11616 ----- 127776 +21 ----- 127797 Here we have tamed the Dragon set vertically, muzzle down. Perhaps to be more fit ... <<< B1: 4 Attack of the Dragon. =================== The opposite effect, a transfer from the decimal number system in arbitrary, we call Dragon Attack: Y_10-> X_n. This action usually occurs when we want to enter information into the computer. We live in a decimal world, and the computer - in some hex. And in order to enter something to us in his world, the "attack", we have to translate it's a foreign number system. You've got to be able to share. :-) Translate the numbers obtained by Taming the Dragon back to the native number system successively dividing them into the ground, until a number smaller than the base. This number is a column not sharing. :-) 48 | 3 127 797 | 22 -3 -110 +-----+ +------+ - | 16 | 3 --- | 5,808 | 22 18 -15 177 -44 +----+ +------+ -18 - | 5 | 3 -176 - | 264 | 22 - 1 -3 140 -22 +---- --- + --- 0 - | 1 197 -132 - | 12 = C 2 -176 --- 44 --- 88 -44 21 = L -88 - - 0 0 The result is read from the last private and balances collected in reverse order. So in the first case 1210_3, while the second - C00L_22. Try to translate the numbers, resulting in self- The Taming of the practice, back to their original number system. Try a few decimal numbers translate into any strange number system and vice versa. >>> If you know a good share in the mind (or use calculator), it is more convenient to use a different account: 48 | 0 127797 | 21 = L 16 | January 5808 | 0 5 | 2264 | 0 1 | 12 = C Here, for each division remainder is written to the right of features, and private-bottom. As always, the attack response is read in reverse order, from bottom to top. Create a program that performs automatic translation any number system. <<< (To be continued ...)
Other articles:
Similar articles:
В этот день... 21 November