By the end of this chapter, you will be able to:
Mastering these skills will help you design and troubleshoot digital systems confidently, a key ability in the world of electronics and technology!
Number systems form the foundation of digital electronics, enabling the representation and manipulation of data in various formats essential for electrical engineering applications. In Kenya’s growing technology and manufacturing sectors, understanding different number systems is crucial for designing, programming, and troubleshooting digital circuits and microprocessor-based systems. This chapter explores the main number systems used in digital electronics: decimal, octal, and hexadecimal, focusing on their characteristics, conversion methods, and relevance in practical engineering tasks.
Number systems are structured ways to represent numerical values using a set of symbols called digits. Each system is defined by its base or radix, which determines the number of unique digits and the place value of each digit. In digital electronics, different bases are used to simplify hardware design and programming. For instance, the binary system (base 2) is fundamental for logic circuits, while octal (base 8) and hexadecimal (base 16) systems offer compact representations of binary numbers, making them easier to read and manipulate.
The table below compares the first sixteen values in the four systems. Notice that every octal digit matches exactly three binary bits and every hexadecimal digit matches exactly four binary bits.
| 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, also known as the base-10 system, is the standard system for general arithmetic and everyday counting. It is composed of ten digits from 0 to 9. Electrical engineers often convert between decimal and other number systems to interface human-readable data with digital devices, for example when a technician reads a decimal value on a multimeter display and compares it with the binary value held in a digital trainer board.
The decimal system uses ten digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. Each digit's position in a number represents a power of 10, starting from 10⁰ at the rightmost digit and increasing by one power as you move left. For example, the number 3,482 means:
Digits to the right of the decimal point carry negative powers of 10 (10⁻¹, 10⁻², and so on). For example, 25.47 means 2 × 10¹ + 5 × 10⁰ + 4 × 10⁻¹ + 7 × 10⁻². This positional value system allows the representation of any integer or fractional number.
Although digital circuits operate primarily in binary, the decimal system remains important in design, testing, and documentation. Component tolerances, supply voltages, resistor values and currents are specified and measured in decimal. In programming microcontrollers for automation of a production line, decimal input and output are often required for keypads, displays and data logging.
Converting decimal numbers to binary, octal or hexadecimal is common when working with digital systems. The two main methods are repeated division by the target base and subtraction of place values. In repeated division, the remainders are read from the last to the first to give the digits of the answer. For example, to convert decimal 156 to hexadecimal:
Check: 9 × 16 + 12 = 156.
This conversion is crucial when programming embedded systems or interpreting memory addresses.
Converting binary, octal or hexadecimal numbers back to decimal involves multiplying each digit by its base raised to the digit's position power and summing the results. For instance, hexadecimal 2F3 to decimal:
This process is frequently used when interpreting machine-level data or debugging programs in which registers are displayed in hexadecimal.
The octal system is a base-8 number system using digits from 0 to 7. It is less common than decimal and hexadecimal but historically significant in digital electronics, especially in earlier computer systems and microcontroller programming. Octal offers a more compact representation of binary data, reducing the length of binary strings and simplifying human readability.
Octal numbers use eight digits: 0 through 7. The digits 8 and 9 do not exist in octal. Each digit represents a power of 8, with the rightmost digit at 8⁰, the next at 8¹, and so forth. For example, the octal number 345 represents:
This positional system allows for straightforward conversion to and from binary by grouping bits in sets of three.
Octal is useful in systems where binary data is grouped in sets of three bits, such as some early digital communication protocols and microprocessors. Engineers working on legacy systems or interfacing with older digital hardware in an electronics laboratory may encounter octal representations. It provides a balance between binary detail and human readability.
Converting octal to binary involves replacing each octal digit with its 3-bit binary equivalent. For example, octal 57 converts to binary as:
Conversely, binary to octal conversion groups binary digits into sets of three starting from the right, padding the leftmost group with zeros if needed, and converts each group to its octal digit. For example, binary 11010110:
This method simplifies working with digital signals in embedded systems.
Octal to decimal conversion multiplies each digit by its positional power of 8 and sums the results, as in the 345 example above. Decimal to octal conversion uses repeated division by 8, recording remainders as octal digits and reading them from last to first. For example, decimal 229:
This agrees with the structure example above and is necessary when interfacing digital systems with human operators or legacy documentation.
The hexadecimal system is base-16 and widely used in digital electronics for compactly representing binary data. It uses sixteen symbols: digits 0 to 9 and letters A to F to represent values 10 to 15. Hexadecimal is integral in programming, memory addressing, and debugging in modern electrical engineering.
Hexadecimal digits include 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 and letters A (10), B (11), C (12), D (13), E (14), F (15). Each digit's position corresponds to a power of 16. For example, hexadecimal 3FA represents:
This system is especially useful for representing large binary numbers succinctly.
Hexadecimal is the preferred notation for memory addresses, machine code, and colour codes in digital design. A technician programming a microcontroller for a motor controller or a sensor board reads and writes register values in hexadecimal, which ensures precise control and compact data representation. It is essential in debugging embedded systems and designing firmware.
Each hexadecimal digit corresponds to four binary bits, making conversion straightforward. For example, hexadecimal 2B converts to binary as:
Binary to hexadecimal conversion groups bits in fours starting from the right, padding the leftmost group with zeros if needed, and converts each group into a hex digit. For example, binary 11010110:
This method facilitates analysis of digital signals and logic states.
Hexadecimal to decimal conversion multiplies each digit by 16 raised to its position and sums the results, as in the 3FA example above. Decimal to hexadecimal conversion involves repeated division by 16, noting remainders and reading them from last to first. For example, decimal 1018:
These conversions are common when engineers translate between human-readable formats and machine-level data during system design and testing.
The binary system is the base-2 number system. It uses only two digits, 0 and 1, which map directly onto the two states of a digital circuit: a low voltage level (logic 0) and a high voltage level (logic 1). Every logic gate, flip-flop, memory cell and microcontroller input port ultimately works with binary values, so a clear grasp of binary is the foundation of the whole unit.
Each digit in a binary number is called a bit (binary digit). Each bit position represents a power of 2, starting from 2⁰ at the rightmost bit and increasing by one power as you move left. For example, binary 101101 represents:
Bits to the right of the binary point carry negative powers of 2. For example, binary 0.101 = 1 × 2⁻¹ + 0 × 2⁻² + 1 × 2⁻³ = 0.5 + 0.125 = 0.625 decimal.
Standard terms describe groups and positions of bits:
An n-bit binary number can represent 2ⁿ different values, from 0 to 2ⁿ − 1. For example, an 8-bit input port connected to eight switches on a trainer board can represent 2⁸ = 256 values, from 0 to 255.
Transistors in digital circuits are used as switches that are either off or on, so two reliable states are far easier to build and to distinguish in the presence of electrical noise than ten voltage levels would be. Logic gates such as AND, OR and NOT take binary inputs and produce binary outputs, and larger circuits such as counters, adders and memories are built from them. When a technician sets the switches of a trainer board to 00101101, the circuit receives that pattern directly as eight logic levels.
To convert binary to decimal, write the weight of each bit position, multiply each bit by its weight and add the results. For example, binary 11010110:
This agrees with the octal value 326 and the hexadecimal value D6 found above for the same bit pattern.
Decimal to binary conversion uses repeated division by 2. Follow these steps:
Working for decimal 45:
Check: 32 + 8 + 4 + 1 = 45.
For a decimal fraction, repeatedly multiply the fractional part by 2 and record the whole-number part each time. For example, decimal 0.625:
Binary converts directly to octal by grouping bits in threes and to hexadecimal by grouping bits in fours, as shown in the octal and hexadecimal sections above. This is why engineers write long binary patterns in hexadecimal: the 16-bit pattern 1010 1111 0000 0011 becomes AF03, which is shorter and far less likely to be misread or mistyped.
Create a free account to open more of this chapter.
Free: practical guides, quick cards, workplace scenarios and more.
Create a free accountThis chapter explored the fundamental concept of number systems essential in digital electronics. It began with a detailed examination of the decimal system, the base-10 system widely used in everyday counting and arithmetic. The discussion then shifted to the octal system, which operates on base-8 and is often used in computing contexts for its simplicity in representing binary-coded values. Following this, the hexadecimal system was introduced as a base-16 number system that provides a compact and efficient way to express binary numbers, making it invaluable in programming and digital circuit design. Throughout the chapter, the characteristics and applications of each number system were analyzed to build a comprehensive understanding of their roles in digital electronics. Mastery of these number systems is crucial for interpreting and manipulating digital signals and data effectively. The chapter emphasized the importance of converting between these systems to facilitate communication within electronic devices and software. Overall, this foundation prepares students for more advanced topics in digital electronics by ensuring fluency in the numerical languages that underpin digital technology.
Type: Individual
| Tools & Equipment | Materials |
|---|---|
| Scientific Calculator | Graph Paper A4 Size |
| Pencil HB | Safety Gloves |
| Eraser | |
| Ruler 30 cm |
| S/N | Item | Quantity |
|---|---|---|
| 1 | Scientific Calculator | 1 Pc per Candidate |
| 2 | Graph Paper A4 Size | 2 Sheets per Candidate |
| 3 | Pencil HB | 2 Pcs per Candidate |
| 4 | Eraser | 1 Pc per Candidate |
| 5 | Ruler 30 cm | 1 Pc per Candidate |
| 6 | Safety Gloves | 1 Pair per Candidate |
| Items to be Evaluated | Marks Available | Marks Obtained | Comments |
|---|---|---|---|
| TASK 1: Preparation and Safety | |||
| Wore safety gloves before starting the task (Award 2 marks if gloves worn properly before task) | 2 | ||
| Organized tools and materials neatly on the workstation (Award 2 marks for neat and systematic arrangement) | 2 | ||
| Sub-Total | 4 | ||
| TASK 2: Conversion Process | |||
| Performed manual division by 2 method correctly for each decimal number (Award 2 marks for each correctly shown division for 3 numbers) | 6 | ||
| Used calculator correctly to verify results (Award 3 marks if calculator used appropriately without error) | 3 | ||
| Recorded binary digits clearly and in correct bit order on graph paper (Award up to 5 marks for clarity and correct bit order) | 5 | ||
| Sub-Total | 14 | ||
| TASK 3: Housekeeping | |||
| Cleared workstation and returned tools and materials to proper storage (Award 2 marks for proper housekeeping after task) | 2 | ||
| Sub-Total | 2 | ||
| PRODUCT CHECKLIST | |||
| Binary equivalent of decimal 45 is 00101101 (8-bit) (Award 5 marks for correct 8-bit binary for 45) | 5 | ||
| Binary equivalent of decimal 127 is 01111111 (8-bit) (Award 5 marks for correct 8-bit binary for 127) | 5 | ||
| Binary equivalent of decimal 201 is 11001001 (8-bit) (Award 5 marks for correct 8-bit binary for 201) | 5 | ||
| Neatness and legibility of handwritten binary numbers on graph paper (Award up to 4 marks for neat, legible and well-aligned presentation) | 4 | ||
| Sub-Total | 19 | ||
| GRAND TOTAL | 39 | ||
Type: Individual
| Tools & Equipment | Materials |
|---|---|
| Scientific Calculator | Binary to Decimal Conversion Table |
| Ruler | Notebook (A4 size) |
| Pen or Pencil |
| S/N | Item | Quantity |
|---|---|---|
| 1 | Scientific Calculator | 1 Pc per Candidate |
| 2 | Binary to Decimal Conversion Table | 1 Pc per Candidate |
| 3 | Notebook (A4 size) | 1 Pc per Candidate |
| 4 | Pen or Pencil | 1 Pc per Candidate |
| 5 | Ruler (30 cm) | 1 Pc per Candidate |
| Items to be Evaluated | Marks Available | Marks Obtained | Comments |
|---|---|---|---|
| TASK 1: Conversion Process | |||
| Wore appropriate PPE (e.g. safety boots, overall) (Award 2 marks for correct PPE worn, else 0) | 2 | ||
| Organized tools and materials before starting (Award 2 marks for having all tools and materials ready) | 2 | ||
| Applied positional value method correctly for each binary number (Award 2 marks for each correct conversion of the four numbers) | 8 | ||
| Presented calculations neatly in tabular form (Award 3 marks for neat and clear presentation) | 3 | ||
| Used calculator correctly for intermediate calculations (Award 3 marks for correct use without errors) | 3 | ||
| Checked and verified all conversions for accuracy (Award 2 marks for complete and accurate verification) | 2 | ||
| Maintained clean and safe working environment (Award 2 marks for good housekeeping) | 2 | ||
| Completed task within allocated time (Award 2 marks for timely completion) | 2 | ||
| Sub-Total | 24 | ||
| PRODUCT CHECKLIST | |||
| Correct decimal values matching the binary inputs (45, 102, 157, 242) (Award full marks for all four correct conversions, partial marks for fewer) | 10 | ||
| Positional value method correctly shown for all digits (Award marks for detailed and correct positional value calculations) | 6 | ||
| Table format is neat, legible, and properly labeled (Award marks for clarity and neatness of final presentation) | 5 | ||
| Sub-Total | 21 | ||
| GRAND TOTAL | 45 | ||
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.