0% found this document useful (0 votes)
7 views42 pages

Understanding Number Systems: Binary to Decimal

The document discusses various number systems, primarily focusing on the decimal (base-10) and binary (base-2) systems, explaining their significance and applications in everyday life and computing. It highlights the efficiency of binary for electronic data representation and introduces key concepts such as base, place value, and expanded form. The chapter aims to familiarize readers with the relationships between different number systems and the arithmetic operations within them.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views42 pages

Understanding Number Systems: Binary to Decimal

The document discusses various number systems, primarily focusing on the decimal (base-10) and binary (base-2) systems, explaining their significance and applications in everyday life and computing. It highlights the efficiency of binary for electronic data representation and introduces key concepts such as base, place value, and expanded form. The chapter aims to familiarize readers with the relationships between different number systems and the arithmetic operations within them.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Chapter Binary and Other

Number Systems

robably the most common system for representing


numbers currently in use Is the decimal, or base-10,
THE DECIMAL
number system. This system identifies quantities NUMBER SYSTEM
using numerals from the set0)_ 2. 2-5, 464 87.9}
and forms the foundation for the Hindu-Arabic. .num- THE BINARY
ber system with which [Link] all likely to be familiar. NUMBER SYSTEM

A lesser-known fact is that the base=-10° number sys- THE HEXADECIMAL


tem is not the only numeration system we can use to NUMBER SYSTEM
express quantities, nor is it always the most efficient THE OCTAL
method. In fact, the underlying numeration system for NUMBERING SYSTEM
storing information electronically uses only the nu-
merals {O, 1} and is referred to as the binary, or base-2, BINARY AND 8421
system. (@fe)p)35
74 Chapter 3

By the time you have successfully completed the materials of this chapter, you
will be able to understand the relationships between the following number systems:
® Binary and decimal
@ Binary and hexadecimal
® Decimal and hexadecimal
® Binary and octal
@ Binary and 8421 BCD numbers

3 ; 1 THE DeciIMAL NUMBER SYSTEM


The most common “representation” form currently in use for numbers is the
decimal system. This is the system of numeration we use in our everyday lives
and is probably the one with which you are most familiar. Computer program-
mers use other number systems: binary, hexadecimal, and (to a lesser extent)
octal. Why this would possibly be the case may be unclear, but shortly the rea-
sons for the use of alternative systems will be made apparent. Of course, once
a new number system is introduced, the question of arithmetic within that sys-
tem naturally arises, and we will explore that question as well.
As a precursor to those issues, let’s provide some motivation for exploration
of the first of those systems, the binary numbers, and then devote some time to
formalizing the decimal number system and its terminology. As we'll see, the
process of computation in both systems uses the same underlying theory, but
the limitation of using fewer numerals requires us to take care in the implemen-
tation of our familiar arithmetic rules.
The binary system as applied to information assigns the numbers 0 and 1
to represent alternative “states,” such as off-on, no-yes, false-true, and zero-
nonzero. Alternative states are a matter of interest in any situation in which only
one of two mutually exclusive conditions can exist. Through clever combina-
tions of Os and 1s, any such data can be successfully represented numerically.
Computers and other electronic devices use binary numbers, in which integers
are represented through the use of the digits 0 and 1 exclusively. Everything in
your computer, for instance, is represented within the computer's memory only
in the form of 0s and 1s. Digital information stored on DVDs or CDs is also re-
corded in binary form, and all instructions between a computer’s hardware and
software are ultimately reduced to a simple “yes or no” determination.
There is some warranted concern that computation by hand with binary
and other number systems can be challenging, but computers are capable of
working with such numbers with ease. After we have developed an under-
standing of the procedure, we will be able to assign such tasks to mechanical
devices, comfortable with our ability to perform the computations by hand,
Binary and Other Number Systems 75

if need be. At the moment, it is unclear precisely how written information can
be expressed numerically using 0s and 1s, but we'll discuss that once the binary
system and its operations have been developed.
With those thoughts in mind, we turn to our familiar decimal number sys-
tem, within the framework of which we will familiarize ourselves with the ter-
minology we will employ in the other number systems. You will find that, as we
do so, terms that are familiar in the decimal system will have necessary modifi-
cations to analogous concepts within those other systems.
Our development begins with the introduction of the term base. An alter-
native term used in place of the word “base” is radix, but we will use the word
“base” in this text. The base of any number system is the number of distinct
characters employed for numeration when using that system. For instance, in
our common decimal system, there are 10 symbols we use for numeration: 0, 1,
2, 3, 4, 5, 6, 7, 8, and 9. All numbers within the decimal system are constructed
using those characters. The number of available characters is given as the “base
of the system,’ and hence the decimal system is also referred to as the base-10
number system.
Parenthetically, note that the other number systems use a different set of char-
acters that may be a smaller or larger set than that used in the decimal system.
The binary system, as mentioned previously, employs only the digits 0 and 1, and
therefore the base of that system is 2. It is natural to be puzzled regarding how other
numbers could be depicted using only those two digits, but please be patient! That
bridge will be crossed in the fullness of time, and how we could represent a decimal
number such as 7, for instance, using only 0s and 1s, will be made clear.
When a base- 10 digit is used in combination or series with other such digits,
producing multidigit numbers such as 318, we recognize that each digit occu-
pies a particular place within the number and that it has a unique place value,
.capturing its own meaning. ‘The place value is determined by the location of
the digit relative to the “decimal point.” Here we must be a bit careful, for in dif-
ferent countries different symbols may be used to mark the separation between
integral place values of a number and fractional values. In the United States, for
instance, a dot is used to represent the decimal point, while in Great Britain a
comma is employed. It might be more accurate to refer to the decimal point as a
decimal separator, to avoid confusion, and we will generally adopt that proce-
dure here. That being said, the term “decimal point” is widely in use, and hence
that term will be taken to be synonymous with “decimal separator.”
The decimal separator indicates the line of demarcation between the inte-
gral component of the decimal number and the fractional component. To the
left of the decimal separator we find the integral component of anumber, while
to the right we find the fractional component. You are likely to be familiar with
the place names for the decimal number system, but we will provide an example
as a reminder.
Consider the decimal number 174.3609. ‘The 1 at the start of the number is
said to be in the “hundreds” place, the 7 following it to be in the “tens” place,
and the 4 following that to be in the “ones” place. Digits to the left of the decimal
separator have their place names ending in “s” for all locations. To the right of
the decimal separator, the 3 is said to be in the “tenths” place, the 6 following it
76 Chapter 3

to be in the “hundredths” place, the 0 following that to be in the “thousandths”


place, and the 9 that terminates the number to be in the “ten-thousandths”
place. Note that digits to the right of the decimal separator have their place
names ending in “ths.”
From the place name of the digit, we obtain what is referred to as its place
value. For instance, in the previously mentioned example, 174.3609, the 1,
which occupies the hundreds place, possesses place value 100. The 7 has place
value 70 and so on. The digits to the right of the decimal separator have place
values such as (for the 6, as an illustration) six hundredths.
Using this notion of place values, we can generate the expanded form of a
decimal number. This exploded form decomposes the original number into a
sum of terms consisting of the individual digits within the number multiplied
against an appropriate power of 10. In base-10, you are likely to find the method
to be nearly self-evident, but the process may be slightly less natural when we
turn our attention to the other bases we will use, and so we'll risk a bit of tedium
at this point in order to lay the groundwork for the analogous structure in less
familiar bases.
Prior to demonstrating the process, consider an illustration of addition of
decimal numbers:
S00 80S a OT O09 =" 5219

The addition is fairly straightforward, but we will now view it in a rather uncon-
ventional manner. The symmetric property of equality tells us that the equa-
tion can be reversed, yielding
362.19 = S00RT OGae 2 a Uni 0.09

The expression now to the right of the equals sign forms the basis for the ex-
panded form we are intending. Note that the term “expanded” merely refers, in
this case, to a horizontal enlargement of the expression.
Each of the terms on the right side of the equation can be expressed as a
single digit multiplied by a power of 10, in a manner evocative of scientific no-
tation. That is,
382.19 = 300 + 80+ 2+ 0.1 + 0.09
=3x< 10°74 8 & 10° £210) 1 108 OOS 10
This final form is what we refer to as the expanded form. The entire number
is written as a sum of terms, each of which uses a digit from the numeration
system times a power of the base (which is 10 for the decimal number system).
Returning to 174.3609, we can decompose the number into the following sum:
100 + 70 + 4 + 0.3 + 0.06 + 0.000 + 0.0009

Then, proceeding as was done before, we can express the individual terms as a
digit multiplied by a power of 10, obtaining
1x10? +710! +4 x 10° +3 X10 946 X10 -+ 0 < 10 Oecl0
You may be wondering if it is necessary to show the term where the digit is zero.
In the fully expanded form of the decimal number, all the digits from the original
Binary and Other Number Systems 77

number should be shown for the sake of completeness and systematization. Thus,
it would technically be a mistake to suppress that term from the expansion.

BXAMPLE 3.1 Identify the place values for the digits and produce the expanded form of the
decimal number 5,386.724.
SOLUTION
For the digit 5, the place value is 5,000, since the 5 occurs in the thousands
place. For the remaining digits, we can list them systematically:
The place value of 3 is 300, the place value of 8 is 80, the place value
of 6 is 6, the place value of 7 is 0.7, the place value of 2 is 0.02, and the
place value of 4 is 0.004.
The expanded form of the decimal number, using the digits multiplied by pow-
ers of 10, would be
5 ME On esr 07 21238 6102 a6 KOLO Ge 102 2 102 4
We close out this section with a final bit of terminology: in a number repre-
sented in the base-10 system, the digit farthest to the left is referred to as the most
significant digit (MSD), and the digit farthest to the right is referred to as the least
significant digit (LSD). In the preceding illustration, the MSD is 5, while the LSD is 4.

Exercises
Answer each of the following, using complete sentences and proper grammar and spelling.
1. What is meant by the base of a number system, and what alternative
terminology can be used for the word “base”?
2. How do we determine the place value of a digit within a number?
3. What is meant by the expanded form of a decimal number?
4. What, if anything, is the difference between the word base and the word
radix?
In each of the following, identify the place name and place value of every digit.
DB als07 7..0.01879
O28 1.799 8. 10,002.00208

In each of the following, give the expanded form of the decimal number.
9. 874.983 Ve 202.9938
10-7 16:039.177 12. 123,654.92846

For the following, give the decimal number whose expanded form is shown.
13.3 < 10° +0 x 10° 4 10° $3 X 107 2'x 10°F ox 10°
1470 ~ 10-11
8 10
15s 00 Sle One 4108 4 0 + 5 10 +9 X «10°
162551084 9107 1 xX 07+" 9' & 10! + 5X 10° 4+ 3 X 104 +
vad ae
Zo. CGnaorer >

Referencing the problems indicated, for each of the following, identity the LSD and MSD.
17; Problem 5 21. Problem 9
18. Problem 6 22. Problem 10
{o> Problemy, 23Problenia LL
20. Problem 8 24. Problem 12

Give examples of decimal numbers satisfying the following conditions (answers will vary).
25. A whole number having MSD is 5 and LSD is 8.
26. A number having 0s in the tens, hundredths, and thousands places.

3 ;2 THE Binary NUMBER SYSTEM


The decimal system is likely to be familiar to you, but the binary system may
be somewhat less so. As was remarked in the initial comments of the chapter,
the binary (or base-2) system employs only two digits in all its numerical repre-
sentations, 0 and 1. Thus, a number expressed in the binary system would look
something like this: 100101101.11.
There is legitimate concern that this number would be mistaken for a
decimal number, and therefore we must adopt a convention that prevents this
confusion. When numbers are given in a base system other than the decimal
system, we shall display the base as a subscript following the number, as in
100101101.11, . This will exhibit clearly that the number shown is a represen-
tation in base-2, the binary number system. We could extend this concept to
cover the decimal system as well, following a number with a subscript of 10, but
we shall agree that if no subscript follows the number, it will be understood that
our representation is in base-10. Hence, 3 457.58 will be considered equivalent
to 3 457.589. This practice is much like the agreement we make that rational
numbers having denominator 1 are typically not expressed in fraction form,
and as long as we all agree on the stipulation, no confusion will arise.
The two digits in use in the binary system are sometimes referred to as bits.
A group of eight bits is called a byte, and half a byte (four bits) is called a nibble.
Different types of computers are capable of processing different lengths of data
segments at one time, some able to handle 8 bits, some 16 bits, others 32 bits,
and still others 64-bit segments. Our objective now is to develop familiarity
with representations of numbers in the base-2 system and to then construct the
arithmetic of numbers represented in this way.
We encounter similar terminology within the binary system as that devel-
oped for the decimal system. For one thing, numbers represented in the binary
system consist of the digits 0 and 1, each having a place value within the repre-
sentation. Unlike the places in the decimal system, however, the place values of
the binary system are powers of 2 rather than powers of 10.
Although they may be familiar to you, we should review some of the smaller
powers of 2 for the sake of clarity (see Table 3.1).
When we present a number in the binary system, the symbol that resem-
bles what we commonly refer to as the decimal point and that we identified
Binary and Other Number Systems 79

TABLE 3.1 Some of the Powers of 2


Te) i=1 ane) 4 |DY-Yeol
|aat-] Mee (l=

Ble
ale
BlAlSPRlMfelMlelAlLel
Cengage
©
2014
Learning

as the decimal separator in Section 3.1 will now be referred to as the binary
point, or the binary separator. The digit occurring immediately to the left of
the binary point has place value 2°, the digit to its left has place value 2', and
so on. The digits to the right of the binary point have place values 27', 2-7, 2-°,
and so on.
Consider the following illustration of a binary number and its interpreta-
tion in our more familiar decimal form: 101101.011,. Using the stated place
values for the binary number and noting that the first digit is in the 2° place
(we can tell this by counting positions to the left of the binary point, keeping in
mind that the initial digit to the left of that point is the 2° position), we obtain
1 0 ee ee Oe ee le eae ae
+i] Meee
T <o?
Converting to decimal form, this would be equivalent to
[peer
S20 Satidah Deeds Ob ahr
aoa aa Lotosl25
= 45.93/93

Shortly, we will formalize the method for conversion between binary and deci-
mal numbers, but before doing so, we present a bit more terminology. The digit
occurring in the highest place position within the number is referred to as the
most significant binary digit, or most significant bit (MSB). The digit with the
lowest place position, on the other hand, is said to be the least significant binary
digit, or least significant bit (LSB). In the example, both the MSB and the LSB
80 Chapter 3

were 1, which is almost always the case in a binary number. The only exception
to this situation would be where the MSB, LSB, or possibly both would be zero.
Because it is common to subdivide binary numbers into nibbles, as an aid
to readability, the preceding example would more likely be encountered as
LOTTO.
The illustration just considered provides an example of how to convert
from binary numbers to equivalent decimal numbers, but we will now formal-
izé that procedure. To convert from the binary to the decimal system, perform
the following steps:
1. Express the binary number in expanded binary form, showing each digit
of the binary number multiplied by an appropriate power of 2.
2. Convert the fractions obtained from the binary places to the right of
the binary point into decimal equivalents (this is not, strictly speaking,
necessary, but it is the convention we will adopt here).
3. Add the resulting decimal numbers together.

EXAMPLE 3.2 Convert 11 0101 0110, to decimal form.


SOLUTION
Since we do not see the binary point present, we assume (as is always the case
with decimal numbers) that the binary point occurs at the end of the number
and that it has been suppressed.
Noting the MSB occurs in the 2” place (we can determine this by count-
ing places from right to left, aware that the first digit represents the 2° place, or
observing that the power of 2 applicable to the MSB is always one less than the
number of digits to the left of the binary point), we proceed as follows:
Dx OE 2 Oe Seen)
1x 27+ 1«k2+ 0x2
= 512+ 256+0+64+04+ 16+0+44+2+0
= 854

EXAMPLE S*%3 Convert 1.0111 01, to decimal form.


SOLUTION
We note that the MSB is in the 2° place and recall the binary places to the right
of the binary point begin with 2” and have the powers decrease by 1 with each
advancing position to the right. Therefore, our representation expands to
1 2 0 KAS od xx ae oe ae
PEE alien al l
=1+0+—-+-+—+04+—
Ae 28 416 64
= 1+ .25 + 125 + .0625 + .015625
= 1.453125
—_—
eeeSSSSSSSSSSSSSSSSSSSMSMMFFfseses

Provided that we count our place locations carefully and compute our powers of
2 correctly, the conversion from binary to decimal form is fairly straightforward.
Binary and Other Number Systems 81

Unfortunately, moving in the opposite direction, from decimal to binary, is


somewhat more complicated. We will begin the process by considering the case
for integers and then turn to decimal fractions.
The process for the integral number case involves repetitious division by the
base value of the binary system, 2, while storing the remainders. The process
will continue until the quotient of the division becomes 0, which will ultimately
occur. The remainders, read in reverse order, yield the binary representation
of the decimal number. Care should be taken, by the way, to keep in mind the
practice of following a binary number with a subscript of 2 so as to avoid confu-
sion between decimal and binary numbers.
Consider the example 854, shown above to be the decimal equivalent to
11 0101 0110,. For that example, since the result is already known, we will de-
rive the binary form as an illustration (Table 3.2). It is useful to organize the
information in a tabular manner shown here, beginning with division of the
decimal number 854 by 2 and keeping track of the remainders and quotients
as we proceed. It turns out that the first remainder we obtain will be the least
significant bit and the final remainder of the process will be the most signifi-
cant bit, so we'll include a column in the table to indicate those values. Using
the values from the remainder column, read upward (remember, we continue
the process until the quotient of the division by 2 is 0, and then the binary rep-
resentation is found using the remainders, read in reverse order), would yield
the binary representation 11 0101 0110,, exactly as anticipated.
Take careful notice of the construction of the table and of the procedure
followed in the illustration. We have constructed four columns (though three

TABLE 3.2 Converting a decimal number to binary


DY WARiey al Remainder @TUrehd(=laie

427

Ne
82 Chapter 3

could have sufficed; it was not technically necessary to create a column within
which the LSB and MSB were identified, but that practice is both aesthetically
pleasing and informative), with the divisions shown in the left column, the re-
mainders in the second column, and the quotients in the third column. The key
column for our result is the column of remainders, column 2, which we read
upward to produce the binary equivalent of our decimal number.

EXAMPLE
3.4 Convert 167 to binary form.
SOLUTION
Reading upward in Table 3.3, using the remainder column, we obtain the binary
representation of the decimal number 167 as 1010 0111,. Note that we can check
this result to be sure that we have obtained the correct representation by revers-
ing our procedure to move from the binary representation to the decimal form:

TABLE 3.3 Converting a decimal number to binary


BN eyal isXlaatell
ae (=) ame @ 1Uleld{=l
ale

Cengage
2014
Learning
©

LX?Y+OxK 2 EP EO KF ee eee
= 128+04+32+0+01+44+2+4+1
= 167

The first two examples have looked only at integral decimal numbers. Now we
will consider the decimal fraction case and make the conversion in that instance to
binary representation. We remark at the outset that finding an exact binary repre-
sentation of such a number is not always possible, for reasons that might be apparent
from the limitations of the method of conversion. First we'll present the method and
then identify for what sorts of decimal numbers the method would fail.
The steps for conversion are as follows:
1. Multiply the decimal fraction by 2.
2. Store the integral part of the product.
Binary and Other Number Systems 83

3. Repeatedly multiply the remaining decimal fraction by 2 at each stage of


the process. Continue until the fractional part becomes 0.
4. The integral parts of the products, when read in order and placed after
the binary separator, yield the equivalent binary number.
You might perceive that the process would break down if the criteria in the
third step were never satisfied. In such an event, one stops the process of re-
peated multiplication at the point where the number of binary digits produced
is three times the number of digits in the decimal form of the number.
The choice of “three times the number of digits in the decimal form of the
number” might sound arbitrary, but there is sound support for that decision.
Three decimal digits are roughly equal in precision to 10 binary digits. For ex-
ample, compare the following numbers:
.001 = 1/1000 versus .000 000 000 1, = 1/1024 = .0098

These values differ by approximately two ten-thousandths and are (for all in-
tents and purposes) equivalent. In approximation, we can use the rule of thumb
that we will triple the number of digits in the binary representation from that of
the decimal representation and maintain the same level of accuracy.
Let’s consider several examples.

Pant Pie 5 Convert the decimal fraction .625 to binary form.


SOLUTION
To keep things organized, we will again employ a tabular method (Table 3.4).
Strictly speaking, this is not necessary, but it is convenient and helps us keep
track of the little details. The binary form is obtained from the “Integral Part”
column, read downward (rather than upward, as was done for the earlier ex-
amples), to yield .101, as the binary representation.

TABLE 3.4 Converting a decimal fraction to binary


- Product Integral Part Decimal Fraction ~
DES DANS :
2D,
& 2 = Oo
py!

EXAMPLE 3.6 Convert the decimal fraction .4018 to binary form.


SOLUTION
Although the decimal fraction has not become 0, we stop here because the
number of bits now obtained is 12, which is three times more than the number
of decimal digits in the original number. Consequently, the binary equivalent of
4018 would be .0110 0110 1101,.
It is surprising to find that even relatively simple decimal fractions might
have unending binary equivalent representations. We consider one such exam-
ple, the fairly tame decimal number 0.1, as an illustration.
84 Chapter 3

TABLE 3.5 Converting a decimal fraction to binary


Product Integral Part DY-Yotlagt-] umc-ceidelal
0

.8036 X 2 1

.6072 X 2 1

2144 X 2 0

4288 X 2 0

4304 X 2

4432 X 2
8864 X 2
ai
2014
Learning
Cengage
©

EXAMPLE 3.7 Convert the decimal fraction 0.1 to binary form.


SOLUTION
We have intentionally gone beyond the tripling of the original number of decimal
digits to illustrate the point mentioned prior to the example. Observe that the binary
digits generated become cyclic, and therefore the procedure will never terminate.
In a case such as this, we could adopt the convention for nonterminating, repeating
decimal numbers and place a bar over the sequence of repeating digits: 00011,

Should a decimal number contain both integral and fractional parts, those
parts should be converted to binary form separately and then combined across
the binary point to obtain the complete binary number.

TABLE 3.6 Converting a decimal fraction to binary


Product Integral Part Decimal Fraction
lee MSB
2X2=A4
AX2

ml
|
)A
alo
|

|
|=
o};};ol;He
ol;lolK|eK|o oo
SaaS)
Cengage
2014
Learning
©(
Binary and Other Number Systems 85

EXAMPLE 3.8 Convert the decimal number 167.625 to binary form.


SOLUTION
The integral and decimal fraction parts of this number were converted to
binary form in earlier examples, and thus we recall 167 = 1010 0111, and
.625 = .101,. Consequently, the complete binary representation would be 1010
0111.101,.

The Arithmetic of Binary Numbers


With an understanding established for the conversion between the familiar
decimal representation of numbers and the binary representation, we now turn
our attention to our well-known operations of addition and subtraction. The
operations can be performed in the binary system, using rules analogous to
those employed in the decimal system.
To add binary numbers, we use the following rules:
1. In binary addition, 0 added to 0 yields 0. That is, 0, + 0, = 05.
2. In binary addition, 0 added to 1 yields 1. That is, 0, + 1, = 1).
3. In binary addition, 1 added to 1 yields 0, with a carry of 1 to the place on
the left. That is, 1, + 1, = 0, with a carry of 1,.
4. In binary addition, adding the binary number 1, to itself with a carry
of 1, from the place on its right yields 1, with a carry of 1 to the place
on its left.

EXAMPLE 3.9 Add 11 0110, to 10 1011).


SOLUTION
We will use a table to organize the addition in order to make clear the process
of carrying and addition. The numbers shown in the table are understood to be
binary, and therefore we will omit the subscript of 2 for this illustration.

Step One: We add the binary digits in the right-most column, yielding a
result of 1, which generates no carried value (Table 3.7).

TABLE 3.7 Binary Addition process


Carry 0 =
1 0 | 1 0 2
= 8
1 0 0 1 1 .
Sum | | 1 :

Step Two: Continuing the process in the next column to the left, we add
the carried digit to the other binary digits. Following rule 3 above, the sum
of that column’s entries is 0, with a carry of 1 to the next column to the left
(Table 3.8).
86 Chapter 3

Carry | =

Sum é

Step Three: The process continues, following the stated rules of binary ad-
dition (Table 3.9).
TABLE 3.9 Binary Addition process
Carry 1 1 | 0 | j=
1 1 0 1 1 0. |2
1 0 1 0 1 oe
Stn ~ 0 0 1 |g
Step Four: (Table 3.10).
TABLE 3.10 Binary Addition process

2014
Learning
Cengage
©

Step Five: (Table 3.11).


TABLE 3.11 Binary Addition process

Cengage
©
2014
Learning

Step Six: (Table 3.12).


TABLE 3.12 Binary Addition process
Carry 1 1 0 2
1 an =
1 0 1 1 :
Sum 1 0 ot eiae ls
Step Seven: (Table 3.13).
TABLE 3.13 Binary Addition process
= 1 1 0 | l=
0 1 1 Crate
1 0 Leeds :
0 0 0 lea ©

The sum of the binary numbers is 110 0001,.


Binary and Other Number Systems 87

Subtraction of binary numbers is similar to addition, and there is an analo-


gous set of rules we must follow:
1. In binary subtraction, 0 subtracted from 0 yields 0. That is, 0. — 0, = 0).
2. In binary subtraction, 0 subtracted from 1 yields 1. That is, 1, — 0, = 1,.
3. In binary subtraction, 1 subtracted from 1 yields 0. That is, 1, — 1, = 0).
4 . We cannot subtract the binary number | from the binary number 0. We
can “borrow” from the digit to the left to perform the subtraction, with
the result that 0, — 1, = 1,, with the digit to the left of the 0 reduced by
1. In appearance, this would be equivalent to 10, — 1, = 1,.
The first few rules are probably fairly obvious, but the process of borrowing
needs illustration. We'll give a few examples to demonstrate the procedure, in-
cluding the decimal equivalents as a verification of the process.

EXAMPLE 3.10 Subtract 101 1101, from 111 1011,.


SOLUTION
It isn’t obvious what the decimal equivalents for these binary numbers would
be, and it would be good practice to convert each number from binary, so we'll
begin with that and then turn to the subtraction following the binary rules.
The subtrahend, 101 1101, = 64+ 16+8+4+4 1 = 93, while the minuend
1111011, = 64+ 32+ 16+8+2+ 1 = 123, and therefore we are (in decimal
form) intending to subtract 123 — 93, and hence the result should be 30, which
has binary equivalent 1 1110). It is ttemendously inconvenient to translate back
and forth between binary and decimal form in order to perform what should be
a relatively simple computation, so one would hope that the binary subtraction
algorithm would not be discouragingly complicated! We'll attempt that now,
organizing our work in Table 3.14 for clarity, as we did with addition. Note
the first two steps in subtraction follow the rules listed quite readily, since no
borrowing is involved. The third step will require borrowing, since we cannot
perform the 0, — 1, process directly. Keep in mind that the result will be a 1 in
the difference, with the number to the left of the 0 in the minuend reduced by
1 (Table 3.15). Note that now, as often is the case in base-10 subtractions, we
must borrow again (Table 3.16) and still again (Table 3.17)! The remaining steps
require no borrowing, and produce the result shown in Table 3.18.
TABLE 3.14 Binary Subtraction process
Borrow
1 it il 1 | 0 i! il

| 1 0 i 1 QuIg iE]
Difference iy 1 | 0 |
Cengage
©
2014
Learning

TABLE 3.15 Binary Subtraction process


Borrow |
1 1 i +0 0 1 1
1 | 0 1 1 1 | 0 1
Difference [ l 1 0
Learning
Cengage
©
2014

Learning
Cengage
©
2014

Learning
Cengage
©
2014

Our difference is the binary number 1 1110), as our work in the equivalent |
decimal representation predicted.

EXAMPLE 3.11 Subtract 1100.11, from 1111.01,,.


SOLUTION
Step One:

Borrow

Difference
2014
Learning
Cengage
©

Step Two:

Difference
2014
Learning
Cengage
©

Step Three:

Borrow

Difference
Cengage
2014
©
Learning
Binary and Other Number Systems 89

Step Four:

Borrow

Difference

Step Five:

Borrow

Difference
Learning
Cengage
©
2014
2014

Step Six:

Difference
Cengage
©
2014
Learning

thereiore, Lid Oly 1100015 10105.

You may have observed that in the computations shown to this point, we
have scrupulously avoided the appearance of negative numbers. There is a rea-
son for this, which we should discuss, at least to some degree.
It is common knowledge that negative numbers in base-10 are indicated
by the presence of a “minus sign” preceding the number, and while we could
attempt to introduce similar notation for base-2, this becomes problematic for
our work. The purpose for using binary notation is to ultimately represent al-
ternate states of equipment using Os and 1s, and therefore the use of a third
symbol, such as the minus sign, is an extravagance we cannot afford.
One solution, and one that we shall not explore at this time, is to adopt the
practice that a “sign digit” of 0 or 1, to indicate positive and negative values,
respectively, shall precede every binary number. That is, we could choose to
represent the number “-5” using the binary representation of 5, namely, 101,,
preceded by an extra digit of 1 to indicate that the number is negative.
In our work, this possible resolution to the problem muddies the waters to
an unacceptable degree, and therefore we shall not consider negative binary
numbers at this time. You should simply be aware, for the time being, that there
exist creative solutions to the representation of signed numbers in alternative
bases that do not require the incorporation of the minus sign symbol.
Up to now, we have presented addition and subtraction of binary numbers,
but it is also possible to multiply and divide binary numbers. As we will see,
multiplication proceeds in a manner similar to the method of base-10 multipli-
cations, but that it is actually easier because of the limited possible outcomes for
multiplications of binary numbers.
90 Chapter 3

There are four rules to remember when multiplying binary numbers (rec-
ognizing that these numbers are intended to be base-2 digits):
0x0=0
0Ox1=0
1x0=0
lbxt=1
Consider, using those rules, the multiplication of binary numbers 101, and
11,, following the rules of multiplying and carrying with which we are famil-
iar from base-10 multiplication. Observe that we are actually multiplying the
decimal numbers 5 and 3, so the outcome must be the binary form of 15,
which is 1111,, and that we are constructing the example within a reference
grid (see Tables 3.19 through 3.22), so it is easier to recognize the placement
of the numbers.
TABLE 3.19 Binary Multiplication process

Sopris
ee Oe eee
x 1 1 2014
Learning
Cengage
©

Much as is done with decimal number multiplication, we begin with the


rightmost digit of the lower number and multiply that quantity times the entire
upper number (Table 3.20).
TABLE 3.20 Binary Multiplication process

Cengage
© 2014
Learning

To serve as a placeholder, we put a 0 in the rightmost position of the next


product line, and then multiply again (Table 3.21).
TABLE 3.21 Binary Multiplication process

Cengage
©
2014
Learning

Now we will add the numbers in the product lines together, obtaining our
final result. Keep in mind the rules for addition of binary numbers and carrying
(Table 3.22).
TABLE 3.22 Binary Multiplication process
1 0 1
x 1 ie
1 0 ay:
1 0 1 ieee
1 1 1 ae ©
Binary and Other Number Systems 91

In a similar way, we can introduce binary division, which again mimics the
process in base-10 but is again easier because of the simplified rules of binary
addition and subtraction. Recall the base-10 procedure directs us to divide the
number constructed from the first sequence of digits in the dividend whose
value is at least as great as the divisor, placing the whole number result in the
quotient. That whole number is multiplied by the divisor, the product placed
beneath the dividend, and we subtract.
Following this, the next digit in the dividend is brought down, and we it-
erate the process until the outcome of the subtraction becomes less than the
divisor and no further digits can be brought down from the dividend, at which
time the division process terminates. The final difference is referred to as the
remainder of the division.
Consider the following example, which demonstrates that the process in the
binary number system is analogous.

EXAMPLE 3.12 Divide 1011, by 11).


SOLUTION
11)1011 As with base-10 division, note that it is not possible to multiply 11,
by an integer to obtain 1,, or 105, so our focus is on what the divisor can be
multiplied times to be less than or equal to the binary number 101,. Keeping
in mind that our only true choices are to multiply by 0, or 1,, it is apparent
that the only suitable choice would be to multiply by 1,. We put a 1 in the
quotient, multiply by 1,, and place the product beneath the dividend, and
subtract:
1
11)1011
i
101 Note that we have “brought down” the next digit in line.
Repeating the division, we obtain

The “10” in the final line, being less than the divisor, must be our remainder,
and hence our result is 11,, with remainder 10).
In decimal form, the problem was to divide 11 by 3, and thus our
binary result should be equivalent to a quotient of 3, with remainder 2. A
quick conversion of the binary result shows that this is precisely what we
obtained.
92 Chapter 3

An Application of Binary Numbers: ASCII


When we began our discussion of the number systems, we indicated that all
data stored on your computer and other electronic devices were recorded in
binary form, including nonnumerical data. It seems appropriate to now investi-
gate, in an introductory manner, how this is done.
You may be familiar with ASCII (American Standard Code for Informa-
tion Interchange). This was developed from a foundation of telegraph codes
and is a means through which we can encode the English alphabet using binary
representation. A total of 95 printable ASCII characters exist and are associated
with decimal numbers from 32 through 126, inclusive (the reason for this span
of enumeration is not significant to us here, but we should mention for the sake
of completeness that there are other “control” characters, now mainly obsolete,
that were represented by the preceding whole number values).
How this relates to your computer may not be immediately clear, but consider
your computer’s keyboard and look at all those keys that generate a “printable”
character. There are 47 of them, and with the “Shift” key providing a secondary
character assignment to each key, we double the total number of ASCII charac-
ters to 94, with the 95th being the space bar (an “invisible” character).
When the printable characters are numbered in this manner and their rep-
resentation is converted to binary form, we gain the capacity to represent writ-
ten material using 0s and 1s exclusively. For instance, consider the binary string
0010 0000. This is the binary equivalent of the decimal number 32 and has been
assigned as the representation for the invisible character, or space. You may
wonder why the number begins with what appears to be a pair of superfluous
Os, but this is done merely so that every character is represented using one byte.
Here is a sample of binary code: 01001101 01111001 00100000 01100011
01100001 01110100 00100000 01101001 01110011 00100000 01101111
0110111000100000 01101101 01111001 00100000 01101100 01100001 01110000
00101110. While it is totally nonobvious what this means, we can tell you that it
represents the phrase “My cat is on my lap.” Note that there are precisely as many
bytes as characters in the phrase, if one includes spaces and the period.
The key to deciphering this message—or any other phrase represented in bi-
nary form—is to have in hand the assignment of letters, numbers, and symbols
to their identifying binary numbers, and then the translation is straightforward.
For instance, the character “M” has been assigned the binary representation
0100 1101, and that is the first byte of information given in the encryption of
the phrase relating my cat’s location. Table 3.23 shows the overall representation
of the 95 characters in binary form.

EXCAR PEE S13 Express the statement “It was a dark and stormy night. in binary form.
SOLUTION
We begin by considering the table relating the ASCII symbols and their binary
equivalents. We only need to locate the bytes representative of the individual
characters, maintaining an awareness that “I” is not to be confused with “i” for
the purpose of encryption. As we can see from the chart, the representation of
Binary and Other Number Systems 93

TABLE 3.23 Binary Codes


Char Bin Char Bin Char Bin
(sp) 010 0000 @ 100 0000

Sie PWR OTH


i al dua c

ae ) Sn
010 1001 I 100 1001 110 1001
? 010 1010 J 100 1010
” 0101011 k 110 1011

0 o110000 =|P|
= 101 0000
1 011 0001 pf 111 0001
2 011 0010 R 101 0010
3 011 0011 S 101 0011
4 011 0100 i 101 0100 111.0100
5 0110101 U 101 0101
6 011 0110 Vv 101 0110
| 7 0110111 Ww 101 0111 w
8 011 1000 x 101 1000 x 111 1000
9 011 1001 Y 101 1001 y 111 1001
011 1010 Z 101 1010 ; 111 1010
as 011 1011 1011011 { 111 1011
F < 011 1100 \ 101 1100 | 111 1100
= 011 1101 101 1101 111 1101
> 011 1110 A 101 1110 : 1111110
a 2 ting = 101 1111 (del) } 11111 Cengage
©
2014
Learning
94 Chapter 3

“I” is 0100 1001, and from there we can proceed to obtain all the binary repre-
sentations, with the following result:

01001001 01110100 00100000 01110111 01100001 01110011 00100000


01100001 00100000 01100100 01100001 01110010 01101011 00100000
01100001 01101110 01100100 00100000 01110011 01110100 01101111
01110010 01101101 01111001 00100000 01101110 01101001 01100111
01101000 01110100 00101110

Naturally, producing the representation by hand is highly tedious, and we wont


make a practice of doing so. This example is intended only to demonstrate that,
in principle, we could express all written documents in binary form.

Exercises
For each of the following problems, answer in complete sentences, using proper spelling
and grammar.

What is meant by the mathematical term “bit”?


What is meant by the mathematical term “byte”?
What is the “most significant bit” in a binary number, and what is its
abbreviation?
What is the “least significant bit” in a binary number, and what is its
abbreviation?

For each of the following decimal numbers, convert to binary form.


. 1,865 10. 1,038
6 nn62,093 Lie 18.125
ifag U5 Wee 21338
8. 4733 lee 0.15
9 5 193,207

For each of the following binary numbers, convert to decimal form.


110 1011, is 110.011,
101, 19, 0.1101,
1110 1001, 20. 1010 1101.11,
Wee Lelie ce Dil 0.0000 001,
Perform the following binary additions. Checke your work by converting the addends and sum to
decimal form and adding these to show that the same result is obtained.
on 1101, + 1011, 24. 1.0011, + 0.111,
ZS 10: 1101, + 1 0110, 25. 100.001, + 1101.011,
Binary and Other Number Systems 95

Perform the following binary subtractions. Check your work by converting minuend, sub-
trahend, and difference to decimal form and subtracting these to show that the same result is
obtained.
26. 1101, — 1011, 28. 1001 1101, — 101 1100,
27. 110,— 11, 29. 11.0111,— 1.1,
Perform the following binary multiplications. Check your work by converting the factors and
the product to decimal form and multiplying these to show that the same result is obtained.
30. (1101,)(101,) svar aieyG als
31. (10 1101,)(110,) 33. (1001,)(1010,)
Perform the following binary divisions. Check your work by converting the dividend, divisor,
and quotient to decimal form and dividing these to show that the same result is obtained.
34. 101101, + 1001, 36. 10000100 1101, = 1 0001,
Som VDOT So WIE 37. 1000 0010 0000, = 10 0000,

Convert the following phrases to ASCII representation.


38. Now is the time for all good men to come to the aid of the party.
39. It is fun to write in binary.
Convert the following binary representations into English, using the ASCII conversion chart.
40. 01001000011000010111011001100101001000000110000100100000011
01101011000010111010001101000011001010110110101100001011001
11011010010110001101100001011011000010000001100100011000010
1111001
41. 01001101011000010111010001101000001000000110100101110011001
00000011001100111010101101110

3 3 THE HEXADECIMAL NUMBER SYSTEM


As we've already discussed, all the information on your computer's hard drive
is stored in binary form. We have also mentioned how, using the ASCII system,
we can represent English statements using only Os and 1s. The motivation for
the choice of base-2 stems from the fact that it is the easiest way for current
digital structures to store, retrieve, and act on information.
The alternative states of off-on, no-yes, false-true, negative-positive, and
so forth lend themselves ideally to being associated with either a 0 or a 1. This
is significant because digital circuitry, for instance, employs transistors that
are electronically switched either on (1) or off (2) to represent the value of
a binary variable. Magnetic storage devices, like computer hard drives, rep-
resent data with sectors that are magnetically polarized to be in a state that
is either positive or negative. Optical media storage, like CDs or DVDs, are
etched thermally by a laser so that particular portions of the disk are either
96 Chapter 3

reflective or nonreflective. Because of the omnipresence of binary numbers in


modern technology, it is essential that electrical engineers, computer scien-
tists, and information technology professionals develop fluency with binary
numbers.
However, while computers operate quite efficiently with the binary num-
ber system, we humans sometimes encounter difficulty working with repre-
sentations of numbers in that form because of the number of digits involved
in the representation. As an illustration, the decimal number 489 has binary
representation 1 1110 1001,, requiring nine digits. For this reason, it is some-
times desirable to use yet another number system, the hexadecimal system,
sometimes referred to simply as “hex” for the sake of brevity, which humans
can read with much greater facility. The name of the system is derived from
a combination of the Greek word “hexa,? meaning six, and the Latin word
“decima,’ meaning ten.
Hex is a system that uses sixteen characters for number representation, and
thus we would refer to it as the base-16 number system. Since 16 is the fourth
power of 2, we can imagine that some relationship might exist between base-2
and base-16 that was not present for base-10, and therefore the conversion be-
tween the two forms might be performed more readily. We will explore that
matter shortly, but first we need to learn more about hex.
Because hex has radix 16, we require 16 symbols to depict numbers in the
system. The characters employed are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and FE
The symbol A corresponds to the decimal number 10, B to the decimal number
11, C to the decimal number 12, D to the decimal number 13, E to the decimal
number 14, and F to the decimal number 15. This may seem bewildering, but it
merely requires practice to attain familiarity and fluency with the new represen-
tation symbols, and the reduction achieved in the length of the representation
of numbers will be well worth the effort.
In general, a number written in hex is approximately one-fourth as long as
a number expressed in binary form. We have mentioned the binary equivalent
to the decimal number 489 as 1 1110 1001, and now (without proof for the mo-
ment) reveal that the hex form of the number is 1E9,,. Of course, you might
rightly argue that the equivalence of this number to 489 is no more obvious
than was the binary representation, but keep in mind that the underlying pur-
pose for the use of hex is the combination of the shorter representation of the
number with the ease of conversion between binary and hex, as opposed to the
conversion between binary and decimal.
Just as the binary and decimal systems were based on powers of 2 and 10,
respectively, hex is constructed using the powers of 16. It would be surprising
(and, to be frank, somewhat disturbing) if you possessed ready knowledge of
the powers of 16, and thus we will list some of the powers here in Table 3.24 for
reference. The digits of a number written in hex are weighted by position, just as
in the decimal and binary systems. The place values express powers of 16, and
the hexadecimal point, or hexadecimal separator, delineates the integral and
hexadecimal fraction components of the number. For brevity, we can refer to
this as the “hex point? or “hex separator.”
Binary and Other Number Systems 97

TABLE 3.24 Some of the Powers of 16


16° .000244140625
1g“ .00390625
16a? 0625
16° 1 2
16! 16 :
Py Ge 256 :
at 163 4096 :

The Relationship between Binary and Hex


We have hinted that a strong relationship exists between binary numbers and
hex numbers, and since that is the premise for the expenditure of labor to learn
hex, we will begin by exploring that connection. Let’s start with a list of the
first 16 whole numbers, their binary expression, and their hex representation
(Table 3.25). You can see that we have opted to show each of the binary digits
as nibbles in order to create a four-digit representation of each binary number
in the table. Observe that each of the hexadecimal digits represents exactly one
nibble of binary information. Manual conversion between binary and hexadeci-
mal is very easy: you need only do substitute one hex digit for every nibble of
binary information or vice versa.

TABLE 3.25 Decimal Numbers Expressed in Binary and Hex Forms

Decimal Number Binary Form Hex Form


0
1
2
3
4
5
6
7 O111, Te
8 1000, 816
9 1001, 916
| 10 1010, Tee
nm 1011, ty
12 | 1100, Cs :
13 | 1101, iy, g
14 1110, Ei. 3
15 nome Fe 5
98 Chapter 3

EXAMPLE 3.14 Convert the binary digit 11 0110 1111 0110, to hex.
SOLUTION
Using the methods for conversion to decimal numbers, we can show that this num-
ber is 14070 in base-10, but this is not relevant for our exercise here. If we expand the
first nibble to include two 0s preceding the 1s, we obtain the equivalent form:
0011 0110 1111 0110,

Now we'll replace each nibble by the hex number determined from the table
above. This yields
36F61.
This is truly astonishing, assuming that it is true. We will now confirm its
accuracy.

As was done with binary numbers, we can use powers of the base to convert
hex numbers to our familiar decimal form. That is, if we have a number such
as 36F6,,, we can use the powers of 16 to convert the number to base-10. This
illustration will serve to verify the result obtained in the previous example:

3X 16+6X 167+ 15 X 16' +6 X 16°


= 12288 + 1536 + 240 + 6
= 14070

This is precisely what we had indicated was the decimal equivalent to the binary
number 11 0110 1111 0110,, and this indicates that our method for conversion
is accurate.
Conversion from hex to binary is the exact inversion of the procedure, with
the hex digits replaced, in order, by the related nibbles of binary information.

EXAMPLE 3.15 Convert the hex number BA085,, to binary form.


SOLUTION
Referencing our table of binary-hex equivalents, we observe the equivalent nib-
bles are B ~ 1011, A ~ 1010, 0 ~ 0000, 8 ~ 1000, and 5 ~ 0101. Therefore, our
equivalent binary number is 1011 1010 0000 1000 0101.,.
We will confirm the equivalence by producing the decimal form of each of
the two numbers and showing that they agree:

BA085,,
= 11 X 16°+ 10 X 166+ 0X 167+ 8X 16'+5x 16°
= 720896 + 40960 +0 + 1284+ 5
= 761989
1011.1010.0000.1000 0101, = 2)? 4.27 -o' = eee a7
= 524288 + 131072 + 65536 + 32768 + 8192
+128+4+1
= 761989
Binary and Other Number Systems 99

As in the explanation above, we construct the expanded form of the hex number,
utilize the powers of 16, and simplify to obtain our result:
BA085,,= 11 X 16*+ 10 X 16° + 0 X 167+ 8 X 16'+5 x 16°
= 720896 + 40960 + 0+ 128+ 5
= 761989

The Relationship between Decimal and Hex


We essentially glossed over the method for transitioning from hex to decimal
form. The procedure simply involved multiplication of the hex digits by the ap-
propriate power of 16 and simplifying the result.
Conversion from decimal to hex, however, is slightly more complicated.
Naturally, one possible approach is to convert decimal numbers to binary, from
which the translation to hex is a triviality. Naturally, this is unsatisfactory, since it
would involve a superfluous intermediate step that we would much rather avoid.
The procedure is much as we saw in the case of the binary number system,
and the method for converting is analogous. As we did in the binary case, we
will address the integral and decimal fraction cases separately and then com-
bine the results to handle mixed numbers.
For integral valued decimal numbers, we divide repeatedly by 16, maintain-
ing a record of our quotients and remainders, proceeding until a quotient of 0
is attained. The hex number is then constructed using the remainders of the
successive divisions, read in reverse order.

EXAMPLE 3.16 Convert the decimal number 936 to hex form.

SOLUTION
The hex equivalent is constructed using the remainders, read upward through
the column: 3A8,, (Table 3.26).

TABLE 3.26 Converting a decimal number to hex

| Remainderas | Remainder | |
Division _DecimalNumber___asHex Quotient|
2014
Learning
gage
Cer

EXAMPLE 3:12 Convert the decimal number 1876923 to hex.

SOLUTION
Having reached a quotient of 0, we obtain our number in hex form, using the
remainder as hex column, read upward: 1CA3BB,, (Table 3.27).
In the case of decimal fraction numbers, we follow the algorithm we devel-
oped in the binary case, multiplying repeatedly by 16 and keeping track of the
integral part of the products.
100 Chapter 3

TABLE 3.27 Converting a decimal number to hex

Remainder as Remainder
DIMEola DY=Yotlaatel@elaal ex=16 as Hex (@]Ureld(=laie

ieewieearst 117307,

117307 sa316 11 B Ado

7331-= 16 2 458
458 = 16 A 28
28
=~ 16 12 €
Leel6 1 Cengage
©
2014
Learning

As was the case for binary representations, we list the steps as follows:
1. Multiply the decimal fraction by 16.
2. Store the integral part of the product and convert it to hex form, if needed.
3. Repeatedly multiply the remaining decimal fraction by 16 at each stage
of the process. Continue until the fractional part becomes 0.
4. The integral parts (in hex form) of the products, when read in order and
placed after the hex separator, yield the equivalent hex number.

As a practical matter, we should remark that the conversion rarely results in


terminating hex representations, but in the example that we will explore, the
outcome will be nice, by design.
Suppose we wanted to convert .31640625 to hex. The process would be as
shown in Table 3.28. The equivalent hex number would be .51,..

TABLE 3.28 Converting a decimal number to hex

Integral Part as Integral Part Decimal


MTU adl elifer-hareya Decimal Number as Hex Fraction
31640625 X 16 0625
.0625 X 16
Cengage
2014
©
Learning

EXAMPLE 3.18 Convert the decimal number .000202026367188 to hex form.


SOLUTION
The recurrence of the decimal fraction .24 indicates that we have reached
the beginning of a repetition of the hex number, and thus our representa-
tion is (reading the integral part as hex column, downward) .000D3D70A,,
(Table 3.29).

EXAMPLE 3.19 Convert the decimal number 1876923.000202026367188 to hex form.


SOLUTION
Combining the results of Examples 3.15 and 3.16, we obtain the equivalent hex
number: 1CA3BB.000D3D70Aj«.
Binary and Other Number Systems 101

TABLE 3.29 Converting a decimal number to hex

Hal<=te]¢-]@erclas faltsteleclt
as Decimal Part as Decimal
Multiplication Number Hex Fraction
000202026367188 X 16 |
=o «| «003232421875
003232421875 X 16 | 0 «| «05171875
5PM)

Cengage
©
2014
Learning

It is amusing to consider the translation of the result of the last example


into binary form. Recalling that we need only translate the hex number into
equivalent nibbles, we find
0001 1100 1010 0011 1011 1011. 0000 0000 0000 1101 0011 1101 0111 0000 1010,

You are probably aware that your computer monitor uses the primary colors of
light (red, green, and blue) to display all other possible colors. The device uses
different intensities of each primary color, combines them, and concentrates
them onto a pixel (picture element) of the screen. The colors range from white
(in which 100% of red, green, and blue are displayed in the pixel) to black (in
which 0% of red, green, and blue are displayed).
HTML manages the RGB combinations by using six-digit hex numbers,
called color codes. The color code designation begins with a pound symbol (#)
followed by the hex number, which is actually a combination of three two-digit
hex numbers denoting RGB intensities. These allow you to set the red, green, and
blue values of a color, and the combination of the relative strengths of the indi-
vidual colors produces the color desired. The greatest intensity of any particular
one of the individual primary colors is FF, which has decimal equivalent 255.
For instance, the color orange can be produced by an intense application of
red and a mildly strong green, combined with a relatively weak application of blue.
The color code for orange is #FF8040, which denotes the strongest (FF) possible
red, a strong but not overly powerful (80) green, and a fairly weak blue (40).

Exercises
Answer the following questions in complete sentences, using correct spelling and grammar.
1. In your own words, explain the process of converting binary numbers to
hexadecimal form.
2. In your own words, explain the process of converting hexadecimal num-
bers to binary form.
102 Chapter 3

Convert the following binary numbers to hexadecimal form.


3. 1101 1100, 5 UGTA OIDs
Perl bi, 7 GROINGT
5. 11011 1101, 8. 0.0101 11,
Convert the following hexadecimal numbers to binary form.
9. 33:6 DR Oa7.2 4.2
10> 9F7;¢ 13: AF CAD,
ig ete
Convert the following decimal numbers to hexadecimal form.
[Az 16. 4097
15. 2013 17, 3001
Write a brief explanation for the following question.
18. You may recall from your experience that certain colors “combine” to
form other colors. For instance, “Yellow and blue make green.” That is,
if you were to use a mixture of yellow pigment and blue pigment and
blend them, the result would be green pigment. Are the RGB codes con-
structed in such a way that addition of RGB codes yields the “blended”
code? Investigate this supposition and explain your conclusion.

3 A THE OcTAL NUMBER SYSTEM


The octal number system, or base-8 system, is constructed in a manner similar
to the previously discussed systems. In this case, the radix is 8, and all numbers
are represented using only the digits 0, 1, 2, 3, 4, 5, 6, and 7. We can define the
octal separator (or octal point) just as we did for the other systems and again
define the place values using the powers of the base.
As was the case with hex, our primary interest in octal numbers lies in the
ease of conversion between numbers represented in that form and binary. Just
as hex numbers were significantly shorter than their binary equivalents, octal
numbers typically use one-third the number of digits as the associated binary
number. A natural question might be why we would need octal numbers, since
we have worked so hard to develop and understand hex, and the rationale lies
in the observation that octal numbers use familiar digits, while hex requires
the additional symbols A through EF, and this can be confusing at first sight.
Because, in practice, both hex and octal serve the same purpose, we can prob-
ably make do with one or the other. Nonetheless, we are well served by devel-
oping fluency with both numeration systems in case a particular application is
dealt with more conveniently in one form than the other.
If you understood the method for converting a new base system to and
from the decimal system, then you will be comforted to know that the method
is identical for the octal system. To translate an octal number into decimal form,
produce the expanded form of the number (using the digits multiplied by the
Binary and Other Number Systems 103

appropriate powers of 8) and simplify. This process is well known to us by now


and will be left for the exercises.
As was the case for binary and hexadecimal numbers, conversion from dec-
imal form into the new base is trickier, so we will demonstrate the procedure to
ensure clarity. For an integral number, we divide by 8 repeatedly, maintaining
track of the remainders and proceeding until we reach a quotient of 0. Reading
the remainders (converted to octal form) in reverse order and identifying that
the number is octal by appending a subscript of 8, we obtain the base-8 repre-
sentation of the number. Let’s consider an example.

BAA MPLE 3 42.0 Convert the decimal number 1762 to octal form.

SOLUTION
As was done before, we use a tabular approach in Table 3.30 to make the process
both systematic and well organized. Reading the remainders (as octal numbers)
in reverse order, we obtain the octal equivalent to 1762 as 3342s.

TABLE 3.30 Converting a decimal number to octal

~
Remainderas | Remainder
as —
Division |DY=Yeol |aat-](01a)
ek=] qmmn @Xeie-]
6 ]aa]el—] ame @ LUlold(—lale
1762 5 8
220 = 8 2
27=8
348 ©Cengage

EXAMPLE 3.21 Convert the decimal number 276315 to octal form.

SOLUTION
Having reached a quotient of 0, the process terminates, and we can read our
base-8 representation as 1033533, (Table 3.31).

TABLE 3.31 Converting a decimal number to octal

Xl aatelialels) arch Remainder as


BM Eela DY=Yellaat-1@\ ela) ol-) amin @Xeae-] [01 aa)ol-] ame @1Uleld(—lale

©Cengage
Learr

If we turn to the case where the decimal number is a decimal fraction, we


utilize the same process as was employed in base-2 and base-16, multiplying
repeatedly by the radix and keeping track of the integral part of the product
104 Chapter 3

(in octal form) until the fractional part of the number is 0. The octal form of
the number is then obtained by reading the integral part of the product in
advancing order and appending a base-8 subscript.
e
ee ee ee ee
T ee

EXAMPLE 3.22 Convert the decimal number .00625 to octal form.


SOLUTION
Note that the recurrence of the decimal fraction .4 indicates to us that we have
reached a point of repetition, and thus the octal form of the .00625 is .003146s
(Table 3.32).

TABLE 3.32 Converting a decimal number to octal

Integral Part Integral Part


as Decimal as Octal Decimal
Multiplication Number Number Fraction
. 00625 x 8
05xX8
AX 8

Cengage
©
2014
Learning

As we saw with the other bases, if the decimal number were to be a combi-
nation of integral and decimal fraction parts, we would obtain the base-8 equiv-
alences independently and then combine the results. Such an illustration will be
left for you to attempt in the exercises.
You might be wondering why the base-10 decimal fraction numbers seem to
often generate repeating decimal representations in base-2, base-8, and base-16,
and this is a question worthy of investigation. The answer has to do with the fact
that all the digits to the right of the binary, hex, and octal separators are powers of
2 and have no other prime factors. A decimal number such as .1, which we saw in
the base-2 section has a nonterminating binary equivalent, has fraction form 1/10,
the denominator of which is not a power of 2, and has a prime factor of 5. Such
numbers will always have nonterminating decimal equivalents in the bases we
have examined because of this relationship between the denominators.

Conversion between Binary Form and Octal Form


We saw that one of the virtues of hexadecimal numbers was the ease with which
we could translate between that base and binary form. A similar relationship
exists between octal numbers and binary numbers.
Recall that, when converting from binary to hex form and vice versa, the key
step was the recognition that each hex digit had an equivalent four-digit base-2
representation and that we could translate from one form to the other through di-
rect substitution of the equivalent hex digit for the four binary digits and vice versa.
Binary and Other Number Systems 105

For base-8, each of the eight octal digits is equivalent to a three-digit binary
number, and the translation between octal and binary forms merely requires
that (for translation from binary to octal) the three binary digits be replaced by
their octal equivalent. Conversion from octal to binary is the precise inversion
of that procedure.
Before viewing some examples, let’s produce the equivalencies for our refer-
ence in Table 3.33.
TABLE 3.33 Equivalencies between decimal, binary, and octal numbers

Decimal Number Binary Equivalent | Octal Equivalent

tol sala 1

ime eronad basair rm 2


So
4
5
6
7 Cengage
©
2014
Learning

EXAMPLE 3:23 Convert the binary number 11 0101 1101 1001 1111, to octal form.
SOLUTION
In order to make the conversion more obvious, we will begin by reorganizing
our binary number, divided into nibbles (as is the common practice) so that its
digits are in clusters of three: 110 101 110 110 011 111,.
Next, referencing the table of equivalencies, we will replace each grouping
of three binary digits into its octal equivalent. That the number is octal will be
indicated, as usual, by the appended subscript of 8 at the end of the representa-
tion: 656637..

EXAMPLE 3.24 Convert the binary number 1 0110 1011 1001, into octal form.
SOLUTION
In this case, note that the binary number contains 13 digits, and thus re-
organization into groups of three cannot be done with the number in its
present form. You may recall that this issue was encountered in our con-
sideration of hex numbers, and it was decided that we would incorporate
enough preceding 0s to allow for the subdivision into groups required. The
smallest multiple of 3 that is greater than 13 is 15, and hence we must in-
clude two preceding 0s to our number and then perform the reallocation of
digits into sets of three:
001 011 010 111 001,

Again, we consult the table of binary-octal equivalencies, and the translation to


octal form is immediate:
13271,
106 Chapter 3

oe
ee eee
EXAMPLE 3.25 — Convert the octal number 7321, to binary form.
SOLUTION 7
Each of the octal digits is replaced by its binary equivalent, yielding
111 011 010 001,

In order to maintain our practice of exhibiting binary digits broken into nib-
bles, we reorganize this expression in groups of four digits, obtaining 1110
1101 0001).

Exercises
Answer the following questions using complete sentences, with correct spelling and grammar.
1. What is the difference between binary numbers and octal numbers?
2. What is the process for converting binary numbers to octal numbers?
3. What is the process for converting octal numbers to binary numbers?
Convert the following decimal numbers to octal form.
4, 133 626135
5. 2984 PROQS T/L 25

Convert the following octal numbers to decimal form.


Gag 10. 255.43,
9. 6452, iE RO si 23

Convert the following binary numbers to octal form.


IZ ITO O1M0; 14 O01
137 LOC LIE Vo te

Convert the following octal numbers to binary form.


16P 173; 18. 4625.553.
We Ooo 197507165,

3 :5 BINARY AND 8421 Copes


A BCD (binary-coded decimal) code is a device used to express one of the
10 decimal digits (0 through 9) using a nibble of binary digits. Such codes are
used extensively in various applications of digital logic, such as encryption de-
vices, arithmetic circuits, and so forth, as well as in computer applications that
provide error detection and correction. We will briefly explore several of these
codes and indicate why one might be preferable over another.
Perhaps the most straightforward method for encoding the decimal digits
in binary form is the 8421 BCD code. This is actually the direct representa-
tion of the decimal digits in their binary equivalent form and hence is a code
Binary and Other Number Systems 107

for which we know the basis. Note that this is not the same as representing the
complete decimal number in its equivalent binary form—far from it! The code
translates the individual decimal digits into their binary equivalents, displaying
the number in a string of nibbles. The representations of the digits are shown in
Table 3.34 as a reminder of our past work: because we are using nibbles to rep-
resent the 10 decimal digits and there are 2* = 16 actual nibbles possible, there
are six nibbles that are considered invalid in 8421 BCD code.

TABLE 3.34 8421 BCD equivalents for decimal numbers

Decimal 8421 BCD


Number Representation
0000
0001

2014
earning

©Cengage
L

Note that when a decimal number is represented in BCD code, the sub-
script of 2, denoting the base-2 representation of a decimal number, is not used.
That is, if we wanted to represent the decimal number 368 in BCD, we would
have the representation as 0011 0110 1000, and there would be no subscript of
2 at the end of the string of nibbles.
A code such as 8421 BCD is referred to as a weighted code, which means
that the representation of the base-10 digits is performed using a four-bit com-
bination for which each position within the nibble carries a particular weight of
8, 4, 2, or 1. That is, when we give a nibble of BCD code, such as 1001, the first
digit carries a place weight of 8, the second a place weight of 4, the third a place
weight of 2, and the final a place weight of 1. Because this is precisely the man-
ner in which the first four places of binary numbers were defined, this terminol-
ogy may seem a bit superfluous, but there are other BCD codes, such as 2421
BCD, for which the place weights are not the same as binary representation of
decimal numbers. In that code, the nibble 1101 would be the representation of
the decimal digit 7 because (in expanded form) it is equivalent to 1 x 2 + 1 X
AcOX 2X LS
In some texts, there is an effort to make explicit the point that a string of
nibbles is representative of a decimal number in BCD code by appending a
subscript of BCD where one would typically see the base identifier. That is, the
BCD representation of the decimal number 368 could be given as 0011 0110
1000,¢p, but we will (in this text) ensure that the use of BCD representation is
clear by context and will not employ that notation.
108 Chapter 3

ae ea ee re ee

EXAMPLE 3.26 — Compare the binary representation of the decimal number 843 to the 8421
BCD code for that number.
SOLUTION
This is a good time to review our method for conversion of decimal numbers to
binary form: divide the number repeatedly by 2, keeping track of the remain-
ders and proceeding until the quotient of the division process becomes 0. The
remainders, read in reverse order, form the binary equivalent to the decimal
number (Table 3.35). The binary representation of the decimal number 843 is
11.0100 1011).
TABLE 3.35 Converting 843 to binary

DY WARI Kola) Remainder Quotient

Cengage
©
2014
Learning

The BCD code representation of the decimal number 843 will consist of the
coded representations of the individual digits 8, 4, and 3. Referring to our chart
or recalling the base-2 representation for each digit, we obtain 1000 0100 0011.
Note that the two results are completely unrelated to one another, and this rein-
forces our admonition that the two processes are extremely different.

A decimal number encrypted using 8421 BCD code can be decoded into
its decimal equivalent by replacing every nibble in the code by the appropriate
digit, which we can either obtain from the table given earlier or by translating
each nibble individually back to base-10.

EXAMPLE 3.27 _ Find the decimal number represented by the BCD code 0010 1001 0111 0101.
SOLUTION
We can recognize the nibbles as being the binary equivalents to 2, 9, 7, and 6,
respectively, and therefore the equivalent decimal number would be 2976.

EXAMPLE 3.28 _ Find the decimal number represented by the BCD code 0010 1101 0001 0101.
SOLUTION
Proceeding as in the previous example, we find that the decimal equivalents of
the individual nibbles would be 2, 13, 1, and 5. Observe that the second of these,
Binary and Other Number Systems 109

1101, does not represent a single digit but rather is equivalent to the decimal
number 13; thus, this BCD code is not a possible representation for a decimal
number. Recall that, earlier, we had indicated that there were six nibbles consid-
ered to be invalid in 8421 BCD code, and this is one of them.

The examples given to this point have all been integral valued, but BCD
code can be used for decimal fraction numbers as well. We simply convert the
digits before and after the decimal point to their BCD equivalents and place a
separator point in the decimal point’s position.

BXAMPLE 3.29 Give the BCD form of the decimal number 193.482.

SOLUTION
Referring once more to our table of BCD equivalents for the decimal digits, we
obtain the following representation:
0001 1001 0011.0100 1000 0010
All the codes discussed so far have been weighted codes, but there certainly
are nonweighted codes as well. Two examples of these are Excess-3 (XS-3)
code and Gray codes. The former can be used for arithmetic operations, the
latter for mechanical switching systems.
Full exploration of these codes would take us yet farther afield, but Gray
codes are sufficiently interesting that we will spend a brief time considering
them. The code type is named in honor of the creator of its first iteration, Frank
Gray of Bell Labs. Note that the source of the code type is the name of the inven-
tor, and therefore it would be grammatically incorrect to use any of the other
possible spellings of the word Gray (such as “gray” or “grey,” for instance).
The difficulty with using binary codes applied to switching systems is this: if
a device were to indicate position by opening and closing switches, where open
and closed are represented by 1 and 0, respectively, then two adjacent positions
(011 and 100, for example) are such that the transition between one position
and the next would require the transition of three switches synchronously. In
the moment of transition, all three switches will be changing at a slightly dif-
ferent rate, and this could spawn misleading readings for an observer. It would
be highly desirable for successive states to be represented by strings of binary
numbers that have minimal differences, such as (in an ideal case) variation of
only a single bit. A code capable of representing a succession of integer values
possessing this quality is referred to as a Gray code.
There is no single Gray code; rather, the name applies to any code that
represents each number in a sequence of integers (from 0 through 2” — 1,
inclusive) as a string of binary digits of length n, such that strings that differ
only in one bit represent adjacent integers in the sequence. The rationale for this
construction is that advancing through the list of integers requires changing, or
flipping, the value of one bit at a time.
One method of constructing a Gray code to represent, for example, the
integers from 0 through 15, inclusive, offers an interesting exercise, which we
shall leave to you. One starts with a string of four Os (we use four digits because
we know that there are 16 possible strings of four binary digits) and then suc-
cessively flip the rightmost bit that produces a completely new string of digits.
When we're through, we will (hopefully!) have 16 distinct sets of four binary
digits to which we can assign the numbers 0 through 15. The set will, by con-
struction, satisfy the definition of what it means to be a Gray code.
A second method is a process of reflecting and prepending; we will dem-
onstrate the process here, since it is less intuitive than the method already de-
scribed. The point is that there are many ways of constructing Gray codes rather
than a single canonical process.
Our procedure will be to start with the digits 0 and 1, “mirror” those dig-
its (“prepend” 0 to the first half and 1 to the last half of digits on the list), and
then iterate the process until the desired number of digits (in this case, 16) is
obtained. That may sound a bit complicated, but you'll find that it is, in practice,
fairly easy.

Step One: Begin with the digits 0 and 1 and mirror that set:
e 0, 1, 1, 0 (note that “mirroring” merely means to repeat the digits in re-
verse order)
Step Two: To the first half of strings on that list, prepend 0; to the second
half of strings on the list, prepend 1:
« 00701 11,10
Step Three: Mirror the set once more:
2100501 -11410,.10,.1 15 015,00
Step Four: Prepend 0s to the first half of strings and 1s to the second half
of strings:
e000; 000 011 OTO M1105 TEE OT sro0
Step Five: Mirror the set once more (this will produce a set of 16 strings):
«000; 001; 01, O10 LO, 111) LOTAOOR LOO TOTS IT 1102 010; OMS 001000
Step Six: Prepend 0s to the first half of strings and 1s to the second half of
strings:
e (0000, 0001, 0011, 0010, 0110, 0111, 0101, 0100, 1100, 1101, 1111, 1110,
1010, 1011, 1001, 1000

Observe there are no repetitions on the list and that each string differs from
its predecessor in a single bit. We could thus make a unique assignment of the
decimal numbers from 0 through 15, inclusive, to these binary strings, in order.

Exercises
Answer the following questions using complete sentences, with correct spelling and grammar.
1. What is meant by a BCD code?
2. What is meant by a weighted code?
3. What is a Gray code?
Binary and Other Number Systems 111

In the following problems, convert the decimal numbers to binary form and then give the 8421
BCD representation of the number.
4. 54 6. 347.625
5. 6666 7 0010

In the following problems, convert the 8421 BCD representations to the equivalent decimal
number.
8. 1001 01110101 10. 1001.0111 0011
9. 01110101 1001 0011 0001 LL, 0111,0011.1001

In this section, we examined the 8421 BCD weighted code, but there exist other weighted codes,
such as the 2421 BCD code. The development of the code is similar to that of 8421 BCD, but
the weights are, 2.4, 2, and 1 respectively. The following are 2421 BCD representations of
decimal numbers. Find the decimal numbers with the shown representations.
120001 OUT iAT0 0011 14, 1111.1110 1011 0010
13. 0101 0001 1111.1100 1101 15. 0000.0011 0100 1110

Write an explanation for the the solution of the following.


16. We have introduced one method for generating a Gray code and sug-
gested an alternative approach to represent the integers from 0 through
15, inclusive. Begin with a string of four Os (we use four digits because
we know that there are 16 possible strings of four binary digits) and
then successively flip the rightmost bit that produces a completely new
string of digits. When we're through, you will have 16 distinct sets of
four binary digits to which we can assign the numbers 0 through 15.
Demonstrate this procedure generates a Gray code.

Summary
In this chapter, you learned about:
© 'The decimal, binary, and hexadecimal number systems.
© The arithmetic operations and applications of the binary number system.
© The relationship between binary and hex, decimal and hex, and binary
and octal.
© The binary and 8421 codes.

Glossary
ASCII (American Standard Code for Information base-16 number system A system of numeration
Interchange) An encryption device for the English al- _ using 16 distinct symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A,
phabet using binary numbers. B, C, D, E, and EF. Also called the hexadecimal number

base The number of distinct characters employed for eyetein:


numeration within a particular number system. Also base-10 number system The decimal number
called the radix. system.
ae SROs : aa

BCD (binary-coded decimal) code Any of the codes hexadecimal point The analog to the decimal point in
used to express the decimal digits (0 through 9) using base-16; the point of demarcation between the whole
a nibble. number and fractional parts of a base-16 number. Also
called the hexadecimal separator.
binary number system Also called base-2, a numera-
tion system in which all numbers are represented using hexadecimal separator The analog to the decimal
the digits 0 and 1 only. point in the hexadecimal number system.
binary point The analog to the decimal point in base- least significant binary digit (LSB) The base-2 in-
10; the point of demarcation between the whole num- stance of the least significant digit. Also called the least
ber and fractional parts of a binary number. Also called significant bit.
the binary separator. least significant digit (LSD) The nonzero digit farthest
binary separator The analog to the decimal separator right within a number's representation.
in the binary system. Also called the binary point. most significant binary digit (MSB) The base-2 in-
bit A two-digit pairing in the binary number system. stance of the most significant digit. Also called the
most significant bit.
byte An eight-bit grouping in the binary number
system. most significant digit (MSD) The nonzero digit far-
thest left within a number’s representation.
color codes Six-digit hex number HTML designations
that identify the text color in a document. nibble A four-bit grouping in the binary number
system.
decimal number system A system of numeration us-
ing 10 distinct symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. nonweighted codes: Codes that employ a weighted
positioning system.
decimal separator A dot used to indicate the separa-
tion from whole number to fraction number places octal number system Also called base-8, a numeration
within a number's base-10 representation. system in which all numbers are represented using the
symbols 0, 1, 2, 3, 4, 5, 6, and 7 only.
8421 BCD code The particular binary decimal code
using the binary equivalents of the numbers 0 through octal separator The analog to the decimal point in the
9 as the encryption code. octal number system.
Excess-3 (XS-3) codes A BCD code and numeral sys- place value The value associated with a particular digit
tem using a prespecified value N as a bias value. location in a numerical representation.
expanded form The decomposition of a number as a radix The base of a number system.
sum where each term displays a product of a digit of
RGB The red/green/blue ratios used to construct colors
the number's representation with its place value.
in HTML; also called color codes.
exploded form Another term for the expanded form of
symmetric property of equality The property stating
a number.
that A = B is equivalent to B = A.
Gray codes A binary numeral system where two suc-
weighted code a code in which representation of the
cessive values differ only in one bit.
base-10 digits is performed using a four-bit combina-
hexadecimal number system Also called base-16, a tion for which each position within the nibble carries a
numeration system in which all numbers are repre- particular weight.
sented using the symbols 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B,
C, D, E, and F only.
Binary and Other Number Systems 113

End-of-Chapter Problems
In each of the following, identify the place name and place value of every digit.
1. 4527 89 OLZ/A.o
2. 346.567
In each of the following, give the expanded form of the decimal number.
4. 1954.37 6. 883.5678
2 O6.238

For the following, sive the decimal number whose expanded form is shown.
704% 10° +2 x 10° +6 < 10-40 X 10°F § 10 6 x10
8. 5x 10°+3x10'+9x107+4xX 10°
9. 3 X 10° +8 X 10*+ 0 X 10° +0107 + 5 x 10° + 4 x 10°
For each of the following, identify the LSD and MSD.
10. 4527.89
Dits-336200
IDPS G103 X10 9210
tae eae
Give examples of decimal numbers satisfying the following conditions.
13. A whole number having an MSD of 4 and an LSD of 7.
14. A number having 9s in the tenths, hundreds, and thousandths places.
For each of the following decimal numbers, convert to binary form.
15. 5249 Meme bye

For each of the following binary numbers, convert to decimal form.


17. 1010 1110, 18. 101.1110,

Perform the following binary additions. Check your work by converting the addends and sum to
decimal form and adding these to show that the same result is obtained.
19% Jett 1 10005 20. MOLTO ta L0OL 0001,

Perform the following binary subtractions. Check your work by converting minuend, sub-
trahend, and difference to decimal form and subtracting these to show that the same result is
obtained.
ZS lOO) Waa LU 22 eT OMe be Ls

Perform the following binary multiplications. Check your work by converting the factors and
the product to decimal form and multiplying these to show that the same result is obtained.
23. (1 1000,)(110,) 24. (111,)(1000,)
Perform the following binary divisions. Check your work by converting the dividend, divisor,
and quotient to decimal form and dividing these to show that the same result is obtained.
25. 1000 0001, = 111, 26. 1000 0100 1100, + 1 0010,
114 Chapter 3

Convert the following phrases to ASCII representation.


27. This conversion is tedious. 28. Reading books is fun.
Convert the following binary representations into English, using the ASCII conversion chart.
29. 01010100 01101000 01101001 01110011 00100000 01101001 01110011
00100000 01101000 01100001 01110010 01100100 00100000 01110111
01101111 01110010 01101011 00101110
30. 01001000 01100001 01110000 01110000 01111001 00100000 01101110
OPO ECOL VOLE OC M Tit

Convert the following binary numbers to hexadecimal form.


31. 1001 1110 1010, 32. 110010.0100 0110,

Convert the following hexadecimal numbers to binary form.


33. BAjs 34. 9347FCi¢

Convert the following decimal numbers to hexadecimal form.


spe call 36. 374.25

Convert the following decimal numbers to octal form.


oY. Ze) 38. 4577.0625

Convert the following octal numbers to decimal form.


BO Oo. 40. 4156.25,

Convert the following binary numbers to octal form.


41. 1011 1100 0010, 42. 101.1,

Convert the following octal numbers to binary form.


43. 377. 44, 44125.66¢

In the following problems, convert the decimal numbers to binary form and then give the 8421
BCD representation of the number.
45,255 46. 97.625

In the following problems, convert the 8421 BCD representations to the equivalent decimal
number.
47. 0001 1001 0101 0100 48. 0011 0111.0101 0110

In the following problems, convert the 2421 BCD representations to the equivalent decimal
number.
49. 1111 0111.1110 0100 0101 50. 1000 0111 1100 1111 1110 0001

You might also like