

If you look at this table you will notice that 1KByte stands out like a sore thumb as not being a nice hex number.

The following table shows how much simpler these commonly used values and ranges look in hex: The equivalent addressing ranges are 0 to 65535 in decimal and 0 to FFFF in hex. This is quite interesting but you begin to see the pay off when you look at the problem of addressing say 64KBytes which in decimal is 65536 but in hex is simply 10000 bytes. In hex 1KByte is 400 bytes and the address range is 0 to 3FF. If you address each memory location in decimal the address range is 0 to 1023. Hex values are closely related to binary values and powers of two.įor example, 1KByte of memory is 1024 bytes in decimal. This `short form' is really only a minor benefit compared with the second reason why we use hex. The first is that it can be used to write down very large integers in a compact form.įor example, AD45 is shorter than its decimal equivalent 44357 and as values increase the difference in length becomes even more pronounced. There are two ways in which hex makes life easier. Programmers are, as a group, fairly lazy and you can bet that they wouldn't make use of something if it didn't make life easy. So far, using hex for a number looks as if it might be some sort of intellectual game or something that examiners can use to set a good question. Writing 10 lots of 4096, 13 lots of 256, 4 lots of 16 and 5 units in standard hex gives AD45.įortunately it isn't often that you have to convert decimal to hex! Is 3397 and this contains 13 lots of 256 because:Īnd so on to discover that the remainder contains 4 lots of 16 and 5 units. For example, 44357 contains 10 lots of 4096 because: To convert from decimal to hex is just a little more complicated in that you have to discover how many lots of 4096, 256 and 16 there are in a number. To express it in a mix of hex and decimal, or moving entirely to decimal: The place values used in hex are:Īnd you can use these to work out the equivalent decimal value quite easily. There are a number of standard algorithms that can be used to convert between different number bases but I have to admit that I prefer a more primitive approach. You certainly have to be able to convert hex to decimal and vice versa but there is something deeper.įirst, though, how do you convert hex to decimal? To really feel at home with hex you have to be able to understand it in a slightly different way. Enter a value, click the Hex-field and the calculator will convert the number to hexadecimal.Being able to count in hex is a great way to understand the how the system works but it isn't much use when you are confronted with a message such as

To define a certain color you simply enter the amount of each of the three colors Red, Green and Blue.Īnother way to convert a decimal value into a hexadecimal value is using the Windows standard calculator (If you don't see the hex-option in the calculator, click the view-menu and choose scientific). Most graphic design programs (photoshop, photopaint, paintshop pro etc.) offer to handle colors in a RGB (Red, Green, Blue) color system. Colors in HTML are specifyed using hexadecimal numbers. Thus one can represent every byte as two consecutive hexadecimal digits. It is a useful system in computers because there is an easy mapping from four bits to a single hex digit. Hexadecimal (often abbreviated hex) is a 16 numeral system, usually written using the symbols 0-9 and A-F. Hex (hexadecimal) colours codes to RGB (Red, Green, Blue) Hexadecimal to RGB Converter, Hex converter
