Search This Blog

Thursday, October 20, 2005

Port D3D in Windows - Decimal to Binary to Hex...

Ok, I usually say port D3D when I talk about Windows Terminal Services. This often gets me into discussions about hex conversions, again.... :) The reason I use D3D is because I think it's easier to remember than the actual port number, and yes I'm talking about RDP and port 3389 if you don't want to read it all ;)

So how did 3389 become D3D?

-- 1. Convert the decimal number 3389 into binary, 3389 = 110100111101 in binary.

-- 2. Convert the binary number into hex, 110100111101 = D3D in hex.

If you want me to break it down in detail, this is how I did:

-- 1. Created a table in order to convert 3389 into binary:

2048-1024-512-256-128-64-32-16-8-4-2-1
1-1-0-1-0-0-1-1-1-1-0-1

This is the same as 2048+1024+256+32+16+8+4+1 which gives us 3389.

-- 2. I then took 110100111101 and broke it down into three clusters:
1101 – 0011 – 1101 which is equal to 13 - 3 - 13 in decimal.

-- 3. Then I convert each cluster into hex:
13 = D, 3 = 3, 13 = D which gives us D3D!

Isn’t math beautiful! :)

1 comment:

Nikki said...

Jimmy,
Hi my name is Nikki and I was looking on the internet for how to convert Hex AD to a 8 bit binary number and I found your blog. Can you help me?

Thanks! Nikki