Electrical Engineering  ·  Level 6
Digital Electronics I
Chapter 1: Apply knowledge of number systems
📚 4 Topics
⚑ What you will be able to do

By the end of this chapter, you will be able to:

  • apply your knowledge of number systems correctly when designing digital systems.
  • accurately convert numbers between different number systems to meet design requirements.
  • represent binary numbers using one’s and two’s complements appropriately for various arithmetic operations.
  • perform binary arithmetic correctly based on the type of operation needed.

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.

1.1 Number systems

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

1.1.1 Decimal

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.

Structure of the decimal system

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:

  • 3 × 10³ (thousands place)
  • 4 × 10² (hundreds place)
  • 8 × 10¹ (tens place)
  • 2 × 10⁰ (ones place)

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.

Role of the decimal system in electrical engineering

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.

Conversion from decimal to other number systems

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:

  • Divide 156 by 16: quotient 9, remainder 12 (C in hex)
  • Divide 9 by 16: quotient 0, remainder 9
  • Read the remainders from last to first: 9C hexadecimal

Check: 9 × 16 + 12 = 156.

This conversion is crucial when programming embedded systems or interpreting memory addresses.

Conversion from other number systems to decimal

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:

  • 2 × 16² = 2 × 256 = 512
  • 15 (F) × 16¹ = 15 × 16 = 240
  • 3 × 16⁰ = 3 × 1 = 3
  • Sum = 512 + 240 + 3 = 755 decimal

This process is frequently used when interpreting machine-level data or debugging programs in which registers are displayed in hexadecimal.

1.1.2 Octal

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.

Characteristics of the octal system

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:

  • 3 × 8² = 3 × 64 = 192
  • 4 × 8¹ = 4 × 8 = 32
  • 5 × 8⁰ = 5 × 1 = 5
  • Total decimal value = 229

This positional system allows for straightforward conversion to and from binary by grouping bits in sets of three.

Usefulness in electrical engineering

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.

Conversion between octal and binary

Converting octal to binary involves replacing each octal digit with its 3-bit binary equivalent. For example, octal 57 converts to binary as:

  • 5 (octal) = 101 (binary)
  • 7 (octal) = 111 (binary)
  • Combined binary = 101111

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:

  • Group from the right: 11 | 010 | 110
  • Pad the left group: 011 | 010 | 110
  • Convert each group: 3 | 2 | 6
  • Result = 326 octal

This method simplifies working with digital signals in embedded systems.

Conversion between octal and decimal

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:

  • 229 ÷ 8 = 28 remainder 5
  • 28 ÷ 8 = 3 remainder 4
  • 3 ÷ 8 = 0 remainder 3
  • Read the remainders from last to first: 345 octal

This agrees with the structure example above and is necessary when interfacing digital systems with human operators or legacy documentation.

1.1.3 Hexadecimal

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.

Structure and symbols of hexadecimal

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:

  • 3 × 16² = 3 × 256 = 768
  • 15 (F) × 16¹ = 15 × 16 = 240
  • 10 (A) × 16⁰ = 10 × 1 = 10
  • Total decimal value = 1018

This system is especially useful for representing large binary numbers succinctly.

Importance in electrical engineering practice

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.

Conversion between hexadecimal and binary

Each hexadecimal digit corresponds to four binary bits, making conversion straightforward. For example, hexadecimal 2B converts to binary as:

  • 2 = 0010 (binary)
  • B (11) = 1011 (binary)
  • Combined binary = 00101011

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:

  • Group from the right: 1101 | 0110
  • Convert each group: D | 6
  • Result = D6 hexadecimal

This method facilitates analysis of digital signals and logic states.

Conversion between hexadecimal and decimal

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:

  • 1018 ÷ 16 = 63 remainder 10 (A)
  • 63 ÷ 16 = 3 remainder 15 (F)
  • 3 ÷ 16 = 0 remainder 3
  • Read the remainders from last to first: 3FA hexadecimal

These conversions are common when engineers translate between human-readable formats and machine-level data during system design and testing.

1.1.4 Binary

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.

Structure of the binary system

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:

  • 1 × 2⁵ = 32
  • 0 × 2⁴ = 0
  • 1 × 2³ = 8
  • 1 × 2² = 4
  • 0 × 2¹ = 0
  • 1 × 2⁰ = 1
  • Total decimal value = 32 + 8 + 4 + 1 = 45

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.

Terms used with binary numbers

Standard terms describe groups and positions of bits:

  • Bit: a single binary digit, either 0 or 1.
  • Nibble: a group of 4 bits, which corresponds to exactly one hexadecimal digit.
  • Byte: a group of 8 bits, commonly used as the width of a data port or memory location.
  • Least significant bit (LSB): the rightmost bit, with the smallest weight (2⁰).
  • Most significant bit (MSB): the leftmost bit, with the largest weight in the number.

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.

Role of binary in digital electronics

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.

Conversion from binary to decimal

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:

  • Weights from left to right: 128, 64, 32, 16, 8, 4, 2, 1
  • Bits set to 1 are at 128, 64, 16, 4 and 2
  • Sum = 128 + 64 + 16 + 4 + 2 = 214 decimal

This agrees with the octal value 326 and the hexadecimal value D6 found above for the same bit pattern.

Conversion from decimal to binary

Decimal to binary conversion uses repeated division by 2. Follow these steps:

  1. Write down the decimal number to be converted, for example 45.
  2. Divide the number by 2 and note the whole-number quotient.
  3. Record the remainder, which is always 0 or 1. This remainder is the next bit, starting with the LSB.
  4. Use the quotient as the new number to divide by 2.
  5. Repeat steps 2 to 4 until the quotient becomes 0.
  6. Read the remainders from last to first, so the last remainder becomes the MSB.
  7. Check the answer by converting it back to decimal.

Working for decimal 45:

  • 45 ÷ 2 = 22 remainder 1
  • 22 ÷ 2 = 11 remainder 0
  • 11 ÷ 2 = 5 remainder 1
  • 5 ÷ 2 = 2 remainder 1
  • 2 ÷ 2 = 1 remainder 0
  • 1 ÷ 2 = 0 remainder 1
  • Read the remainders from last to first: 101101

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:

  • 0.625 × 2 = 1.25, bit 1
  • 0.25 × 2 = 0.5, bit 0
  • 0.5 × 2 = 1.0, bit 1
  • Result = 0.101 binary

Conversion between binary and other systems

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.

Practice Questions

  1. Convert the decimal number 345 to its hexadecimal equivalent. (5 marks)
  2. Explain the process of converting an octal number to binary with an example. (6 marks)
  3. List and explain five characteristics of the hexadecimal number system. (10 marks)
  4. Convert the hexadecimal number 1A3 to decimal. Show all steps. (5 marks)
  5. Describe how the decimal number system is used in electrical engineering documentation and give two examples. (6 marks)
The rest of this chapter
🔒

Create a free account to open more of this chapter.

Free: practical guides, quick cards, workplace scenarios and more.

Create a free account
🔒1.2 Number system representation

…

🔒1.3 Conversion of number systems

…

🔒1.4 Perform 1’s and 2’s complement

…

Chapter Summary

This 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.

Self-Assessment

🔒 PDFDownload this self-assessment, with answers

A. Written Assessment

  1. Define the decimal number system and explain its base. (2 marks)
  2. Convert the decimal number 156 to its octal equivalent. (3 marks)
🔒20 more in this section.

Chapter Examination Questions

🔒 PDFDownload these examination questions, with worked answers

SECTION A (40 Marks) - Answer ALL Questions

  1. Convert the decimal number 156 to its equivalent hexadecimal form, explaining the steps involved. (4 marks)
  2. Express the octal number 745 in decimal notation. (4 marks)
🔒18 more in this section.

Chapter Practical Activities

Practical 1: Convert Decimal Numbers to 8-bit Binary Equivalents

Electrical Engineering · Level 6
Digital Electronics I
PRACTICAL ASSESSMENT
TIME: 3 HOURS
⬇ PDFCandidate Instructions (Candidate Tool)

Type: Individual

INSTRUCTIONS TO CANDIDATE:
1.  You are required to perform the following task:
i.  Convert the following decimal numbers 45, 127, and 201 into their 8-bit binary equivalents manually and record the results on graph paper.
2.  You have been provided with the following resources for the practical task:
Tools & EquipmentMaterials
Scientific CalculatorGraph Paper A4 Size
Pencil HBSafety Gloves
Eraser
Ruler 30 cm
⬇ PDFResources Required (Cutting List)
S/NItemQuantity
1Scientific Calculator1 Pc per Candidate
2Graph Paper A4 Size2 Sheets per Candidate
3Pencil HB2 Pcs per Candidate
4Eraser1 Pc per Candidate
5Ruler 30 cm1 Pc per Candidate
6Safety Gloves1 Pair per Candidate
⬇ PDFAssessor Guide
Items to be EvaluatedMarks AvailableMarks ObtainedComments
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-Total4
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-Total14
TASK 3: Housekeeping
Cleared workstation and returned tools and materials to proper storage
(Award 2 marks for proper housekeeping after task)
2
Sub-Total2
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-Total19
GRAND TOTAL39
ASSESSMENT OUTCOME:   ☐ Competent    ☐ Not Yet Competent (competent if at least 50%)

Practical 2: Convert Binary Numbers to Decimal Using Positional Value Method

Electrical Engineering · Level 6
Digital Electronics I
PRACTICAL ASSESSMENT
TIME: 3 HOURS
⬇ PDFCandidate Instructions (Candidate Tool)

Type: Individual

INSTRUCTIONS TO CANDIDATE:
1.  You are required to perform the following task:
i.  Convert the following four binary numbers (101101, 1100110, 10011101, 11110010) to their decimal equivalents using the positional value method and record your calculations in a neat table.
2.  You have been provided with the following resources for the practical task:
Tools & EquipmentMaterials
Scientific CalculatorBinary to Decimal Conversion Table
RulerNotebook (A4 size)
Pen or Pencil
⬇ PDFResources Required (Cutting List)
S/NItemQuantity
1Scientific Calculator1 Pc per Candidate
2Binary to Decimal Conversion Table1 Pc per Candidate
3Notebook (A4 size)1 Pc per Candidate
4Pen or Pencil1 Pc per Candidate
5Ruler (30 cm)1 Pc per Candidate
⬇ PDFAssessor Guide
Items to be EvaluatedMarks AvailableMarks ObtainedComments
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-Total24
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-Total21
GRAND TOTAL45
ASSESSMENT OUTCOME:   ☐ Competent    ☐ Not Yet Competent (competent if at least 50%)
🔒

Free: practical guides, quick cards, workplace scenarios and more.

Create a free account
🔒Convert Decimal Numbers to Octal RepresentationPractical 3
🔒Convert Octal Numbers to Decimal ValuesPractical 4
🔒Convert Decimal Numbers to Hexadecimal Notation Using Division MethodPractical 5
🔒Convert Hexadecimal Numbers to Decimal ValuesPractical 6
🔒Convert 12-bit binary numbers to octal notationPractical 7
🔒Convert Octal Numbers to 3-bit Binary EquivalentsPractical 8
🔒Convert Binary Numbers to Hexadecimal NotationPractical 9
🔒Convert Hexadecimal Numbers to BinaryPractical 10
Flashcards 20 cards Study deck ▾
Question
1

↻ Tap card to reveal answer
🔒

18 more in this section.

Create a free account
Test Yourself 19 questions Start quiz ▾
0%
0 / 2
🔒

17 more in this section.

Create a free account
Am I competent?

At the start of this chapter we promised you would be able to:

  • apply your knowledge of number systems correctly when designing digital systems.
  • accurately convert numbers between different number systems to meet design requirements.
  • represent binary numbers using one’s and two’s complements appropriately for various arithmetic operations.
  • perform binary arithmetic correctly based on the type of operation needed.

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.