By the end of this chapter, you will be able to:
These skills are essential because they help you work confidently with digital systems and technology in your trade.
Compiled by: Elijah Kiprono
Number systems form the foundation of all digital computing and data representation, essential knowledge for ICT technicians who design, troubleshoot, and maintain computer systems and networks. Understanding different number systems enables effective data encoding, error detection, and system programming. This chapter focuses on identifying and working with number systems commonly used in ICT, with emphasis on practical applications relevant to Kenyan ICT technicians.
Computers store and process every number, letter and picture as patterns of two states, yet people read and write numbers in decimal and technicians often use octal and hexadecimal as a shorter way to write long binary patterns. An ICT technician who can tell the number systems apart, and who knows what a base, a place value and a bit are, can read addresses, masks and colour codes without confusion. This topic defines the terms used for all number systems and then describes the four systems used in ICT: decimal, binary, octal and hexadecimal.
Each term below applies to every number system. The terms are best learned together because each one builds on the one before: a number system has a base, the base gives the place values, the place values give a digit its contribution, and in a computer the digits are bits.
A number system is a set of symbols, called digits, together with the rules for using them to write numbers. Most systems used in computing are positional: the value that a digit stands for depends on the position it occupies in the number as well as on the digit itself. In 53 the digit 5 stands for fifty, but in 25 the same digit stands for five. A non-positional system, such as Roman numerals, gives a symbol the same value wherever it stands, which makes arithmetic difficult.
In a positional system with base b, a number whose digits are dn−1, ..., d1, d0 (from left to right) has the value:
dn−1 × bⁿ⁻¹ + ... + d1 × b¹ + d0 × b⁰
Example: in the decimal system the number 345 means 3 × 10² + 4 × 10¹ + 5 × 10⁰ = 300 + 40 + 5.
The absolute value of a digit, also called its face value, is the value of the digit itself, whatever position it occupies. The absolute value of 7 is always 7, and in hexadecimal the absolute value of F is always 15. This is different from the absolute value |x| of an integer, which means its distance from zero.
Example: in the decimal number 472 the absolute values of the digits are 4, 7 and 2. In the hexadecimal number 3A5 they are 3, 10 and 5, because A stands for 10.
The place value of a position is the base raised to the number of that position, counting from 0 at the right-hand end. A digit contributes its absolute value multiplied by the place value of its position, and the sum of the contributions is the value of the whole number.
Example: for the decimal number 3847 the place values from the left are 1000, 100, 10 and 1, so 3847 = 3 × 1000 + 8 × 100 + 4 × 10 + 7 × 1 = 3000 + 800 + 40 + 7.
Example: for the binary number 1011 the place values from the left are 8, 4, 2 and 1, so its value is 1 × 8 + 0 × 4 + 1 × 2 + 1 × 1 = 11. The place values of an 8-bit binary number are shown below.
| Position | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|---|---|---|---|---|---|---|---|---|
| Place value | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |
The full procedures for changing a number from one base to another are given in Base conversion.
A bit, short for binary digit, is a single 0 or 1 and is the smallest unit of data in a computer. A group of 4 bits is called a nibble and a group of 8 bits is called a byte. A group of n bits can form 2ⁿ different patterns, so adding one bit doubles the number of values that can be held.
| Number of bits | Different patterns | Range as a whole number |
|---|---|---|
| 1 | 2 | 0 to 1 |
| 4 | 16 | 0 to 15 |
| 8 | 256 | 0 to 255 |
| 16 | 65,536 | 0 to 65,535 |
Example: one byte can hold the values 0 to 255, which is why each part of an IPv4 address lies between 0 and 255.
The most significant bit, written MSB, is the bit at the left-hand end of a binary number. It has the largest place value, so it has the greatest effect on the value of the number. In an 8-bit number the MSB has the place value 128.
Example: the 8-bit number 01000000 has the value 64. Changing only the MSB gives 11000000, which has the value 192, a change of 128. In signed binary numbers the MSB is used as the sign bit, with 0 for positive and 1 for negative, as explained in Complement.
The least significant bit, written LSB, is the bit at the right-hand end of a binary number. It has the place value 1, the smallest of all, and the bits next to it, the least significant bits, also change the value of the number only slightly.
Example: the LSB shows whether a whole number is even or odd. The binary number 10110 has the value 22 and its LSB is 0, so it is even. The number 10111 has the value 23 and its LSB is 1, so it is odd.
Example: clearing the two least significant bits of 10110111 (183) gives 10110100 (180). The value changes by at most 3, while changing the MSB would change it by 128.
The base, or radix, of a number system is the number of different digits it uses, counting 0. A system with base b uses the digits 0 to b − 1, and its place values are the powers of b. The base is written as a small subscript after a number, so 101₂ is binary, 745₈ is octal, 2F₁₆ is hexadecimal, and a number with no subscript is decimal.
The same digits mean different numbers in different bases: 101 in base 10 is one hundred and one, but 101₂ = 1 × 4 + 0 × 2 + 1 × 1 = 5. A number is valid in a base only when none of its digits is equal to or larger than the base. The number 1021 cannot be binary because the digit 2 is not below 2. The number 3C8 cannot be in base 11, because C stands for 12, which is above 10, but 5B2 can be in base 12, because B stands for 11 and every digit is below 12.
Four number systems are used in ICT work. Decimal is the system people use, binary is the system computer circuits use, and octal and hexadecimal are compact ways of writing binary. The table gives the first sixteen whole numbers in each of them, so that the patterns can be compared before each system is described.
| Decimal | Binary | Octal | Hexadecimal |
|---|---|---|---|
| 0 | 0000 | 0 | 0 |
| 1 | 0001 | 1 | 1 |
| 2 | 0010 | 2 | 2 |
| 3 | 0011 | 3 | 3 |
| 4 | 0100 | 4 | 4 |
| 5 | 0101 | 5 | 5 |
| 6 | 0110 | 6 | 6 |
| 7 | 0111 | 7 | 7 |
| 8 | 1000 | 10 | 8 |
| 9 | 1001 | 11 | 9 |
| 10 | 1010 | 12 | A |
| 11 | 1011 | 13 | B |
| 12 | 1100 | 14 | C |
| 13 | 1101 | 15 | D |
| 14 | 1110 | 16 | E |
| 15 | 1111 | 17 | F |
The decimal system has base 10 and uses the ten digits 0 to 9. Its place values are the powers of ten: 1, 10, 100, 1000 and so on. It is the system of everyday counting and of money, so prices in Ksh are written in decimal. Computers accept decimal numbers from users, but they change them to binary before processing.
Example: 4305 = 4 × 1000 + 3 × 100 + 0 × 10 + 5 × 1 = 4000 + 300 + 0 + 5. The zero holds the tens place so that the other digits stay in their correct positions.
The binary system has base 2 and uses only the digits 0 and 1. Its place values are the powers of two: 1, 2, 4, 8, 16, 32 and so on. It suits digital electronics, because a circuit can easily be made to hold one of two states, such as a low voltage for 0 and a high voltage for 1, or a switch that is off or on.
Example: 110101₂ = 1 × 32 + 1 × 16 + 0 × 8 + 1 × 4 + 0 × 2 + 1 × 1 = 32 + 16 + 0 + 4 + 0 + 1 = 53.
The octal system has base 8 and uses the digits 0 to 7. Its place values are the powers of eight: 1, 8, 64, 512 and so on. Every octal digit stands for exactly three bits, so octal is a shorter way to write binary numbers. A common use is the permission code of a file on Linux and other Unix systems: the digits of 755 give the permissions of the owner, the group and everyone else, where 7 means read, write and execute (4 + 2 + 1) and 5 means read and execute (4 + 1).
Example: 745₈ = 7 × 64 + 4 × 8 + 5 × 1 = 448 + 32 + 5 = 485.
The hexadecimal system has base 16. It needs sixteen digits, so after 0 to 9 it uses the letters A to F for the values 10 to 15. Its place values are the powers of sixteen: 1, 16, 256, 4096 and so on. Every hexadecimal digit stands for exactly four bits, so one byte is written with two hexadecimal digits. The system is used for memory addresses, for MAC addresses of network cards, which have twelve hexadecimal digits, and for colour codes in web design, where #FF0000 means full red (FF = 255) with no green and no blue.
Example: 2F₁₆ = 2 × 16 + 15 × 1 = 47, and 3B7₁₆ = 3 × 256 + 11 × 16 + 7 × 1 = 768 + 176 + 7 = 951.
Create a free account to open more of this chapter.
Free: practical guides, quick cards, workplace scenarios and more.
Create a free accountThis chapter began by identifying various number systems, defining key terms and exploring types such as decimal, binary, octal, and hexadecimal. It then covered base conversion techniques, including converting from decimal to other number systems, from other number systems to decimal, from binary to other systems, and vice versa. The chapter proceeded to arithmetic operations within these number systems, detailing binary arithmetic, the use of complements, and arithmetic in octal and hexadecimal systems. It also examined different binary codes such as Binary Coded Decimal (BCD), ASCII, EBCDIC, Gray code, and Excess-3, explaining their structure and applications. Representation of binary coded decimal was discussed to highlight how decimal digits are expressed in binary form. Finally, the chapter addressed arithmetic operations involving BCD, demonstrating how calculations are performed using binary coded decimal values. This comprehensive treatment equips learners with essential skills to work confidently across various number systems and their arithmetic processes.
Convert the decimal number \(156\) to its equivalent in binary. (2 marks)
A network device uses an 8-bit binary address. Convert the binary address \(11010101_2\) to decimal. (2 marks)
At the start of this chapter we promised you would be able to:
Tick each one you can genuinely do.
So, are you there yet?
You're competent when you can confidently do 50% or more of what this chapter promised.
Sign in to record how you're doing.