Thats easy, just integer divide the decimal number by 16 and put the
remainder in the first column.  Keep dividing by 16 and placing the
remainder in the next column moving right to left until you have a
number less than 16 and place it in the left-most column.

For example:  873 = 0x369
  873/16=54, r9
   54/16= 3, r6
    3/16= 0, r3

HTH,
Prof. Tom Lisa, CCAI
Community College of Southern Nevada
Cisco ATC/Regional Networking Academy

Persio Pucci wrote:

> Nice going, Ole!
>
> Now, how about an easy way to convert decimal to hex without going through
> binary (the way I learned)? :)
>
> Persio
>
> ----- Original Message -----
> From: "Ole Drews Jensen"
> To:
> Sent: Thursday, March 14, 2002 12:07 PM
> Subject: RE: Hex to Decimal for the RD [7:38223]
>
> > Hex is based on 16, where Dec is based on 10.
> >
> > When you see a value, no matter if it's in dec, hex, bin, or something
> else,
> > think of each number as being number 0 (the right one), 1, 2, 3, and so
> on.
> >
> > If you for instance have the decimal value 579:
> >
> > Number 0 would be 9
> > Number 1 would be 7
> > Number 2 would be 5
> >
> > When you have decimal, the system is based on 10, so you will have to use
> 10
> > to calculate your way to a result.
> >
> > The number 579 can be calculated this way:
> >
> >    9 * 10^0 =   9
> > +
> >    7 * 10^1 =  70
> > +
> >    5 * 10^2 = 500
> > =
> >    Result = 579
> >
> > This seems pretty silly to calculate a value like that, but that's
because
> > we're used to see the value in a 10-based format.
> >
> > Okay, let's take your first 16-based (hex) value - F00.
> >
> > Again, from right to left:
> >
> > Number 0 is 0
> > Number 1 is 0
> > Number 2 is F (15 in decimal)
> >
> > Instead of using the number 10 to calculate, you will need to use the
> number
> > 16 to calculate:
> >
> > The value F00 in hex can be calculated this way:
> >
> >    0 * 16^0 =    0
> > +
> >    0 * 16^1 =    0
> > +
> >    F * 16^2 = 3840
> > =
> >    Result = 3840
> >
> > You can with hex make words if that helps you remember the value, as long
> as
> > you do not use letters above F.
> >
> > For instance, the value ABBA would be a good one to use for a Swedish
> > Ericsson Server (if they exist), and the value would be calculated like
> > this:
> >
> >    A * 16^0 =    10
> > +
> >    B * 16^1 =   176
> > +
> >    B * 16^2 =  2816
> > +
> >    A * 16^3 = 40960
> > =
> >    Result = 43962
> >
> > If this is still a little confusing, the let's continue with your second
> > value, and break it up a little more:
> >
> > 2F2
> >
> > First number is 2 (2 decimal) which must be multiplied by 16^0 (1).
> >
> > The result is 2.
> >
> > Second number is F (15 decimal) which must be multiplied by 16^1 (16).
> >
> > The result is 240.
> >
> > The third number is 2 (2 decimal) which must be multiplied by 16^2 (256).
> >
> > The result is 512.
> >
> > The final result will therefore give us 2+240+512 = 754 decimal.
> >
> > Conversions between all systems other than decimal is much easier,
because
> > they are based on what I call double up. If you start with binary. Binary
> is
> > based on 2. When you double up, you will get 4. Next time you will get 8.
> 8
> > is the number that Octal is based on, but that's not used much anymore.
> Next
> > time you will get 16. 16 is the number that Hex is based on.
> >
> > Now, you can see that going from hex to binary will be easier. Hex
numbers
> > goes from 0 to 15, and binary goes from 0 to 1. So that means that four
> > binary numbers matches one hex number.
> >
> > An example:
> >
> > The hex number F00 again. If you take each number and convert it to
> binary,
> > it is much easier.
> >
> > 0 = 0000
> > 0 = 0000
> > F = 1111
> >
> > Result = 1111 0000 0000
> >
> > You can now convert the binary number to octal, which is based on three
> > binary numbers instead of four.
> >
> > First, put spaces in between every third to make it easier:
> >
> > 111 100 000 000
> >
> > You can see that it is the same binary number as above, but it looks
> > different now.
> >
> > Now convert to Octal:
> >
> > 000 = 0
> > 000 = 0
> > 100 = 4
> > 111 = 7
> >
> > Octal result = 7400
> >
> > Some people prefer to use binary when converting from hex to decimal.
> >
> > Again, let's take the F00.
> >
> > >From Hex to Bin:
> >
> > F 0 0 = 1111 0000 0000
> >
> > Let's split the binary numbers up:
> >
> > 0 * 2^0 (1) = 0
> > 0 * 2^1 (2) = 0
> > 0 * 2^2 (4) = 0
> > 0 * 2^3 (8) = 0
> > 0 * 2^4 (16) = 0
> > 0 * 2^5 (32) = 0
> > 0 * 2^6 (64) = 0
> > 0 * 2^7 (128) = 0
> > 1 * 2^8 (256) = 256
> > 1 * 2^9 (512) = 512
> > 1 * 2^10 (1024) = 1024
> > 1 * 2^11 (2048) = 2048
> >
> > RESULT = 3840
> >
> >
> > If you look at the first calculation we did in the beginning, you can see
> > that I came to the same result.
> >
> > Hth,
> >
> > Ole
> >
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >  Ole Drews Jensen
> >  Systems Network Manager
> >  CCNP, MCSE, MCP+I
> >  RWR Enterprises, Inc.
> >  [EMAIL PROTECTED]
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >  http://www.RouterChief.com
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >  NEED A JOB ???
> >  http://www.oledrews.com/job
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >
> >
> >
> >
> >
> > -----Original Message-----
> > From: Mckenzie Bill [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, March 14, 2002 8:02 AM
> > To: [EMAIL PROTECTED]
> > Subject: Hex to Decimal for the RD [7:38223]
> >
> >
> > Could someone help me get a clear understanding of converting the hex
> number
> > to a nice decimal ring number or bridge number.
> >
> > Two examples that have me stumped are:
> >
> > F00 and 2f2.
> >
> > Thanks Everyone in advance.




Message Posted at:
http://www.groupstudy.com/form/read.php?f=7&i=38279&t=38223
--------------------------------------------------
FAQ, list archives, and subscription info: http://www.groupstudy.com/list/cisco.html
Report misconduct and Nondisclosure violations to [EMAIL PROTECTED]

Reply via email to