Jump to content

question?


playdo

Recommended Posts

instead of with decimal numers each col is the value in the col * value of the col so:

 

ABC

 

(where ABC are all digits)

 

Would be C*1 + B*10+ A*100, you could write this as: C*10^0+B*10^1+A*10^2.

 

Now if this number was a hex number it'd be:

 

C*16^0+B*16^1+A*16^2

 

You just need to work out the number which has to go into each coloumn when swapping between the two.

 

This is not a perfect way of describing it but it's better than nothing...

Link to comment
Share on other sites

im still quite confused

 

Base 16 (Hexadecimal) Numbering system

 

Digits used are the Indian/Arabic numbers 0 thru 9 and the English letters A thru F. A represents 10, B represents 11, C - 12, D - 13, E - 14 and F - 15. Each number occupies a place value. When F is reached, the value goes to 0 and 1 is added to the next place value.

 

0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F,10,11,12,13,14,15,16,17,18,19,1A,1B,1C,1D,1E,1F,20,etc

 

Each place value to the left is equal to 16 times the place value to the right which implies that each place value to the right is equal to the place value to the left divided by 16.

 

continuing infinitely <- 65536,4096,256,16,1

 

Hexadecimal is used to represent binary data. Its use applies primarily to the representation of letters and numbers as they are stored in computers. One hex digit represents 4 binary digits. Thus using hex it is possible to represent groups of binary digits (bits) using the numbers 0 thru 9.and the letters A thru F. Octal also represents binray data, but octal represents 3 binary digits. It uses the numbers 0 thru 7 with no letters needed.

^^^^^^^^^^^^^^^^^^^^^^^^^^^^

your description and his don't sound anything alike

Link to comment
Share on other sites

try counting in hexadecimal

one, two,... nine, A,... F, ten, eleven...

 

the formula is very simple when you actually see what's going on.

 

1AF5

= 5 x 16^0 + 15 x 16^1 + 10 * 16^2 + 1 * 16^3

= 6901

 

do it as if you were converting base ten to base ten. (not productive at all but you get the idea)

 

say you have the base ten number: 2587

break it up. 2, 5, 8, 7

multiply the 7 by it's position (ones column) [math]7*10^0[/math]

then do that with all the others then add them together. so you end up with

[math]2*10^3 + 5*10^2 + 8*10^1 + 7*10^0[/math]

which simplifies down to:

[math]2000 + 500 + 80 + 7[/math]

replace the tens with sixteens and you can convert base 16 to base 10

Link to comment
Share on other sites

im confused about what exactly your trying to figure out. this in particular has me wondering: "doesa this mean u can only create letters a-f with this code?"

 

only 1-9 and a- f are used in the code, but using ascii you can represent any number of things with it.

 

in response to some of my fellows who are trying to help, maybe start him out on something smaller than a 4 digit hex number? figuring out 16 cubed, while trying to understand the whole concept, is probably just going to be more confusing. i understand how it works, but looking at the break down of a 4 digit number confuses me too.

nothing about "5 x 16^0 + 15 x 16^1 + 10 * 16^2 + 1 * 16^3" is easy to read.

 

try taking it one digit at a time

 

F= 15

F0= 15x16 + 0

F00= 15x16^2 + 0 + 0

Link to comment
Share on other sites

the difference between a hex number and a decimal number (as far as converting them is concerned) is what the value of each column is.

in decimal it goes like this:

 

1000s|100s|10s|1s

each one being a higher power of the base number. 10^3 10^2 10^1 and 10^0

 

in hex its:

 

4096s|256s|16s|1s

each one being a higher power of 16. 16^3 16^2 16^1 and 16^0

 

take F3A

 

the three columns are not 1s, 10s, and 100s. they are 1s, 16s, 256s.

 

so F (which represents 15) in the 3rd column means 15x16^2. which is 15x256, or 3840

 

3 in the second column means 3x16^1. which is just 3x16. or 48

 

A (10) in the first column is 10x16^0. which is 10x1. or just 10

 

to get the number in decimal you add those three together.

 

10+48+3840 to get 3898.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.