Tut11 Number System - Exercises
Tut11 Number System - Exercises
Tut11 Number System - Exercises
= 165.48437510
A binary (base=2) number system is a special case of the positional number system in which the allowable
digits are 0 and 1 that are called ìbitsî. The leftmost digit of a binary number is called the most significant bit
(MSB) and the rightmost is called the least significant bit (LSB). Because the base of binary numbers is two,
i
bit bi is associated with weight 2 .
If the base of a number system is larger than ten, the digits exceeding 9 are expressed using alphabet letters as
a convention. For example, hexadecimal number system uses 1-9 and A-F; base-32 number system uses 1-9
and A-V. This example is shown in Table 1. One may then wonder how large-base number systems such as a
base-64 are expressed. Fortunately, we rarely use such a high-base number system because we find no real
advantages of using them in applications. Moreover, we can always convert them from any high-base number
system to a lower base number system, which is the subject of the next section.
Table 1. Decimal, binary, hexadecimal, and base-32 Number Systems
We have seen that the conversion between numbers with power of radix 2 can be readily achieved through
binary expression and regrouping of bits. This convenience led to utilization of hexadecimal (or octal)
numbers in representing binary numbers for many computer architecture related issues. For example, the
instruction LDAA (Load Accumulator A) of 68HC11 is encoded
as the binary number 100001102 , but for convenience of writing and reading it is usually
expressed in hexadecimal 8616 , from which we save time and spaces. Very often, hexadecimal,
octal, and binary numbers are interchangeably used in the computer architecture or microprocessor related
fields.
obtained by dividing 53510 again by 10. Due to this relation, the conversion to an arbitrary base
number can be obtained by repeated division of quotient and collection of remainders. A simple hand-
calculation method can be devised using the above relation. Let's express the integer division by the
following form.
Using this expression, Example 1.3.3 shows conversion from a decimal to a binary.
179 = 10110011 .
10 2
It should be noted that the above method can be extended to conversion of any other base. For
example, consider that we wish to convert a hexadecimal number to a base-5 number. Then, the
base-5 number can be directly converted by repeated division by 5 and collecting remainders.
However, this direct division means, you must divide the base-16 number by 5, which is not
simple because we are only used to decimal numbers. Thus, it is essentially wise to first convert
the hexadecimal to a decimal, and then convert it to base-5.
Similarly to the expression of integer part in Eq. (3), the fractional part can be written in the
following form:
Note that multiplying b to F in Eq. (4) produces d -1 as a part of the product. This representation
of number system is illustrated using Example 1.3.3.
Example 1.3.3: Fraction expression of positional numbers
Example 1.3.4: Convert a decimal number 0.625 to binary.
Exercise 3:
Convert 120(10) to binary