Книга: Introduction to Microprocessors and Microcontrollers

Obsolete octal – probably not worth reading

Obsolete octal – probably not worth reading

Octal is another number system which has no advantages over hex but is still met from time to time. Only a brief look will be offered here just to make sure that we have at least mentioned it.

In hex, we used binary bits in groups of four because 11112 adds up to 15 which is the value of the highest digit (F) in hex. In octal, we use groups of three bits. The highest value is now 1112 which is 7. Octal therefore has eight digits and counts from 0 to 7. The count proceeds:

0

1

2

3

4

5

6

7

There is no 8th digit so reset the count to 0 and put a 1 in the next column.

10

11

12

13

14

15

16

17

Now go straight to 20

20

etc.

No letters are involved and it is often not recognized as octal until we realize that none of the numbers involve the digits 8 or 9.

Conversions follow the same patterns as we have seen for hex.

Octal to denary: the column heading values are 84, 83, 82, 81, 80.

Denary to octal: divide by 8 and write down the remainder then read remainders from the bottom upwards. Use the subscript 8 to indicate an octal number, e.g. 6410=1008.

Octal to binary: write each octal digit down as a three digit binary group.

Binary to octal: start from the right-hand side and chop the binary numbers into groups of three, then evaluate each group.

I think that is enough for octal. It’s (fairly) unlikely you will meet it again so we can say ‘goodbye Octal’.

Оглавление книги


Генерация: 1.318. Запросов К БД/Cache: 3 / 1
поделиться
Вверх Вниз