How different number
systems are used in
computing
SYED MUHAMMAD ASHHAD IQBAL 24k-0655
Why do we use different number systems?
Different number systems are used in computers to represent and manipulate
data in different ways. For example, the binary number system is used to
represent data in a computer’s memory and in communication between
computer devices, while the hexadecimal number system is often used in
computer programming. The choice of number system depends on the specific
application and requirements of the computer system.
Use of binary systems in computing and how it is Used
in Machine-Level Programming
Binary is the fundamental language of computers. At the core of every digital
system, data is represented using two symbols: 0 and 1. This binary system
reflects the electrical states of transistors in computer circuits—off (0) and on
(1).
In machine-level programming, instructions are encoded in binary form. These
instructions are executed directly by the CPU. For example, the instruction set
architecture (ISA) of a CPU defines a set of binary codes that correspond to
various operations, such as addition, subtraction, data movement, and logical
operations. Each instruction is represented by a binary opcode followed by
binary operands.
Programming languages like Assembly language provide a more human-
readable format for these binary instructions, but ultimately, they are compiled
or assembled into binary code for execution.
The Role of Hexadecimal in Memory Addressing
Hexadecimal, or base-16, is a number system that uses sixteen symbols: 0-9
and A-F. It is primarily used in computing to simplify binary representation.
Since one hexadecimal digit corresponds to four binary digits (bits), it allows
programmers and engineers to represent large binary numbers in a more
compact and readable form.
In memory addressing, hexadecimal notation is widely used to indicate specific
memory locations. For example, instead of writing out a long binary number to
specify an address, a programmer can use a hexadecimal representation, this
not only reduces the potential for errors but also makes it easier to interpret
and manage memory in low-level programming tasks.
Hexadecimal is also commonly used in colour representation in web design,
where colours are specified as RGB values in hexadecimal format. This further
illustrates its importance in various computing applications.
Situations Where Octal is Preferred and Why
Octal, or base-8, is a number system that uses the digits 0 to 7. While it is less
commonly used today, it has an important place in computing history,
particularly when working with binary data. Each octal digit represents three
binary digits (bits), making octal a convenient way to express binary numbers in
a more compact form.
Historically, octal was widely used in older computer systems that operated on
12, 24, or 36-bit architectures. In these systems, using octal made it easier for
programmers to work with data because it grouped binary digits into
manageable chunks. For example, in a 24-bit system, three octal digits can
represent the entire 24 bits (3 octal digits × 3 bits = 9 bits).
One common use of octal today is in UNIX and Linux operating systems, where
file permissions are represented in octal notation. In this context, each octal
digit corresponds to a different permission level for users.
It is still relevant in certain areas where its format aligns well with the system’s
architecture. For example, in situations where data is organized in groups of
three bits, octal can provide a clearer and more efficient way to represent that
data.
Number Advantages Limitations
System
Binary - Fundamental to all - Long and complex for human
computing readability
-Directly represents - Difficult to interpret for large
machine-level operations numbers
Octal - Compact representation of - Less commonly used in
binary data modern applications
- Historical significance in - Limited to specific use cases
older systems
Hexadec - More compact and - Still less intuitive than decimal
imal readable than binary
- Facilitates easier memory - May confuse those unfamiliar
management with base-16
In conclusion, binary, octal, and hexadecimal number systems each
serve critical roles in computing. Binary is the foundation upon which
all digital systems operate, while hexadecimal simplifies the
complexity of binary in practical applications like memory addressing.
Octal, although less common today, still holds historical significance
and is applicable in certain contexts. Understanding these number
systems is essential for anyone involved in programming, computer
science, or information technology.