With hexadecimal we take four bits at a time and convert them into a hexadecimal value, and normally we show that we are using hexadecimal with leader characters. The table we use is:
Val Hex Val Hex 0000 0 1000 8 0001 1 1001 9 0010 2 1010 A 0011 3 1011 B 0100 4 1100 C 0101 5 1101 D 0110 6 1110 E 0111 7 1111 F
An example is 42 which is “0010 1011”, and where we can represent this with 0x2B. With octal we take three bits at a time, and represent them with a value from 0 to 7.