Book:
Give the decimal value of each of the following integer constants.
a) 077
I'm assuming this 077 number is in Octal form because it uses only digits 0 and 7, and Octal requires 0-7 as well.
The book doesn't explain how to convert, but it does show an example.
Example:
Octal 237
Decimal Number: 2 x 8(2) + 3 x 8(1) + 7 x 8(0) = 128 + 24 + 7 = 159
I can see a pattern in the example we're using the numbers 237 and multiplying each by Octal 8, but then 8 has a power, I don't know how to determine what power to use??
My number of 077 would be something like:
0 x 8(?) + 7 x 8(0) + 7 x 8(0)= I put 0's because I don't know how to determine what power to use. Do we always use powers 2-1-0??
Then it would be 64 + 56 + 0 = 120, is that correct? I'm just guessing here based on the pattern in the books example.
I looked on the web and found another example that I don't understand.
Example: (makes no sense to me) they don't explain in words how to solve this.
octal8 -> decimal
258 -> decimal
81 80
8 1
2 5
16+5 = 21
158 -> 21
Give the decimal value of each of the following integer constants.
a) 077
I'm assuming this 077 number is in Octal form because it uses only digits 0 and 7, and Octal requires 0-7 as well.
The book doesn't explain how to convert, but it does show an example.
Example:
Octal 237
Decimal Number: 2 x 8(2) + 3 x 8(1) + 7 x 8(0) = 128 + 24 + 7 = 159
I can see a pattern in the example we're using the numbers 237 and multiplying each by Octal 8, but then 8 has a power, I don't know how to determine what power to use??
My number of 077 would be something like:
0 x 8(?) + 7 x 8(0) + 7 x 8(0)= I put 0's because I don't know how to determine what power to use. Do we always use powers 2-1-0??
Then it would be 64 + 56 + 0 = 120, is that correct? I'm just guessing here based on the pattern in the books example.
I looked on the web and found another example that I don't understand.
Example: (makes no sense to me) they don't explain in words how to solve this.
octal8 -> decimal
258 -> decimal
81 80
8 1
2 5
16+5 = 21
158 -> 21