Bottom of This Page |
Although this was once a popular number base, especially in the Digital Equipment Corporation PDP/8 and other old computer systems, it is rarely used today. The Octal system is based on the binary system with a 3-bit boundary. The Octal Number System:
The weighted values for each position is as follows:
8^5 | 8^4 | 8^3 | 8^2 | 8^1 | 8^0 |
32768 | 4096 | 512 | 64 | 8 | 1 |
It is easy to convert from an integer binary number to octal. This is accomplished by:
For example, the binary value 1010111110110010 will be written:
001 | 010 | 111 | 110 | 110 | 010 |
1 | 2 | 7 | 6 | 6 | 2 |
It is also easy to convert from an integer octal number to binary. This is accomplished by:
For example, the octal value 127662 will be written:
1 | 2 | 7 | 6 | 6 | 2 |
001 | 010 | 111 | 110 | 110 | 010 |
This yields the binary number 001010111110110010 or 00 1010 1111 1011 0010 in our more readable format.
To convert from Octal to Decimal, multiply the value in each position by its Octal weight and add each value. Using the value from the previous example, 127662Q, we would expect to obtain the decimal value 44978.
1*8^5 | 2*8^4 | 7*8^3 | 6*8^2 | 6*8^1 | 2*8^0 |
1*32768 | 2*4096 | 7*512 | 6*64 | 6*8 | 2*1 |
32768 | 8192 | 3584 | 384 | 48 | 2 |
32768 + 8192 + 3584 + 384 + 48 + 2 = 44978
To convert decimal to octal is slightly more difficult. The typical method to convert from decimal to octal is repeated division by 8. While we may also use repeated subtraction by the weighted position value, it is more difficult for large decimal numbers.
For this method, divide the decimal number by 8, and write the remainder on the side as the least significant digit. This process is continued by dividing he quotient by 8 and writing the remainder until the quotient is 0. When performing the division, the remainders which will represent the octal equivalent of the decimal number are written beginning at the least significant digit (right) and each new digit is written to the next more significant digit (the left) of the previous digit. Consider the number 44978.
Division | Quotient | Remainder | Octal Number |
44978 / 8 | 5622 | 2 | 2 |
5622 / 8 | 702 | 6 | 62 |
702 / 8 | 87 | 6 | 662 |
87 / 8 | 10 | 7 | 7662 |
10 / 8 | 1 | 2 | 27662 |
1 / 8 | 0 | 1 | 127662 |
As you can see, we are back with the original number. That is what we should expect.
A logarithm is used when working with exponentiation. We all learned
that the formula X = YZ
Y
and multiply it by itself the number of times
specified by Z
. For example,
23 = 8
2*2*2
).Z
is the exponential value of the equation. As
long as you know what the Y
and Z
values
are in the equation, it is easy to calculate the value of
X
. /
En logaritme bruges, når der udregnes med eksponent. Vi lærte
alle, at formlen X = YZ
Y
og multiplicer (gang) den med sig selv
antallet af gange angivet af Z
. For eksempel,
23 = 8
2*2*2
).Z
er eksponentiel-værdien i ligningen.
Så længe man kender, hvad Y
og Z
værdierne er i ligningen, er det nemt at beregne værdien af
X
.
Unfortunately, you may not always know the value of Y
and
Z
. How do you determine Z
if you know the value
of X
and Y
? This is when you use a logarithm. A
logarithm is the exponent value that indicates the number of times the
value Y
needs to be multiplied by itself to get the value
X
. The value that is multiplied Y
)Y
og
Z
. Hvordan bestemmer man Z
, hvis man kender
værdien af X
og Y
? Det er da, man bruger
en logaritme. En logaritme er eksponent-værdien, som angiver
antallet af gange værdien Y
behøver at blive
multipliceret (ganget) med sig selv for at få værdien
X
. Værdien som er multipliceret (ganget)
Y
)
There are two basic types of logarithms: common and natural.
A common logarithm uses a value 10 as the base value. Therefore,
in the basic formula for exponentiation above,
X = YZ
,Y
is 10, and Z
is the number of
times that Y
needs to be multiplied by itself
to return the value indicated by X
. /
Der er to grundlæggende typer af logaritmer:
sædvanlig og naturlig. En sædvanlig logaritme
bruger en værdi 10 som grundtal. Derfor i den
grundlæggende eksponent-formel ovenfor,
X = YZ
,Y
10, og Z
er antallet af gange
som Y
behøver at blive multipliceret
(ganget) med sig selv for at returnere værdien angivet
af X
.
Natural logarithms use a base value of approximately
2.71828182845905, normally referred to as e
.
The mathematical notation e
is Euler's
constant, the base of natural algorithms, made
common by the mathematician Leonhard Euler
(Basel, Switzerland April 15, 1707 -
Russia September 18, 1783).
VBScript provides two functions for working with
logarithms: Exp()
Log()
.e
. The
Log()
Exp()
e
. The
similar methods in JavaScript is called:
Math.exp()
Math.log()
.e
. Den matematiske notation e
er Eulers konstant, de naturlige algoritmers grundtal, gjort
alminding af matematikeren Leonhard Euler
(Basel, Schweiz 15. april 1707 -
Rusland 18. september 1783).
VBScript har to funktioner til udregninger med
logaritmer: Exp()
Log()
.e
.
Log()
Exp()
e
. De lignende
metoder i JavaScript kaldes: Math.exp()
Math.log()
.
It is possible to use these VBScript functions or JavaScript
methods if you have a different base value by using a simple
formula. By dividing the natural log of the desired number
X
)Y
),Z
)Z = Log(X) / Log(Y)
Z = ((Math.log(X)) / (Math.log(Y)));
.X
)Y
),Z
)Z = Log(X) / Log(Y)
Z = ((Math.log(X)) / (Math.log(Y)));
.
The custom function Pow2(NumDbl)
Log2(NumDbl)
Math.pow()
Math.log()
Pow2(NumDbl)
Log2(NumDbl)
Math.pow()
Math.log()
You can see the JavaScript by using View Source. / Man kan se JavaScript'et ved at bruge Vis Kilde.
Sources: Various books, the Internet, and various encyclopedias.
Kilder: Forskellige bøger, internettet og forskellige leksikoner.
|