(eBook PDF) Computer Systems 5th Edition download
(eBook PDF) Computer Systems 5th Edition download
download
https://ebooksecure.com/product/ebook-pdf-computer-systems-5th-
edition/
http://ebooksecure.com/product/computer-systems-5th-edition-
ebook-pdf/
http://ebooksecure.com/product/ebook-pdf-automation-production-
systems-and-computer-integrated-manufacturing-5th-edition/
http://ebooksecure.com/product/ebook-pdf-computer-systems-a-
programmers-perspective-3nd-edition/
http://ebooksecure.com/product/ebook-pdf-the-architecture-of-
computer-hardware-systems-software-and-networking-an-information-
technology-approach-5th-edition/
Cardiology-An Integrated Approach (Human Organ Systems)
(Dec 29, 2017)_(007179154X)_(McGraw-Hill) 1st Edition
Elmoselhi - eBook PDF
https://ebooksecure.com/download/cardiology-an-integrated-
approach-human-organ-systems-dec-29-2017_007179154x_mcgraw-hill-
ebook-pdf/
https://ebooksecure.com/download/data-prefetching-techniques-in-
computer-systems-ebook-pdf/
https://ebooksecure.com/download/progress-in-heterocyclic-
chemistry-ebook-pdf/
http://ebooksecure.com/product/ebook-pdf-computer-architecture-a-
quantitative-approach-5th-edition/
http://ebooksecure.com/product/ebook-pdf-translational-medicine-
in-cns-drug-development-volume-29/
Problems
3. Information Representation
3.1 Unsigned Binary Representation
Binary Storage
Integers
Base Conversions
Range for Unsigned Integers
Unsigned Addition
The Carry Bit
3.2 Two’s Complement Binary Representation
Two’s Complement Range
Base Conversions
The Number Line
The Overflow Bit
The Negative and Zero Bits
3.3 Operations in Binary
Logical Operators
Register Transfer Language
Arithmetic Operators
Rotate Operators
3.4 Hexadecimal and Character Representations
Hexadecimal
Base Conversions
ASCII Characters
Unicode Characters
3.5 Floating-Point Representation
Binary Fractions
Excess Representations
The Hidden Bit
Special Values
The IEEE 754 Floating-Point Standard
8
3.6 Models
Chapter Summary
Exercises
Problems
4. Computer Architecture
4.1 Hardware
Central Processing Unit (CPU)
Main Memory
Input/Output Devices
Data and Control
Instruction Format
4.2 Direct Addressing
The Stop Instruction
The Load Word Instruction
The Store Word Instruction
The Add Instruction
The Subtract Instruction
The And and Or Instructions
The Invert and Negate Instructions
The Load Byte and Store Byte Instructions
The Input and Output Devices
Big Endian Versus Little Endian
4.3 von Neumann Machines
The von Neumann Execution Cycle
A Character Output Program
von Neumann Bugs
A Character Input Program
Converting Decimal to ASCII
A Self-Modifying Program
4.4 Programming at Level ISA3
Read-Only Memory
The Pep/9 Operating System
Using the Pep/9 System
Chapter Summary
9
Exercises
Problems
Level 5 Assembly
5. Assembly Language
5.1 Assemblers
Instruction Mnemonics
Pseudo-Operations
The .ASCII and .END Pseudo-ops
Assemblers
The .BLOCK Pseudo-op
The .WORD and .BYTE Pseudo-ops
Using the Pep/9 Assembler
Cross Assemblers
5.2 Immediate Addressing and the Trap Instructions
Immediate Addressing
The DECI, DECO, and BR Instructions
The STRO Instruction
Interpreting Bit Patterns: The HEXO Instruction
Disassemblers
5.3 Symbols
A Program with Symbols
A von Neumann Illustration
5.4 Translating from Level HOL6
The Printf() Function
Variables and Types
Global Variables and Assignment Statements
Type Compatibility
Pep/9 Symbol Tracer
The Shift and Rotate Instructions
Constants and .EQUATE
Placement of Instructions and Data
Chapter Summary
10
Exercises
Problems
11
Translating Structures
Translating Linked Data Structures
Chapter Summary
Exercises
Problems
12
Exercises
Problems
8. Process Management
8.1 Loaders
The Pep/9 Operating System
The Pep/9 Loader
Program Termination
8.2 Traps
The Trap Mechanism
The RETTR Instruction
The Trap Handlers
Trap Addressing Mode Assertion
Trap Operand Address Computation
The No-Operation Trap Handlers
The DECI Trap Handler
The DECO Trap Handler
The HEXO and STRO Trap Handlers and Operating System
Vectors
8.3 Concurrent Processes
Asynchronous Interrupts
Processes in the Operating System
Multiprocessing
A Concurrent Processing Program
Critical Sections
A First Attempt at Mutual Exclusion
A Second Attempt at Mutual Exclusions
Peterson’s Algorithm for Mutual Exclusion
Semaphores
Critical Sections with Semaphores
8.4 Deadlocks
Resource Allocation Graphs
13
Deadlock Policy
Chapter Summary
Exercises
Problems
9. Storage Management
9.1 Memory Allocation
Uniprogramming
Fixed-Partition Multiprogramming
Logical Addresses
Variable-Partition Multiprogramming
Paging
9.2 Virtual Memory
Large Program Behavior
Virtual Memory
Demand Paging
Page Replacement
Page-Replacement Algorithms
9.3 File Management
Disk Drives
File Abstraction
Allocation Techniques
9.4 Error-Detecting and Error-Correcting Codes
Error-Detecting Codes
Code Requirements
Single-Error-Correcting Codes
9.5 RAID Storage Systems
RAID Level 0: Nonredundant Striped
RAID Level 1: Mirrored
RAID Levels 01 and 10: Striped and Mirrored
RAID Level 2: Memory-Style ECC
RAID Level 3: Bit-Interleaved Parity
RAID Level 4: Block-Interleaved Parity
RAID Level 5: Block-Interleaved Distributed Parity
Chapter Summary
14
Exercises
15
Exercises
Level 2 Microcode
16
The Store Word Direct Instruction
The Add Immediate Instruction
The Load Word Indirect Instruction
The Arithmetic Shift Right Instruction
The CPU Control Section
12.2 Performance
The Data Bus Width and Memory Alignment
Memory Alignment
The Definition of an n-Bit Computer
Cache Memories
The System Performance Equation
RISC Versus CISC
12.3 The MIPS Machine
The Register Set
The Addressing Modes
The Instruction Set
MIPS Computer Organization
Pipelining
12.4 Conclusion
Simplifications in the Model
The Big Picture
Chapter Summary
Exercises
Problems
Appendix
Solutions to Selected Exercises
Index
17
Preface
The fifth edition of Computer Systems offers a clear, detailed, step-by-step
exposition of the central ideas in computer organization, assembly
language, and computer architecture. The book is based in large part on a
virtual computer, Pep/9, which is designed to teach the basic concepts of
the classic von Neumann machine. The strength of this approach is that the
central concepts of computer science are taught without getting entangled
in the many irrelevant details that often accompany such courses. This
approach also provides a foundation that encourages students to think
about the underlying themes of computer science. Breadth is achieved by
emphasizing computer science topics that are related to, but not usually
included in, the treatment of hardware and its associated software.
Summary of Contents
Computers operate at several levels of abstraction; programming at a high
level of abstraction is only part of the story. This book presents a unified
concept of computer systems based on the level structure of FIGURE
P.1 .
The book is divided into seven parts, corresponding to the seven levels
of Figure P.1:
18
The text generally presents the levels top-down, from the highest to the
lowest. Level ISA3 is discussed before Level Asmb5, and Level LG1 is
discussed before Level Mc2 for pedagogical reasons. In these two
instances, it is more natural to revert temporarily to a bottom-up approach
so that the building blocks of the lower level will be in hand for
construction of the higher level.
Level App7
Level App7 is a single chapter on application programs. It presents the
idea of levels of abstraction and binary information and establishes the
framework for the remainder of the book. A few concepts of relational
databases are presented as an example of a typical computer application.
Level HOL6
19
Level HOL6 consists of one chapter, which reviews the C programming
language. The chapter assumes that the student has experience in some
imperative language, such as Java or Python—not necessarily C. The
instructor can readily translate the C examples to other common Level
HOL6 languages if necessary.
This chapter emphasizes the C memory model, including global versus
local variables, functions with parameters, and dynamically allocated
variables. The topic of recursion is treated because it depends on the
mechanism of memory allocation on the run-time stack. A fairly detailed
explanation is given on the details of the memory allocation process for
function calls, as this mechanism is revisited at a lower level of abstraction
later in the book.
Level ISA3
Level ISA3 is the instruction set architecture level. Its two chapters
describe Pep/9, a virtual computer designed to illustrate computer
concepts. Pep/9 is a small complex instruction set computer (CISC); a von
Neumann machine. The central processing unit (CPU) contains an
accumulator, an index register, a program counter, a stack pointer, and an
instruction register. It has eight addressing modes: immediate, direct,
indirect, stack-relative, stack-relative deferred, indexed, stack-indexed, and
stack-deferred indexed. The Pep/9 operating system, in simulated read-
only memory (ROM), can load and execute programs in hexadecimal
format from students’ text files. Students run short programs on the Pep/9
simulator and learn that executing a store instruction to ROM does not
change the memory value.
Students learn the fundamentals of information representation and
computer organization at the bit level. Because a central theme of this
book is the relationship of the levels to one another, the Pep/9 chapters
show the relationship between the ASCII representation (Level ISA3) and
C variables of type char (Level HOL6). They also show the relationship
between two’s complement representation (Level ISA3) and C variables of
type int (Level HOL6).
Level Asmb5
Level Asmb5 is the assembly level. The text presents the concept of the
assembler as a translator between two levels—assembly and machine. It
introduces Level Asmb5 symbols and the symbol table.
The unified approach really comes into play here. Chapters 5 and 6
present the compiler as a translator from a high-order language to
20
assembly language. Previously, students learned a specific Level HOL6
language, C, and a specific von Neumann machine, Pep/9. These chapters
continue the theme of relationships between the levels by showing the
correspondence between (a) assignment statements at Level HOL6 and
load/store instructions at Level Asmb5, (b) loops and if statements at Level
HOL6 and branching instructions at Level Asmb5, (c) arrays at Level
HOL6 and indexed addressing at Level Asmb5, (d) procedure calls at
Level HOL6 and the run-time stack at Level Asmb5, (e) function and
procedure parameters at Level HOL6 and stack-relative addressing at
Level Asmb5, (f) switch statements at Level HOL6 and jump tables at
Level Asmb5, and (g) pointers at Level HOL6 and addresses at Level
Asmb5.
The beauty of the unified approach is that the text can implement the
examples from the C chapter at this lower level. For example, the run-time
stack illustrated in the recursive examples of Chapter 2 corresponds
directly to the hardware stack in Pep/9 main memory. Students gain an
understanding of the compilation process by translating manually between
the two levels.
This approach provides a natural setting for the discussion of central
issues in computer science. For example, the book presents structured
programming at Level HOL6 versus the possibility of unstructured
programming at Level Asmb5. It discusses the goto controversy and the
structured programming/efficiency tradeoff, giving concrete examples
from languages at the two levels.
Chapter 7, “Language Translation Principles,” introduces students to
computer science theory. Now that students know intuitively how to
translate from a high-level language to assembly language, we pose the
fundamental question underlying all of computing: What can be
automated? The theory naturally fits in here because students now know
what a compiler (an automated translator) must do. They learn about
parsing and finite-state machines—deterministic and nondeterministic—in
the context of recognizing C and Pep/9 assembly language tokens. This
chapter includes an automatic translator between two small languages,
which illustrates lexical analysis, parsing, and code generation. The lexical
analyzer is an implementation of a finite-state machine. What could be a
more natural setting for the theory?
Level OS4
Level OS4 consists of two chapters on operating systems. Chapter 8 is a
description of process management. Two sections, one on loaders and
21
another on trap handlers, illustrate the concepts with the Pep/9 operating
system. Seven instructions have unimplemented opcodes that generate
software traps. The operating system stores the process control block of
the user’s running process on the system stack, and the interrupt service
routine interprets the instruction. The classic state transition diagram for
running and waiting processes in an operating system is thus reinforced
with a specific implementation of a suspended process. The chapter
concludes with a description of concurrent processes and deadlocks.
Chapter 9 describes storage management, both main memory and disk
memory.
Level LG1
Level LG1 uses two chapters to present combinational and sequential
circuits. Chapter 10 emphasizes the importance of the mathematical
foundation of computer science by starting with the axioms of Boolean
algebra. It shows the relationship between Boolean algebra and logic gates
and then describes some common logic devices, including a complete
logic design of the Pep/9 arithmetic logic unit (ALU). Chapter 11
illustrates the fundamental concept of a finite-state machine through the
state transition diagrams of sequential circuits. It concludes with a
description of common computer subsystems such as bidirectional buses,
memory chips, and two-port memory banks.
Level Mc2
Chapter 12 describes the microprogrammed control section of the Pep/9
CPU. It gives the control sequences for a few sample instructions and
addressing modes and provides a large set of exercises for the others. It
also presents concepts of load/store architectures, contrasting the MIPS
reduced instruction set computer (RISC) machine with the Pep/9 CISC
machine. It concludes with performance issues by describing cache
memories, pipelining, dynamic branch prediction, and superscalar
machines.
Use in a Course
This book offers such broad coverage that instructors may wish to omit
some of the material when designing a course. I use Chapters 1–7 in a
computer systems course and Chapters 10–12 in a computer organization
course.
In the book, Chapters 1–5 must be covered sequentially. Chapters 6
22
(“Compiling to the Assembly Level”) and 7 (“Language Translation
Principles”) can be covered in either order. I often skip ahead to Chapter 7
to initiate a large software project, writing an assembler for a subset of
Pep/9 assembly language, so students will have sufficient time to complete
it during the semester. Chapter 11 (“Sequential Circuits”) is obviously
dependent on Chapter 10 (“Combinational Circuits”), but neither depends
on Chapter 9 (“Storage Management”), which may be omitted. FIGURE
P.2 , a chapter dependency graph, summarizes the possible chapter
omissions.
23
allocation from the heap uses malloc instead of new.
› Sidebars—In this edition, the brief biographies formerly found in each
chapter have been replaced with a different set of sidebars. Each
sidebar is a real-world example of the concepts described in that
chapter. As most of the chapters describe the Pep/9 virtual machine,
the sidebars for those chapters show some corresponding
implementations for the Intel x86 architecture. The new sidebars give
a consistent running example of this architecture so students have a
better idea of how the concepts of the virtual machine relate to real-
world implementations.
› New and expanded topics—Chapter 1 now emphasizes how binary
information is quantified in both space and time by presenting the
performance equation and the concept of bandwidth. QR codes and
color displays are detailed examples of these concepts. Chapter 3
describes Unicode as well as UTF-32 and UTF-8 encoding. Chapter 4
discusses big-endian and little-endian order. Chapter 7 uses Java
instead of C++ as the implementation language for the example
translator. The microcode examples in Chapter 12 use the new
UnitPre and UnitPost feature of the Pep/9 CPU simulator. The two-
byte data bus now has simulator support, and that topic leads to an
extended discussion of memory alignment issues and the new .ALIGN
assembler directive.
Pep/8, the virtual machine for the two previous editions, has been
superseded by Pep/9. As the instruction sets of the two machines are
different, Pep/8 source and object programs are not compatible with those
of Pep/9. Only a few instructions are affected, however, so much remains
the same, including the set of eight addressing modes. The changes for
Pep/9 include the following:
24
data and the return mechanism for flow of control. Combining these
two different concepts into one statement can be confusing during the
learning process. Pep/9 now requires students to explicitly deallocate
locals with the ADDSP statement. An added stylistic advantage is that
the explicit ADDSP to deallocate locals at the end of a function
corresponds directly to the SUBSP at the beginning of the function to
allocate locals.
› Memory-mapped I/O—Of all the instructions in the Pep/8 instruction
set, the most unrealistic are CHARI and CHARO for character input
and output. Most real computer systems map input and output devices
to main memory, which is now the design of Pep/9. In the new
instruction set, there are no native input and output instructions.
Instead, the Pep/8 instruction
CHARI alpha,ad
25
Discovering Diverse Content Through
Random Scribd Documents
We delight in the band evenings, when we sit and watch the
groups of natives walking about under the pretty trees; the fat
mothers with coveys of slim, dark-haired daughters in fresh muslin
frocks; the young Filipino “mashers” in white suits with straw hats
worn daringly on one side, and long, thin, tight boots, trying to hide
their shyness by a lot of swagger with a walking-stick; and all the
little comedies and flirtations that go on. I have hardly ever seen any
white people there except ourselves; a newly-married American
couple who sit in the dark shadows very close together, and some
American soldiers in khaki and turned-up sombreros. The
programmes always end with “The Star-Spangled Banner,” on which
we stand up and C—— takes his hat off, but the American soldiers
unfortunately seldom trouble to salute their Anthem—and as to the
Filipinos, they remain truculently seated with their hats on. It makes
one feel rather foolish to be the only ones to take any notice, but C
—— insists.
We have now entered into possession of our trap and pony, and
have had some blissful drives along the eternal roads to Jaro and
Molo, out in the sunset and back in the starlight or moonlight,
skimming along on rubber tyres. Tracks that we used to tear down
when anyone lent us a carriage are now rigorously tabooed!
Everyone here drives top-speed, and the Filipinos all crawl about the
roads, and never dream of getting out of the way unless one shouts
out a native word—“Tabé!”—when they just move enough to avoid
instant death like a clever matador in a bull-fight. The curious thing
is we have more trouble with the natives who are walking towards
us instead of those going the same way. That may sound strange to
you, and even incredible, but if you knew the Philippines and the
Filipinos you would understand that it could not be otherwise. This
element is very exciting, and makes an ordinary evening-drive to
Molo rather better than a trip on a fire-engine in Piccadilly.
I quite forgot to tell you that some time ago an unknown man was
announced and walked into the sala, in the evening, just before C
—— came home. This person was an American, of about thirty, with
rather a good-looking face and the usual thick, long hair parted in
the middle. He bowed and said:
“Mis’ Darncey, I guess?”
I said Mrs Dauncey was my name.
“Is your husband to home?”
I said he was not, and began to get alarmed, for I thought the
man had come to tell me of some accident to C——; but he soon
reassured me by telling me he guessed I could tell him what he
wanted to know, which was whether we had a spare room, as he
was looking for a family for himself and his wife to board with.
I nearly fell down flat with amazement, but I managed, I hope,
not to show my surprise, for I remembered that the Americans live
out here in “messes,” often several families together, and I reflected
that this touting must be some curious custom of which I had not
heard. So I said, quite politely, that I was very sorry, but I was afraid
this house was only large enough for ourselves.
“Oh,” he said, with a great deal of bowing, but no intention of
going away, “I heard this was a big house and reckoned you didn’t
fill it.”
“We have a room empty,” I said, “in fact we have two, but I am
afraid my husband would never hear of such a thing as anyone we
did not know, or any friend, either, coming to live with us.”
“Oh, that’s all right,” he said. “My wife is in a quilez downstairs,
and I can fetch her up to see you and look at the rooms.”
At this fresh and astounding announcement, I gasped. But I kept
my temper, and replied that I thought he need not disturb his wife,
for we had really no intention of taking anyone to live in our house;
but the man would not be convinced, and argued the point, saying
that he had been to six other people, and he was “fair tired of going
around.”
I was wondering how to get rid of him, for he was so remarkably
oily and polite, and kept on saying ma’am every two words. But just
then C—— came home, and when the visitor introduced himself,
with explanations of his mission, C—— flushed up, and I began to be
afraid he would kick the man out. But luckily the American was quick
enough to see there was no mistaking the few words C—— said, nor
the manner in which he said them in, and he bowed himself out in a
about two seconds.
A strange story? But stranger still is the fact that this was not a
common man—I mean his position was not what we call common—
as C—— has found out that he is an official high up in the Customs
service, and lately married to a schoolma’am. And stranger still is the
fact that the Americans to whom I have told this story can see
nothing odd in it at all.
I can’t suppose that such peculiar customs really prevail in the
United States, and that if C—— were to call on the President’s wife,
as they are all equals, and leave me in a cab below while he asked
her if she took in boarders, that he would not get into trouble. Fancy
if this man made a big fortune out here, and we called on him in his
mansion in New York and insisted on taking rooms in it—the idea is
preposterous—but why?
After this person had departed, we soothed our excited nerves by
sitting on the balcony and watching one of the eternally beautiful
sunsets. I will describe it to you, for it is very much the same every
evening, with varying shades of intensity. The sky behind the palms
in the distance was deep orange, fading into rose, and overhead into
apple-green blue. We went through the house and out on to the
Azotea, and all the sky on that side was like a radiant, pale
amethyst, with a big bright moon rising—a great silver shield—
through the lilac and rosy mist; the water a deep sapphire blue; and
Guimaras a brilliant green outline dividing the sea and sky. The tide
was in, and the water came up to the wall at the end of the garden,
where a sheep was nibbling grass at the end of its tether, perfectly
indifferent to a fool of a puppy, which ran backwards and forwards
barking at its heels. In the empty stables on each side of our own is
a regular camp of poor people, who were lounging by the well,
watching one or two naked brown babies playing on the ground.
They all looked so peaceful and happy and so picturesque in the
sunset and moonlight, that we agreed with each other that perhaps
life in the Philippines might be quite pleasant if one only lived the
right way and had a brown skin covered by a minimum of clothes.
They are a singularly happy people, these Filipinos, when they are
unspoilt by the advantages of civilisation. One never sees or hears
people quarrelling, and they are so kind to their children—always
laughing and chattering and showing their fine white teeth, so that
to watch a group of poor people is always a pleasure. We have been
amused for a long time by the spectacle of a house that is being
built in the suburbs, a stately go-as-you-please undertaking that is
being gone through in an amusingly characteristic manner. They
begin a house by constructing the roof, all lashed with bejuco, and
very neatly put together, which sits on the ground an indefinite time.
Then the arigis—the posts of bamboo or hard wood—are put in
position, and a floor is made about 15 or 20 feet from the earth. Our
friends on the Molo road got so far, and then started to live in the bit
that was finished, camping in a sort of tent on the split-cane floor,
with the roof lying alongside on the ground. I daresay they were
“out” of nipa thatch, and did not dare to trust the building out of
their sight, for the town-dwelling Filipinos are shocking thieves and
burglars. Whatever their reason was, there they lived for quite a
long time, till at last we were quite relieved to see them begin to put
thatch on the framework. Then, one day when we passed we saw
that the roof had also been thatched and hoisted into place, though
how this latter feat was brought about I don’t know, as we
unfortunately missed that part of the operations; but I have been
told that, when the roof has been thatched, it is raised and put in
position by sheer human force and much advice and swearing.
LETTER XXIII.
A TROPICAL SHOWER—OUR SERVANTS—
FILIPINO CUSTOMS
Native Houses.
To face page 204.