☰ خطة العام · تكنولوجيا المعلومات والاتصالات (بالإنجليزية)

Hexadecimal numbers

الأسبوع 4 · الوحدة ١ «النظم العددية» (٤): النظام السداسي عشر، التحويل من السداسي عشر إلى العشري ومن العشري إلى السداسي عشر · 3 دروس
1

Sixteen symbols: meet hexadecimal

ICT Secondary 3 Term 1, Unit 1, Topic 1: pp. 18–21
GoalName the sixteen hexadecimal symbols and their values, and say why hexadecimal is used.
New words
hexadecimal system · the number system with base 16 and the sixteen symbols 0 to 9 and A to Fsymbol value · the number a symbol stands for: A = 10, B = 11, C = 12, D = 13, E = 14, F = 15memory address · a number that says where a piece of data is stored in the computer’s memoryMAC address · the hardware address of a network card, often written in hexadecimal
Explanation

The hexadecimal system has base 16, so it needs sixteen symbols. The first ten are the digits 0 to 9. The other six are the letters A, B, C, D, E and F, with the values A = 10, B = 11, C = 12, D = 13, E = 14 and F = 15. In a hexadecimal number these letters are digits, not parts of a word: in 3E9 the E is a digit worth 14. In this course we write the letters as capitals. The ready functions of PHP and VB.NET print them in lower case (3e9), which is exactly the same number. After F comes 10, which in hexadecimal means one sixteen and no ones. Why use it? It writes long binary numbers short, because one hexadecimal symbol stands for exactly four bits (you will see this next week). So memory addresses, colour codes in some programming languages and the hardware address of a network card are often written in hexadecimal. It is only a way of writing a number: the data stay the same.

Symbol01234567
Value01234567
Symbol89ABCDEF
Value89101112131415
Worked examples
HexadecimalOrdinary count
99
A10
F15
1016
Count in hexadecimal: 8, 9, A, B, C, D, E, F, and then 10. The hexadecimal number 10 is one sixteen and no ones, so in ordinary counting it is sixteen.
TextHexadecimal number?Reason
3E9yes3, E and 9 are allowed
1G7noG is not one of the sixteen symbols
B00yesB and 0 are allowed
9KnoK is not one of the sixteen symbols
850yesall three are digits
Which texts are hexadecimal numbers? A text is one when every character is one of the sixteen symbols, even when it looks like an ordinary number.
Class activity

On paper, write the sixteen symbols in a row with their values. Make up three strings of three characters, two that are hexadecimal numbers and one that uses a letter that is not allowed, and ask a friend to find the odd one.

Practice
1
What value does the symbol D have?
2
What does 10 mean in hexadecimal?
3
Is BAD a hexadecimal number? Is HEX?
4
A program prints 3e9. Is it a different number from 3E9?
5
Why is hexadecimal used for long binary numbers?