CS 101   Web Construction,   Instructor:  Jeffrey Horn

Hex Numbers

(see page on BINARY NUMBERS first)

Base Numbers
10 (decimal) 0 1 2 3 4 5 6 ... 252 253 254 255
2 (binary) 00000000 00000001 00000010 00000011 00000100 00000101 00000110 ... 11111100 11111101 11111110 11111111

System

Representation
Decimal (the actual value) 76
Binary (single byte) 01010110
Binary (2 nibbles) 0101   0110
Hex (2 hex numbers) 5         6
Hex  (final html syntax) #56
Base Alphabet (set of symbols)
10 (decimal) 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
2 (binary) 0, 1
16 (hex) 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F

 

Base Numbers
10 (decimal) 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
2 (binary) 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111
16 (hex) 0 1 2 3 4 5 6 7 8 9 A B C D E F

System

Representation
Decimal (the actual value) 90
Binary (single byte) 01011010
Binary (2 nibbles) 0101   1010
Hex (2 hex numbers) 5         A
Hex  (final html syntax) #5A
Language Single Byte Numbers
JavaScript 0 1 2 ... 128 ... 252 253 254 255
HTML #00 #01 #02 ... #80 ... #FC #FD #FE #FF
machine code (binary) 0000 0000 0000 0001 00000010 ... 1000 0000 ... 1111 1100 1111 1101 1111 1110 1111 1111

Copyright 2008 Jeff Horn.  (last updated  January 28, 2007) This page is URL   http://cs.nmu.edu/~jeffhorn/Classes/CS101/Winter2008/hex_numbers.html