Octal's, Hexadecimals

Hi, C++ Forum.

I dont know the definition of Octal & Hexadecimal. I have checked around,
googled them, used a dictionairy.

Octal:
a numerical representation system where the digits 0 through 7 are used to encode each of the eight possible sequences of 3 bits from 000 to 111

Hexadecimal:
Definition: Hexadecimal is base 16 arithmetic where each digit is a value from 0 to 15, rather than the 0-9 of base 10. The decimal numbers after 9 are represented by the letters A to F where
A16= 1010
B16= 1110
C16= 1210
D16= 1310
E16= 1410
F16= 1510

yet I still dont understand them. I'm stuck at continueing the "Toturial's" on this site, because I do not know what these 2 words mean.

So could somebody explain it properly?

Ty in advance,


Byte


please note: My english sucks, because my motherlanguage is Dutch, so its quite hard to understand high technical words.

+ I'm 15 y/o, and I just find it interesting to learn C++, so I might be able to make a rpg in the future.
Read these, and see if you can understand them.
http://en.wikipedia.org/wiki/Octal
http://en.wikipedia.org/wiki/Hexadecimal

If you still can't, just skip over it. It's not essential and you'll probably end up learning it naturally along the way.
Quite honestly, I never really understood why I needed to learn about octal and hexadecimal numbers. I never use them for anything, do you helios?
Some things are better represented in hex. Bytes in hex editors are an example. Also, code points in encodings (e.g. U+0030 through U+0039 are numerals). Hex notation is also very useful for bit twiddling. x|0x80000000 is much more understandable than x|2147483648, although x|(1<<31) is even better.

Octal is, I understand, a relic from when 12-bit byte CPUs were commonplace. 7777 is a fully set 12-bit byte.

EDIT: According to Wikipedia, it was used for 24-bit word CPUs, presumably regardless of their byte size.
Last edited on
Yes, it is just an ease-of-use issue. Even with 7|8-bit entities, octal is common.

All numbers are represented using a radix. We humans tend to use base 10 -- corresponding to our ten fingers. We are accostomed to it and so we think it natural and easy.

Computers like radices in powers of 2 -- since they are binary machines. It is much easier to represent a specific bit-pattern using hexadecimal and octal, which are exactly representable by a specific number of bits, than it is to use decimal, which is not exactly representable by a specific number of bits.

Remember that a number is a number is a number no matter how it is represented. That's why computer programmers mix up Halloween and Christmas. (Because OCT 31 == DEC 25.)

http://en.wikipedia.org/wiki/Radix

Hope this helps.
bases are ways of expressing numbers. The number of the base is how many digits there are, so base 10 has 0,1,2,3,4,5,6,7,8,9. octal(base 8) has 0,1,2,3,4,5,6,7. hex(base 16) has 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F.

In order to find the value of a different base in decimal, you multiply the digits in different places by different powers of the base.

for example, in base 5: 3423 is equal to 50ˣ3+51ˣ2+52ˣ4+53ˣ3
Topic archived. No new replies allowed.