Computer Architecture Digital Circuits To Microprocessors Guilherme Arroz instant download
Computer Architecture Digital Circuits To Microprocessors Guilherme Arroz instant download
https://ebookbell.com/product/computer-architecture-digital-
circuits-to-microprocessors-guilherme-arroz-37323046
https://ebookbell.com/product/digital-design-and-computer-
architecture-riscv-edition-sarah-harris-david-harris-51701498
https://ebookbell.com/product/digital-design-and-computer-
architecture-second-edition-reprinted-harris-22042530
https://ebookbell.com/product/digital-design-and-computer-
architecture-arm-edition-sarah-l-harris-david-money-harris-22278588
https://ebookbell.com/product/digital-desing-and-computer-
architecture-harris-dm-2289018
Digital Design And Computer Architecture Arm Edition 1st Edition Sarah
L Harris
https://ebookbell.com/product/digital-design-and-computer-
architecture-arm-edition-1st-edition-sarah-l-harris-5432264
https://ebookbell.com/product/digital-design-and-computer-
architecture-david-money-harris-sarah-l-harris-42064860
https://ebookbell.com/product/digital-design-and-computer-
architecture-arm-edition-sarah-l-harris-david-money-harris-38440888
https://ebookbell.com/product/digital-design-and-computer-
architecture-david-money-harris-sarah-l-harris-42065668
https://ebookbell.com/product/digital-design-and-computer-
architecture-arm-edition-solution-manual-sarah-l-harris-6804280
Computer
Architecture
Digital Circuits to
Microprocessors
World Scientific
NEW JERSEY • LONDON • SINGAPORE • BEIJING • SHANGHAI • HONG KONG • TAIPEI • CHENNAI • TOKYO
Printed in Singapore
Preface
Until the last decades of the 20th century, the real world was viewed as a sys-
tem described by continuous values. The perception that human beings had
about the physical world, regarding sounds, images and other sensations, was
one of inherently continuous phenomena. The same happened with models of
physical systems, both inanimate and biological. To model and study various
physical systems, analogue computers were developed during and immedi-
ately after the Second World War. These computers enabled the accurate
modelling of those continuous physical values.
This vision suffered significant changes with the emergence of digital com-
puters and, above all, with the popularisation of their use, boosted by techno-
logical advances resulting from integrated circuit technologies and magnetic
and optical information storage.
It has thus become clear that magnitudes such as the intensity of light
coming from a given direction or the pressure of air at a given point in time
can be represented, with various advantages, by a numerical value digitally
stored in a computer memory. Technology allowed the storage of these values
(images and sounds, after suitable transformations from the analogue domain
to the digital domain). Simultaneously the same technologies made possible
the subsequent reproduction of the stored values (locally or remotely) on a
computer monitor or a speaker, giving rise to a set of ever-present features
of the modern society of today. These include, among others, telecommuni-
cations (telephones, computers and mobile phones) and various aspects of
the entertainment industry (music, cinema, television and games) which are
now based, in one way or another, on the digital encoding of information.
These applications, which already existed with different technologies
before the appearance of digital computers, were joined by a set of applica-
tions made possible through computers and their use. Among those, informa-
tion systems (databases, banking services, e-commerce) are of note, many of
v
July 27, 2018 7:10 Computer Architecture: Digital Circuits to Microprocessors- 9.61in x 6.69in b3203-fm page vi
vi Preface
them boosted by the emergence of the Internet, the worldwide network con-
necting most of the world’s computers. Mobile systems, all of them based on
digital technologies, became ubiquitous in our lives and a fixture of today’s
daily life. Along with the rapid deployment of computers and digital tech-
nologies, it has also been found that, to a certain extent, biological systems
are also encoded by nature in a manner comparable to that of digital technol-
ogy. Genetic information is stored in a discrete manner in the DNA molecules
which make up the chromosomes of organisms. As a result of large genome
sequencing projects, there are now databases with complete information on
the genome of numerous organisms, including humans. Likewise, the con-
nection between these two areas has led to greater activity in the interface
between biological systems and digital technology.
We are therefore living in an era in which all information is gradually
becoming digital. In its simplest version, digital information is stored using
some mechanism (electronic, magnetic or optical) which, at the lowest level,
is physically supported by storing two possible values. The physical quan-
tity used to represent each of these values may be an electrical voltage (in
the case of a computer memory), reflectivity (in an optical disc) or a state
of magnetisation (in a magnetic disk). In all cases, these different physical
quantities always represent a discrete variable, which can typically take on
the values 0 or 1. Since each of the variables involved has so little capacity
to represent information, the effective use of digital systems implies the use
of a very high number of variables of this type (bits) to represent useful
information, from registers in databases to images, sounds or video.
The study of digital systems is thus essential not only for the profes-
sionals who directly design and operate computers but also for all those
who wish to understand the foundations of the present-day society, deeply
and systematically. The detailed way to encode films, music or communica-
tions is, obviously, outside the scope of an introductory book like this. These
techniques, which have evolved over the last decades, represent a significant
accumulated body of knowledge which it is not possible to address when first
studying this material. However, all these matters depend on the knowledge
of basic encoding techniques and digital information processing, which form
the focus of the study of this book.
Therefore we will describe, in this book, the basic techniques of encod-
ing information, and the fundamental concepts which form the basis of the
computational systems that process and transform this information. The
July 27, 2018 7:10 Computer Architecture: Digital Circuits to Microprocessors- 9.61in x 6.69in b3203-fm page vii
Preface vii
interested readers can then carry out a more in-depth study of these topics,
both regarding encoding and information representation, as well as those
related to computer system architectures.
There are numerous approaches to the topic of digital systems. At one
extreme, there are the purely mathematical or algebraic approaches, which
completely ignore the aspect of implementation. At the other extreme, there
are those which start from electronic system technologies, giving special
emphasis to the physical aspects related to the construction of digital sys-
tems.
This book has opted for an intermediate approach which, although not
completely ignoring the physical aspects of the topic, essentially considers
digital systems as abstract information processing elements which constitute
the blocks of a computer.
From this perspective, this book has been designed as a support for an
initial study of computer architectures, typically made in the context of
two university-level semester courses. We anticipate that this book can be
naturally used in the areas of Computer Science, Electronics and Electrical
Engineering, but also in other technical areas, where there is interest in
training students in digital systems, such as Mechanical Engineering, Physics
Engineering or Aerospace Engineering.
A typical course will cover, in the first semester, the topics of digital sys-
tems that are the first part of the book, Chapters 1–8. The second semester
typically covers the computer architecture components described in the sec-
ond part of the book, made up of the remaining chapters.
It is also possible to consider the use of Chapters 9–11 and 13–15 as
support for an introductory course on computer architecture, from a pro-
grammers point of view, for students who only have basic knowledge of
digital systems. In this case, certain sections of these chapters will have to
be covered in a necessarily superficial manner.
Chapter 1 describes the fundamental concepts related to the digital rep-
resentation of information, the use of number systems using different bases,
the arithmetic operations using these bases and conversions between repre-
sentations with different bases.
Chapter 2 analyses logic functions and how they are manipulated, synthe-
sised and optimised. Boolean logic is presented, in a systematic manner, but
with a utilitarian perspective of describing the formulas used to manipulate
logic expressions.
July 27, 2018 7:10 Computer Architecture: Digital Circuits to Microprocessors- 9.61in x 6.69in b3203-fm page viii
viii Preface
Chapter 3 deals, in a necessarily brief and synthetic way, with the tech-
nologies used to implement logic circuits and the limitations imposed by
physical restrictions on the design of digital circuits.
Chapter 4 starts the process of integrating fundamental components, with
the aim of constructing basic computer blocks. This chapter describes com-
binational modules of medium complexity, constructed using the logic gates
previously studied.
Chapter 5 deals with the construction of arithmetic modules that allow
the execution of basic arithmetic operations in base 2, and some aspects of
the issues related to the performance of those modules.
Chapter 6 presents for the first time the concept of sequential behaviour
and describes the circuits which preserve the state of the system (latches
and flip-flops) and exhibit a behaviour that takes into account past history
of the circuit.
Chapter 7 is dedicated to the design, analysis and optimisation of sequen-
tial circuits, which use the latches and flip-flops studied in the previous chap-
ter as basic elements.
Chapter 8, which can be considered as the concluding chapter of the
first part of the book, describes how the circuits of intermediate complexity
studied in Chapters 4–6 may be interconnected, to process complex data
when controlled by the systems studied in Chapter 7.
Chapter 9 represents a general introduction to computers, seen from
a generalist perspective. It aims at providing the transition between the
detailed analysis carried out in the first part of the book, dedicated to digi-
tal systems, and the high-level analysis which will gradually characterise the
second part of the book, dedicated to computer architectures.
Chapter 10 presents the concepts of instruction and instruction set for
a processor, and studies the way instructions are specified, executed and
encoded. This chapter also introduces the P3 processor, the Petite Pedagogic
Processor, which is the platform that will be used to practice the program-
ming and architecture concepts which are the topics of the following two
chapters.
Chapter 11 is dedicated to programming techniques in assembly language,
using the P3 processor as a platform for the study and development of small
programming projects.
Chapter 12 presents and analyses the internal structure of a processor,
once again using the P3 as a case study. In this chapter, the P3 is used as a
July 27, 2018 7:10 Computer Architecture: Digital Circuits to Microprocessors- 9.61in x 6.69in b3203-fm page ix
Preface ix
x Preface
versions of the P3 allow the students to perform changes to the content of the
control ROMs, which enables not only the alteration of the microprogram
of the existing instructions but also the creation and micro-programming of
new assembly instructions. These tools (assembler, simulator, implementa-
tion in VHDL) are freely available on the website of this book. Details of
this implementation may be consulted in Appendix A.
A preface is never complete without the necessary acknowledgements sec-
tion. Given the time this book took to be concluded, our initial thanks must
go to our families who, for years, have uncomplainingly accepted the usual
excuse for our systematic unavailability. To our wives, to whom this book is
dedicated, as well as to our children, from whom we stole many hours to be
able to finish it, here is a thank you from the bottom of our hearts.
Other thanks are due for more technical contributions. The reviewers,
Pedro Diniz and João Cardoso, read preliminary versions of this work and
contributed with many valuable suggestions to improve it. The students
Jorge Santana, Nuno Barral and Fausto Ferreira, contributed to various
aspects of the simulators and the implementation in hardware. The lectur-
ers of the computer architecture courses at Técnico, Carlos Ribeiro, João
Gonçalves, José Costa, Nuno Roma, Alberto Cunha and Nuno Horta, con-
tributed with many comments, suggestions and various improvements. The
editors and employees of IST Press, Joaquim Moura Ramos, Pedro Lourtie,
Miguel Dionı́sio and Paulo Abreu, as well as the reviewers, provided valuable
assistance during the editing and composition phase. The companies SAS
Portugal and Novabase financially supported this publishing project, in the
Portuguese original. The translation to English, a complex and lengthy pro-
cess, was performed by David Hardisty. To all of you, our sincere thanks. Any
typos, errors and omissions that remain, and there will surely be many, are
entirely our responsibility. The authors José Monteiro and Arlindo Oliveira
would also like to leave a very special thank you note to the third author,
Guilherme Arroz, who performed the bulk of the work involved in creating
the English version of this book.
Finally, the statement, obvious but indispensable, that all this has only
been possible because of our parents.
Lisbon, December 2017
Arlindo Oliveira, José Monteiro
and Guilherme Arroz
July 27, 2018 7:10 Computer Architecture: Digital Circuits to Microprocessors- 9.61in x 6.69in b3203-fm page xi
Contents
Preface v
2. Logic Functions 31
2.1 Binary Boolean Algebra . . . . . . . . . . . . . . . . . . . . . 31
2.1.1 One-variable Logic Functions . . . . . . . . . . . . . 32
2.1.2 Two-variable Logic Functions . . . . . . . . . . . . . 34
2.1.3 The Functions And and Or . . . . . . . . . . . . . . 34
xi
July 27, 2018 7:10 Computer Architecture: Digital Circuits to Microprocessors- 9.61in x 6.69in b3203-fm page xii
xii Contents
Contents xiii
xiv Contents
Contents xv
xvi Contents
6.6.2.6
Synchronous counters with an arbitrary
sequence . . . . . . . . . . . . . . . . . . . 283
6.6.3 Interconnection of Counters . . . . . . . . . . . . . . 284
6.6.4 Applications of Counters . . . . . . . . . . . . . . . . 286
6.7 Register Transfers . . . . . . . . . . . . . . . . . . . . . . . . 287
6.7.1 Interconnection Using Multiplexers . . . . . . . . . . 287
6.7.2 Interconnection Using a Single Bus . . . . . . . . . . 288
6.7.3 Register Files . . . . . . . . . . . . . . . . . . . . . . 289
6.8 Memories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
6.8.1 Random Access Memories . . . . . . . . . . . . . . . 292
6.8.1.1 Random access memory operation . . . . . 292
6.8.1.2 Comparison with a register file . . . . . . . 295
6.8.1.3 Internal structure . . . . . . . . . . . . . . 295
6.8.2 Dynamic Memories . . . . . . . . . . . . . . . . . . . 298
6.8.3 FIFO Memories . . . . . . . . . . . . . . . . . . . . . 299
6.9 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302
Contents xvii
xviii Contents
Contents xix
xx Contents
Contents xxi
xxii Contents
Contents xxiii
Index 713
This page intentionally left blank
July 27, 2018 7:1 Computer Architecture: Digital Circuits to Microprocessors- 9.61in x 6.69in b3203-ch01 page 1
Chapter 1
This chapter deals with the representation of non-signed integer and frac-
tional numbers. Later, in Chapter 5, this subject will be reconsidered to
address the representation of signed integer and real numbers. The represen-
tation of numbers in digital systems has to be undertaken considering that
they use devices which can represent only two possible values.
Given that the common representation of numbers is based on the util-
isation of a decimal number system, using base-10, it is natural to consider
that the representation of numbers in digital systems may be made using
the binary system, using base-2. The base is the number of digits used to
represent a number under a given number system.
1
July 27, 2018 7:1 Computer Architecture: Digital Circuits to Microprocessors- 9.61in x 6.69in b3203-ch01 page 2
or
n−1
N= pj × bj , (1.5)
j=0
where pj is the digit which represents the weight of the jth power of the
base. The number of digits necessary is b and it is usual that the digits are
the integers between 0 and b − 1
N p0 × b0
= (pn−1 × bn−2 + pn−2 × bn−3 + · · · + p1 × b0 ) +
b b
p 0
= (pn−1 × bn−2 + pn−2 × bn−3 + · · · + p1 × b0 ) + , (1.7)
b
where p0 is the rest of the division of N by b (remember that p0 < b). In
this way, the digit p0 can be identified.
Repeating the previous procedure for the number Nb will enable us to
derive p1 and through the successive application of the procedure, all the
digits that represent the number.
As an example, consider obtaining the representation of the number 27310
in base-5
273 3
= 54 + . (1.8)
5 5
July 27, 2018 7:1 Computer Architecture: Digital Circuits to Microprocessors- 9.61in x 6.69in b3203-ch01 page 4
1101012 = 1 × 25 + 1 × 24 + 0 × 23 + 1 × 22 + 0 × 21 + 1 × 20
= 32 + 16 + 4 + 1
= 5310 . (1.11)
23 = 11 × 2 + 1, (1.12)
which makes explicit the quotient and the remainder of the division of the
number by 2.
Now, the number 11 can be represented as 11 = 5 × 2 + 1, so that sub-
stituting this in Equation (1.12), the following is obtained:
23 = (5 × 2 + 1) × 2 + 1
= 5 × 22 + 1 × 2 + 1. (1.13)
23 = (2 × 2 + 1) × 22 + 1 × 2 + 1
= 2 × 23 + 1 × 22 + 1 × 2 + 1. (1.14)
And, as 2 = 1 × 2 + 0,
23 = (1 × 2 + 0) × 23 + 1 × 22 + 1 × 2 + 1
= 1 × 24 + 0 × 23 + 1 × 22 + 1 × 2 + 1. (1.15)
23 = 1 × 24 + 0 × 23 + 1 × 22 + 1 × 21 + 1 × 20 . (1.16)
The binary digits of the number are, as seen above, the successive remain-
ders of the division by 2 of the initial number and the successive quotients.
The most common (and fastest) way of carrying out the calculation, however,
is the successive application of the usual algorithm for performing division
and collecting the various remainders at the end.
2 23 Remainders
2 5 1
2 2 1
2 1 0
0 1 Most significant bit
The digit with the greatest weight corresponds to the remainder of the
last division and so on until the digit with the least weight, which is the
remainder of the first division.
The representation of fractional numbers in base-2 (or any other), does not
present any problems, using the same method used for integers. A fractional
number may have an integer part and a decimal part, that is, with a value
less than 1. That decimal part, with n digits, is representable by the following
expression:
or
−n
N= pi × bi . (1.18)
i=−1
10p ≤ 27 (1.20)
and, therefore,
p = log10 27 . (1.21)
The objective is to obtain the value of the digits p−1 , p−2 , p−3 , p−4 . . . p−n .
Multiplying both sides of Equation (1.22) by 2 gives
1
The function x (floor) returns, for the real number x, the largest integer less or
equal to x.
July 27, 2018 7:1 Computer Architecture: Digital Circuits to Microprocessors- 9.61in x 6.69in b3203-ch01 page 8
Equation (1.23) and noting that the integer parts of the two sides of the
equation must be the same, as must the fractional parts, we obtain
p−1 = 1 (1.24)
and
36058 = 3 × 83 + 6 × 82 + 5
= 3 × 512 + 6 × 64 + 5
= 1 92510 . (1.28)
Then, the terms are put into groups of 4 starting from the least significant
1011011101012 = (1 × 23 + 0 × 22 + 1 × 21 + 1 × 20 ) × 28
+ (0 × 23 + 1 × 22 + 1 × 21 + 1 × 20 ) × 24
+ (0 × 23 + 1 × 22 + 0 × 21 + 1 × 20 ) × 20 . (1.31)
However, 28 = 162 , 24 = 161 and 20 = 160 are powers of 16. This can,
therefore, be written,
Note that each digit in base-16 was defined by the 4 binary digits which
were initially grouped. So, if the equivalence between the digits of base-16
and its correspondence to a binary four-digit number is known, it is possible
to directly determine the number in base-16 from the number in base-2. This
correspondence can be easily obtained and is shown in Table 1.3.
7DA3F16 = 7 D A 3 F16
= 0111 1101 1010 0011 11112
= 011111011010001111112 . (1.36)
34618 = 3 4 6 18
= 011 100 110 0012
= 111001100012 . (1.37)
Therefore, writing 487116 is the same as writing 4871h, for example. In the
same way, it is usual to use the letters b, o and d to indicate that the num-
ber is represented in binary, octal or decimal, respectively. For example,
11101012 may be represented by 1110101b. This form of representation will,
from now on, be the preferred way when it is necessary to indicate the base
in which a number is represented.
Representing numbers in bases which are powers of 2, particularly base-8
and base-16, thus offers a compact representation of binary numbers with
many digits. In addition, as has been seen, there is a very simple way of
converting numbers between base-2 and those bases, which is practically
independent in complexity, of the number of digits of the representation of
the numbers. Finally, this allows for partial conversions of sections of the
number which may be of interest. It is easy to discover, for example, the
least or most significant binary digits of a number represented in these bases
without the need for its complete conversion. For example, in the number
A23Bh, it is easy to see that the five most significant binary digits are 10100.
The conversion of numbers with a fractional part between base-2 and
bases that are powers of 2 is carried out in the same manner, taking care to
group the binary digits starting at the decimal point. Take, for example, the
number 1001010.101100111111b
In the same way, the conversion from a base which is a power of 2 to base-2
does not present any difficulty for numbers with a fractional part
5271.3527o = 5 2 7 1 . 3 5 2 7o
= 101 010 111 001 . 011 101 010 111b
= 101010111001.011101010111b. (1.39)
This section briefly deals with simple arithmetic operations in base-2, base-
8 and base-16. The scope is limited to the sums and products of positive
integers. The study of arithmetic involving negative integers will be dealt
with later, in Chapter 5, where subtraction will also be considered.
July 27, 2018 7:1 Computer Architecture: Digital Circuits to Microprocessors- 9.61in x 6.69in b3203-ch01 page 13
The sum in base-2, as with any other base, is not fundamentally different
from a sum in base-10. The procedure adopted is based on the existence of a
table of addition and a method of adding numbers digit by digit. The sum is
carried out by adding, for each digit starting with the least significant digit,
the digits of the numbers to be added to the carry of the previous digit. The
sum should also create the carry to the next digit. The table of addition in
base-2 (Table 1.4) is particularly simple.
It should be noted that, in the sum 1+1, the result cannot be represented
by a single digit, and it is necessary to use two digits. This means that, in
the sum algorithm, there will be in this case a carry of 1. In the other cases
of the table, the carry is always 0.
As an example, take the sum of 100011112 and 10110102 . In the least
significant digits, in the rightmost column, the sum does not have to con-
sider the carry from the previous column. The sum of 1 and 0, according to
Table 1.4, is 1, and the carry, 0 (Figure 1.1(a)).
In the second column, the sum of 1 and 1 is 10 (that is, 210 ). As the carry
from the previous column is 0, the sum does not change. However, since 10
is a two-digit number, in this column, the result of the sum is 0, and the
carry is 1 (Figure 1.1(b)).
In the next column, adding 1 and 0 gives 1. As the carry is 1, it is also
necessary to add this 1, which gives 10. Therefore, the sum is 0, and the
carry is 1 (Figure 1.1(c)).
10001111 10001111
+1011010 +1011010
1001 11101001
1110 carry 00011110 carry
(a) (b)
In the fourth column from the right, there is the sum of 1 and 1, which
gives 10, and also a carry of 1, which gives 11. In this case, the sum is 1, and
the carry is also 1 (Figure 1.2(a)).
Continuing this reasoning, the final result is shown in Figure 1.2(b).
It is, of course, possible to sum more than two numbers The only aspect
to be taken into consideration is that the carry may not be just one digit.
Take the sum of the 4 numbers given below.
In the first column, the sum is 1002 . Here, the sum is, of course, 0, and
the carry, 10. Taking this aspect into consideration, the final result will be:
10011101
101011
11001
+ 1011011
100111100
In digital systems, sums are normally made between two numbers, with
the sums of more than two numbers made by successive sums of the various
terms to be summed.
Just as with addition, multiplication in base-2 follows the same methods for
multiplication in base-10. The multiplication table is shown in Table 1.5.
Each digit of the multiplier is multiplied by the multiplicand to generate
a partial product. The sum of all the partial products is the product of the
July 27, 2018 7:1 Computer Architecture: Digital Circuits to Microprocessors- 9.61in x 6.69in b3203-ch01 page 15
seen later that this characteristic is important when digital systems carry
out this operation.
Multiplication is also easy to carry out. This will be shown using the
multiplication table in base-8 (Table 1.7) and the product of two numbers in
that base.
1.3 Codes
1.3.1 Coding
The representation of information in digital systems is based on the fact that
systems of this type are supported in quantities that can only assume two
July 27, 2018 7:1 Computer Architecture: Digital Circuits to Microprocessors- 9.61in x 6.69in b3203-ch01 page 18
values: 0 and 1. As is the case with binary digits, an entity which can take
on two values is called a bit. If there is an entity which generates information
and that information is created in sequences of symbols with several possible
values, the solution for the representation of those values in a digital system
is to encode them. This means that each possible value is made to correspond
to a specified combination of bits which then represent that value. Take as an
example an elevator in a building with six floors: two basements, the ground
floor and another three floors. If the goal is to register the floor where the
elevator is in a digital system, or where it is heading if moving, there is
the need to codify that information, i.e., make each floor correspond to a
particular bit pattern. The number of bits to be used will be at least those
necessary to produce six combinations. Three bits are enough for that code.
A coding example is shown in Table 1.8.
The correspondence between the entities to be represented and their cod-
ing is called code. In this way, the previous table sets out a code. Each of the
configurations is referred as a code word. If the number of bits for the code
words is equal for all configurations, it is known as the code length. This code
is, therefore, a code of length 3. Obviously, this is not the only possible code
for this application. Table 1.9 shows another possibility.
The only restriction for a valid code is that it does not have repeated
encodings, which means that two different entities may not be encoded with
the same code word.
Either of this codings is acceptable. The two codes shown have no feature
which significantly distinguishes them from one another. However, codes can
be designed with some particular characteristics. For example, using words
of 4 bits to represent the various floors, it is possible to design a code that
represents each floor as a sequence of 2 bits with the value 0 and 2 bits with
value 1, as shown in Table 1.10.
A possible use for codes of this type is to detect errors which could happen
in the coding process or as a consequence of a malfunction of a system. If
at any given time, the system has registered that the elevator is on a floor
represented by the word 0010, it is immediately clear there was an error,
since the word 0010 does not belong to the code.
in which 0010 corresponds to the digit 210 ; 0111, to 710 ; 0001, to 110 ; and
1001, to 910 .
It should be noted that not every sequence of bits may correspond to a
coding using BCD code. For example, the sequence 10110101 is not a number
encoded in BCD, since the 4 bits on the left (1011) do not correspond to
any digit, as can be seen in Table 1.12.
In the same way, it is important to mention that a representation of
a number in BCD code is not a representation of this number in binary.
Returning to the previous example,
A particularly important type of numeric codes are the reflected codes (some-
times referred to as Gray code). The fundamental characteristic of these
codes is that two words which code consecutive numbers differ in only one
bit. This feature is important, as will become clear in Chapter 2.
Table 1.13 shows a three-bit reflected code. It should be noted that with
3 bits, it is possible to encode 8 different numbers.
As can be easily seen, in this code each number is not, except in some
cases, represented by its binary representation. It is possible to verify that
between each two successive numbers only one bit of its representation is
(a) (b)
altered. This is also true with the representations of 0 and 7, the two extremes
represented.
The most direct way to build an n bit reflected code is to start from a
n − 1 bit code. Start with 2n−1 configurations of the n − 1 bit code and
repeat them in an inverse manner, i.e., as if reflected in an imaginary mirror
(hence the name reflected code), as shown in Table 1.14(a).
The fourth bit of the coding is then added, making it equal to 0, in the
initial positions, and equal to 1, in the “reflected” positions, as shown in
Table 1.14(b), where the code is represented.
A suggested exercise would be to obtain the reflected codes of 2 and 3
bits, from the one-bit code. Clearly, the latter does not differ from 1 bit
natural binary code.
72h 65h 70h 72h 65h 73h 65h 6Eh 74h 20h 63h 68h 61h 72h 61h 63h 74h
65h 72h 73h 2Eh codifies the following phrase: Digital systems use ASCII
to represent characters.
Sometimes the designation of the characters in ASCII code is carried out
in decimal instead of hexadecimal. For example, the letter A , which has
the hexadecimal code 41h, has the decimal code 65d.
ASCII code enables representing a text, but with some limitations. In
one hand, it does not allow the special characters of a specific language to
be represented, for example, ç in Portuguese, ø in Swedish or ß in
German. Furthermore, it does not code accentuated characters nor can it
represent other alphabets. As such, various extensions have been developed
to represent specific characters and accentuated characters. The extension is
done by changing the code to an eight-bit code, while keeping it compatible
with the basic ASCII. Unfortunately, there are currently several mutually
incompatible codes. In all of them, however, the representation of the 00h
to 7Fh values are the same as in classic ASCII, to maintain compatibility
between these extensions and ASCII. For example, the ISO-8859-1 code,
the ISO (International Standard Organisation) standardised extension for
Western European alphabets, has the correspondence for characters coded
from 80h to FFh shown in Table 1.16.
“I see that you feel that there is hope for the mine, sir,” he
said eagerly; “and that you will sink the past and join us in
working heart and soul for every one’s benefit.”
“Yes, yes, of course, Mr Reed, but you will soon set all that
right. Take a month at sea, sir, at the company’s expense,
and come back strong as a lion, ready to go to work again,
and make the ‘White Virgin’ richer than ever.”
“No, sir,” said Clive coldly. “I lose more heavily than any
one, and I am prepared to stand by my losses.”
“But he shall not be in your way, my dear sir. You can take it
for granted that he will in future have no part in the
management. You shall stand at the head, and your
judgments shall be unquestioned.”
“Yes, this one,” said Wrigley, rising. “You are still weak, Mr
Reed, and I will not bother you more to-day. I shall stay at
the mine, and be happy to run over on receiving a
message, for that you will come round to my wishes I am
convinced. Good morning, gentlemen, and I should advise
you both to invest heavily in the mine shares, for this
second panic has sent them down almost to zero.”
Clive was silent for a few moments, and then said coldly—
“What!”
“We will not argue that, sir. Your daughter wishes the
engagement to be broken off.”
“Indeed! I’ll soon prove that to be false,” cried the Major,
springing up.
“No, sir,” cried the Doctor; “there has been enough for one
day.”
But he was too late, for the Major had flung open the door,
called “Dinah,” loudly, and her foot was already upon the
stairs.
“For the present that lasts till death,” said Clive sternly.
“Go on, Doctor, say what you like. I cannot defend myself.”
“I will go on, sir; I will say what I like, and I will risk its
hurting you, for I feel towards you as a father, and it
maddens me to see my old friend Grantham’s son behaving
like a scoundrel towards as sweet and lovable a girl as ever
lived.”
“Yes, sir, you may well shrink. I brought you out here for a
walk to make you wince. I can talk to you, and say what I
like out here without expecting the poor girl and her father
to come back and interrupt. Look here, Clive; I’m a
cleverish sort of old fellow in my way, and experience has
put me up to a good many wrinkles in the treatment of
disease, but I tell you frankly it was not I, but Dinah
Gurdon, who saved your life by her nursing.”
“Then why the deuce, sir, do you go on like this and break
the poor girl’s heart?”
“Of course she did, sir; so would any girl of spirit if she
found a man playing fast and loose with her. Now look here,
Clive, my boy, surely you are not throwing her over because
you have lost all this money? Hang it, man! she would be
just as happy if you hadn’t a penny. Now, then, out with it;
was it because of the money?”
“What! then you accuse her? Hang it, I won’t believe a word
of it, sir. That girl could no more do anything to justify your
conduct than an angel could out of heaven. Look here, sir, I
constitute myself her champion.—What’s that noise?”
“I don’t know. I heard it twice before. Some shepherd
calling his sheep, I suppose.”
“Never mind that,” said the Doctor. “Come, I say that Dinah
has given you no reason for behaving as you have.”
“Perhaps you have missed her,” said the Doctor. “She may
have returned home another way, without she has gone on
toward the mine.”
For at that moment the cry they had before heard came
faintly to their ears.
“No,” she said, giving him a piteous look, and then turning
slowly to face Clive. “I went down to fetch this—to give to
Clive Reed before he left us for ever. I thought it must be
there.”
“Yes. Take it, Clive,” said Dinah slowly, but evidently rapidly
recovering her strength. “It is the message I received from
you that day.”
“No; you don’t get away,” cried another voice; and Dinah
turned of a sickly white. “Stop, you! and let’s have it out, or
I’ll heave you down below. Blast you! I tell you she was my
lass—before you and your cursed brother came in the way.
Mine, I tell you.—Ah! just in time!”
“The father of the lady you insulted, and but for her sake
you would have been sent to gaol.”
“Yes, all of you; it’s all right. I used to meet her on the hill
side, and we used to go courting among the heather before
these white-faced hounds came down. She don’t deny it.
She daren’t. Dinah, my lass, come here.”
“Yes,” said the Doctor, “when the shot had entered in. Major,
it was a gun-shot wound, and the marks of the dog’s teeth
are in his leg. I’ll swear to that.”
“Liar and hound,” cried the Major, dashing at him, but he
was too late, for, nerving himself for one blow, Clive Reed
threw himself upon the ruffian, and the next moment he lay
quivering on the ground, with the young man’s foot upon
his chest.
She turned her wild eyes to his, and his look was sufficient.
She left her father and the next moment rested in his arms.
“Mr Jessop Reed and Mr Wrigley, sir? Oh, they haven’t been
down again. Don’t suppose they will come, for the poor
mine’s played out.”
Two months more had passed away before Clive Reed
visited those parts again. He was thin and worn, but there
was a bright look in his eyes, as he breasted the hills from
Blinkdale and plunged down into the deep, chasm-like
vales. For he knew that the past, with its cruel doubting,
was forgiven, and that the woman he loved more than life
was ready to take him to her breast.
It was down the deep valley by the side of the rushing river
that Dinah did take him to her throbbing heart, and hold
him as tightly as his arms grasped her; for in that solitary
place, where the glancing sunbeams shot from the silver
river, there were only the trout to tell tales, and the tales
they told never reached the air.
She had gone to meet him, and when they had sauntered
on another half mile there was the Major whipping a dark
pool under the shadow of the rocks.
“Ill?”
“Well, mentally more than bodily, sir. She is back home, and
he will hardly leave her for a moment.”
It was during a walk next morning with the Major, who took
Clive round by the ‘White Virgin’ mine, that the old officer
suddenly turned to him and said—
“You must buy it, and start afresh. I can’t have you turn
rusty for want of work.”
“No, sir, it is useless. The chances are too great against the
old lode being found again.”
The Major held out his hands; and as they were taken a
white dress was seen fluttering on the hill side a few
hundred yards away, and the Major said softly—
“She does not know it. I have left the news for you to tell.
One moment: I have a stipulation to make.”
“No; but you may throw that in, boy, and not rob me of all.
Let the new vein still be called the ‘White Virgin’ mine.”
Updated editions will replace the previous one—the old editions will
be renamed.
1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside the
United States, check the laws of your country in addition to the
terms of this agreement before downloading, copying, displaying,
performing, distributing or creating derivative works based on this
work or any other Project Gutenberg™ work. The Foundation makes
no representations concerning the copyright status of any work in
any country other than the United States.
1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if you
provide access to or distribute copies of a Project Gutenberg™ work
in a format other than “Plain Vanilla ASCII” or other format used in
the official version posted on the official Project Gutenberg™ website
(www.gutenberg.org), you must, at no additional cost, fee or
expense to the user, provide a copy, a means of exporting a copy, or
a means of obtaining a copy upon request, of the work in its original
“Plain Vanilla ASCII” or other form. Any alternate format must
include the full Project Gutenberg™ License as specified in
paragraph 1.E.1.
• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.
1.F.
1.F.4. Except for the limited right of replacement or refund set forth
in paragraph 1.F.3, this work is provided to you ‘AS-IS’, WITH NO
OTHER WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR ANY PURPOSE.
Please check the Project Gutenberg web pages for current donation
methods and addresses. Donations are accepted in a number of
other ways including checks, online payments and credit card
donations. To donate, please visit: www.gutenberg.org/donate.
Most people start at our website which has the main PG search
facility: www.gutenberg.org.
ebookbell.com