I’m really sorry to have to ask this question…
I know I should have learned the base16 numbering system a lil’ earlier..

I thought that Hex used 0-9, A-F. But I’ve seen hex values like 9h?

Again- I feel really stupid for having to ask ;-)

2. 9h probably means 09 in hex (h denotes hex) so

09 hex 09h and 0x09 are all references to hex...

/nebulus

EDIT: Note this is necessary because 09 could be 09 in decimal (or a bunch of other bases). Wouldn't really matter 09 hex = 09 dec, but if the first digit wasn't a 0...then we would have some differences...

3. ok, here this should put your mind at ease. from a RAMA walkthrough, a game that is hard to beat

A Primer on Arithmetic in Bases Other Than 10
The ordinary arithmetic problems we're used to seeing are all based on decimal (or base-10) numbers, but systems using a base other than 10 are possible. In all systems, the position of a digit in a number determines the value it contributes; for example, the base-10 number 2347 represents an implied addition problem:

2347 (10) = 2 x 1000

+ 3 x 100

+ 4 x 10

+ 7 x 1

Here we've included "(10)" after the number to emphasize that base 10 is being used. Note that the value multiplied by each digit increases by a factor of 10 as you move each position to the left, with the rightmost digit always representing ones. This use of the base to distinguish the role of each digit in a number is the key to understanding arithmetic in all bases. For example, the same sequence of digits in base 8 (octal) would translate to

2347 (8) = 2 x 512

+ 3 x 64

+ 4 x 8

+ 7 x 1

= 1255 (10)

Again, note that the value multiplied by each digit increases by a factor of 8 (the base) as you move each position to the left. These multipliers are referred to as powers of the base; for example,

Base 10Base 8

10 = 10 8 = 8

100 = 10 x 10 64 = 8 x 8

1000 = 10 x 10 x 10512 = 8 x 8 x 8

etc.

As seen in the conversion above, it's fairly easy to translate a non-decimal number into base 10, but the opposite conversion is a bit trickier. The procedure can best be illustrated by means of a specific problem, for example converting the decimal number 1255 (10) into base 8.

First, we begin by finding the largest power of the base present in the starting number. Since 8 x 8 x 8 x 8 = 4096 (10) is larger than 1255 (10), we next try 8 x 8 x 8 = 512 (10), which does factor at least once into 1255 (10):

1255 = 2 x 512 + remainder

In fact, 2 multiples of 512 (10) can be found in 1255 (10) - this 2 then becomes the first digit in our base-8 equivalent.

To find the next base-8 digit, start by removing the effect of the first digit, which changes the starting number from 1255 (10) to 231 (10):

1255 - 2 x 512 = 231

The procedure is repeated with the new starting number and the next smaller power of 8 to come up with the second base-8 digit:

231 = 3 x 64 + remainder

Continuing the process eventually results in the definition of all base-8 digits:

1255 (10) = 2 x 512

+ 3 x 64

+ 4 x 8

+ 7 x 1

= 2347 (8)

Any single digit in a number can never be as large as the base - the maximum digit in a decimal number is 9, and the maximum in a base-8 number is 7. For bases larger than 10, we must introduce other symbols for values above 9 - letters are usually the convention. In base 16 (hexadecimal), we have the possible digits

0 1 2 3 4 5 6 7 8 9 A B C D E F

For example, C (16) is equivalent to 12 (10).

Unless you have a translating calculator or other aid, it's usually easiest to solve complex arithmetic problems in non-decimal bases by first converting all numbers to base 10, performing the arithmetic, then converting the answer back to the desired base. For simple addition problems, an analog of the decimal columnar method may be used; for example in base 8,

1 <--- carry digit 5 3 + 2 7 1 0 2
Here are some examples of arithmetic problems in various bases:

Base 3Decimal Equivalent

1 + 2 = 101 + 2 = 3

10 - 1 = 23 - 1 = 2

21 + 12 = 1107 + 5 = 12

21 - 12 = 27 - 5 = 2

1201 - 111 = 12046 - 13 = 33

Base 8Decimal Equivalent

2 + 4 = 62 + 4 = 6

7 - 2 = 57 - 2 = 5

53 + 27 = 10243 + 23 = 66

52 - 41 = 1142 - 33 = 9

13053 + 17345 = 324205675 + 7909 = 13584

Base 16Decimal Equivalent

A + 4 = E10 + 4 = 14

D - B = 213 - 11 = 2

24 + 12 = 3636 + 18 = 54

FF - AA = 55255 - 170 = 85

1F40 + 5A8F = 79CF8000 + 23183 = 31183

4. yes, nebulus200 - that clears things up.
thank you very much...

::embarrassed::

:-)

5. yes, nebulus2000 is correct its only impling hex
ex: 0x09h(were h stands for hex)
ex: 09b(were b stands for binary)
ex: 09o(were o stands for octal)

Tampa, don't fill embarrased we all can't know everything.

oops! your're right hex only goes thru 0-9, A-F.

6. ex: 09b(were b stands for binary)
LOL, phaza7, when did you last see a binary number with 9 in it?? Sorry, I just had to point this one out.
Cheers,
cgkanchi

7. Neat Lil' Chart for BIN <-> HEX - I got it from "Art of Assembly" online tutorial- btw- mathgirl32 sent me the link (Cool...)
| http://www.it.uom.gr/project/assembly/contents.htm
| http://cs.smith.edu/~thiebaut/ArtOfA.../artofasm.html

_0000___ 0
_0001___ 1
_0010___ 2
_0011___ 3
_0100___ 4
_0101___ 5
_0110___ 6
_0111___ 7
_1000___ 8
_1001___ 9
_1010___ A
_1011___ B
_1100___ C
_1101___ D
_1110___ E
_1111___ F

To convert a hexadecimal number into a binary number, simply substitute the corresponding four bits for each hexadecimal digit in the number. For example, to convert 0ABCDh into a binary value, simply convert each hexadecimal digit according to the table above:

0 A B C D Hexadecimal

0000 1010 1011 1100 1101 Binary

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•