100% found this document useful (1 vote)
97 views

Basic Computer Architecture Smruti R. Sarangi download

The document is a resource for understanding basic computer architecture, authored by Smruti R. Sarangi. It covers topics such as the structure of desktop computers, instruction set design, and various architectures like Harvard and Von Neumann. Additionally, it provides insights into logical operations, number systems, and the representation of information.

Uploaded by

dhofarrassu
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
100% found this document useful (1 vote)
97 views

Basic Computer Architecture Smruti R. Sarangi download

The document is a resource for understanding basic computer architecture, authored by Smruti R. Sarangi. It covers topics such as the structure of desktop computers, instruction set design, and various architectures like Harvard and Von Neumann. Additionally, it provides insights into logical operations, number systems, and the representation of information.

Uploaded by

dhofarrassu
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
You are on page 1/ 43

Basic Computer Architecture Smruti R.

Sarangi
download

https://ebookmeta.com/product/basic-computer-architecture-smruti-
r-sarangi/

Download more ebook from https://ebookmeta.com


We believe these products will be a great fit for you. Click
the link to download now, or visit ebookmeta.com
to discover even more!

Computer Architecture and Organization Shuangbao Paul


Wang

https://ebookmeta.com/product/computer-architecture-and-
organization-shuangbao-paul-wang/

Computer Architecture for Scientists Principles and


Performance Chien

https://ebookmeta.com/product/computer-architecture-for-
scientists-principles-and-performance-chien/

Raspberry Pi Computer Architecture Essentials 1st


Edition Dennis

https://ebookmeta.com/product/raspberry-pi-computer-architecture-
essentials-1st-edition-dennis/

Developing Research Questions 2nd Edition Patrick White

https://ebookmeta.com/product/developing-research-questions-2nd-
edition-patrick-white/
Microsoft Excel Functions Quick Reference For High
Quality Data Analysis Dashboards and More 1st Edition
Mandeep Mehta

https://ebookmeta.com/product/microsoft-excel-functions-quick-
reference-for-high-quality-data-analysis-dashboards-and-more-1st-
edition-mandeep-mehta/

Leadership Questions for Health Care Professionals


Applying Theories and Principles to Practice 1st
Edition Matthew Kutz

https://ebookmeta.com/product/leadership-questions-for-health-
care-professionals-applying-theories-and-principles-to-
practice-1st-edition-matthew-kutz/

Rogue Investigation Godslayer Academy 2 1st Edition


Isadora Brown

https://ebookmeta.com/product/rogue-investigation-godslayer-
academy-2-1st-edition-isadora-brown/

The Millennial Kingdom of the Franciscans in the New


World John Leddy Phelan

https://ebookmeta.com/product/the-millennial-kingdom-of-the-
franciscans-in-the-new-world-john-leddy-phelan/

The Human Group 1st Edition George Caspar Homans

https://ebookmeta.com/product/the-human-group-1st-edition-george-
caspar-homans-2/
Indigenous Digital Life: The Practice and Politics of
Being Indigenous on Social Media Carlson

https://ebookmeta.com/product/indigenous-digital-life-the-
practice-and-politics-of-being-indigenous-on-social-media-
carlson/
Basic Computer Architecture
Version 2.1

Smruti R. Sarangi

August 11, 2021


Contents

1 Introduction to Computer Architecture 11


1.1 What is a Computer? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.2 Structure of a Typical Desktop Computer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.3 Computers are Dumb Machines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
1.4 The Language of Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
1.5 Instruction Set Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
1.5.1 Complete - The ISA should be able to Implement all User Programs . . . . . . . . . . 17
1.5.2 Concise – Limited Size of the Instruction Set . . . . . . . . . . . . . . . . . . . . . . . 18
1.5.3 Generic – Instructions should Capture the Common Case . . . . . . . . . . . . . . . . 18
1.5.4 Simple – Instructions should be Simple . . . . . . . . . . . . . . . . . . . . . . . . . . 18
1.6 How to Ensure that an ISA is Complete? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
1.6.1 Towards a Universal ISA* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
1.6.2 Turing Machine* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
1.6.3 Universal Turing Machine* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
1.6.4 A Modified Universal Turing Machine* . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
1.6.5 Single Instruction ISA* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
1.6.6 Multiple Instruction ISA* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
1.6.7 Summary of Theoretical Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
1.7 Design of Practical Machines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
1.7.1 Harvard Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
1.7.2 Von Neumann Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
1.7.3 Towards a Modern Machine with Registers and Stacks . . . . . . . . . . . . . . . . . . 32
1.8 The Road Ahead . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
1.8.1 Representing Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
1.8.2 Processing Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
1.8.3 Processing More Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
1.9 Summary and Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
1.9.1 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
1.9.2 Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

I Architecture: Software Interface 41

2 The Language of Bits 43


2.1 Logical Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
2.1.1 Basic Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
2.1.2 Derived Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
2.1.3 Boolean Algebra . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
2.1.4 De Morgan’s Laws . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

1
c Smruti R. Sarangi 2

2.1.5 Logic Gates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48


2.1.6 Implementing Boolean Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
2.1.7 The Road Ahead . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
2.2 Positive Integers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
2.2.1 Ancient Number Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
2.2.2 Binary Number System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
2.2.3 Adding Binary Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
2.2.4 Sizes of Integers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
2.3 Negative Integers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
2.3.1 Sign-Magnitude based Representation . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
2.3.2 The 1’s Complement Approach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
2.3.3 Bias-based Approach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
2.3.4 The 2’s Complement Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
2.4 Floating Point Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
2.4.1 Fixed Point Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
2.4.2 Generic Form of Floating Point Numbers . . . . . . . . . . . . . . . . . . . . . . . . . 67
2.4.3 IEEE 754 Format for Representing Floating Point Numbers . . . . . . . . . . . . . . . 69
2.4.4 Denormal Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
2.4.5 Double Precision Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
2.4.6 Floating Point Mathematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
2.5 Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
2.5.1 ASCII Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
2.5.2 UTF-8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
2.5.3 UTF-16 and UTF-32 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
2.6 Summary and Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
2.6.1 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
2.6.2 Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77

3 Assembly Language 81
3.1 Why Assembly Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
3.1.1 Software Developer’s Perspective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
3.1.2 Hardware Designer’s Perspective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
3.2 The Basics of Assembly Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
3.2.1 Machine Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
3.2.2 View of Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
3.2.3 Assembly Language Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
3.2.4 Types of Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
3.2.5 Types of Operands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
3.3 SimpleRisc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
3.3.1 Different Instruction Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
3.3.2 Model of the SimpleRisc Machine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
3.3.3 Register Transfer Instruction – mov . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
3.3.4 Arithmetic Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
3.3.5 Logical Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
3.3.6 Shift Instructions – lsl, lsr, asr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
3.3.7 Data Transfer Instructions: ld and st . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
3.3.8 Unconditional Branch Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
3.3.9 Conditional Branch Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
3 c Smruti R. Sarangi

3.3.10 Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102


3.3.11 Function Call/Return Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
3.3.12 The nop Instruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
3.3.13 Modifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
3.3.14 Encoding the SimpleRisc Instruction Set . . . . . . . . . . . . . . . . . . . . . . . . . 112
3.4 Summary and Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
3.4.1 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
3.4.2 Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120

4 ARM R Assembly Language 125


4.1 The ARM R Machine Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
4.2 Basic Assembly Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
4.2.1 Simple Data Processing Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
4.2.2 Advanced Data-Processing Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . 129
4.2.3 Compare Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
4.2.4 Instructions that Set CPSR Flags – The ‘S’ Suffix . . . . . . . . . . . . . . . . . . . . 132
4.2.5 Data Processing Instructions that use CPSR Flags . . . . . . . . . . . . . . . . . . . . 132
4.2.6 Simple Branch Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
4.2.7 Branch and Link Instruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
4.2.8 Conditional Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
4.2.9 Load-Store Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
4.3 Advanced Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
4.3.1 Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
4.3.2 Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
4.4 Encoding the Instruction Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
4.4.1 Data Processing Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
4.4.2 Load-Store Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
4.4.3 Branch Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
4.5 Summary and Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
4.5.1 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
4.5.2 Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153

5 x86 Assembly Language 157


5.1 Overview of the x86 Family of Assembly Languages . . . . . . . . . . . . . . . . . . . . . . . 157
5.1.1 Brief History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
5.1.2 Main Features of the x86 ISA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
5.2 x86 Machine Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
5.2.1 Integer Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
5.2.2 Floating Point Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
5.2.3 View of Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
5.2.4 Addressing Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
5.2.5 x86 Assembly Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
5.3 Integer Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
5.3.1 Data Transfer Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
5.3.2 ALU Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
5.3.3 Branch/ Function Call Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
5.3.4 Advanced Memory Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
5.4 Floating Point Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
c Smruti R. Sarangi 4

5.4.1 Data Transfer Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186


5.4.2 Arithmetic Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
5.4.3 Instructions for Special Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
5.4.4 Compare Instruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
5.4.5 Stack Cleanup Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
5.5 Encoding the x86 ISA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
5.5.1 High Level View of x86 Instruction Encoding . . . . . . . . . . . . . . . . . . . . . . . 192
5.6 Summary and Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
5.6.1 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
5.6.2 Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197

II Organisation: Processor Design 201

6 Logic Gates, Registers, and Memories 203


6.1 Silicon based Transistors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
6.1.1 Doping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
6.1.2 P-N Junction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
6.1.3 NMOS Transistor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
6.1.4 PMOS Transistor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
6.1.5 A Basic CMOS based Inverter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
6.1.6 NAND and NOR Gates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
6.2 Combinational Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
6.2.1 XOR Gate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
6.2.2 Decoder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
6.2.3 Multiplexer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
6.2.4 Demultiplexer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
6.2.5 Encoder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
6.2.6 Priority Encoder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
6.3 Sequential Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
6.3.1 SR Latch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
6.3.2 The Clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
6.3.3 Clocked SR Latch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
6.3.4 Edge Sensitive SR Flip-flop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
6.3.5 JK Flip-flop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
6.3.6 D Flip-flop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
6.3.7 Master-slave D Flip-flop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
6.3.8 Metastability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
6.3.9 Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
6.4 Memories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
6.4.1 Static RAM (SRAM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
6.4.2 Content Addressable Memory (CAM) . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
6.4.3 Dynamic RAM (DRAM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
6.4.4 Read Only Memory (ROM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
6.4.5 Programmable Logic Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
6.5 Summary and Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
6.5.1 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
6.5.2 Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
5 c Smruti R. Sarangi

7 Computer Arithmetic 241


7.1 Addition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
7.1.1 Addition of Two 1-bit Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
7.1.2 Addition of Three 1-bit Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242
7.1.3 Ripple Carry Adder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
7.1.4 Carry Select Adder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
7.1.5 Carry Lookahead Adder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249
7.2 Multiplication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
7.2.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
7.2.2 Iterative Multiplier . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
7.2.3 Booth Multiplier . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258
7.2.4 An O(log(n)2 ) Time Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263
7.2.5 Wallace Tree Multiplier . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264
7.3 Division . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266
7.3.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266
7.3.2 Restoring Division . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
7.3.3 Non-Restoring Division . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
7.4 Floating Point Addition and Subtraction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
7.4.1 Simple Addition with Same Signs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274
7.4.2 Rounding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276
7.4.3 Implementing Rounding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
7.4.4 Addition of Numbers with Opposite Signs . . . . . . . . . . . . . . . . . . . . . . . . 278
7.4.5 Generic Algorithm for Adding Floating Point Numbers . . . . . . . . . . . . . . . . . 278
7.5 Multiplication of Floating Point Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
7.6 Division of Floating Point Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
7.6.1 Simple Division . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
7.6.2 Goldschmidt Division . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280
7.6.3 Division Using the Newton-Raphson Method . . . . . . . . . . . . . . . . . . . . . . . 281
7.7 Summary and Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
7.7.1 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
7.7.2 Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285

8 Processor Design 289


8.1 Design of a Basic Processor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
8.1.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
8.2 Units in a Processor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
8.2.1 Instruction Fetch – Fetch Unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
8.2.2 Data Path and Control Path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
8.2.3 Operand Fetch Unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294
8.2.4 Execute Unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297
8.2.5 Memory Access Unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
8.2.6 Register Writeback Unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302
8.2.7 The Data Path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303
8.3 The Control Unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305
8.4 Microprogram-Based Processor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308
8.5 Microprogrammed Data Path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309
8.5.1 Fetch Unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310
8.5.2 Decode Unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310
c Smruti R. Sarangi 6

8.5.3 Register File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311


8.5.4 ALU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312
8.5.5 Memory Unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312
8.5.6 Overview of the Data Path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
8.6 Microassembly Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314
8.6.1 Machine Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314
8.6.2 Microinstructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314
8.6.3 Implementing Instructions in the Microassembly Language . . . . . . . . . . . . . . . 317
8.6.4 3-Address Format ALU Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318
8.6.5 2-Address Format ALU Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
8.6.6 The nop Instruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322
8.6.7 ld and st instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322
8.6.8 Branch Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
8.7 Shared Bus and Control Signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327
8.7.1 Control Signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328
8.7.2 Functional Unit Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329
8.8 The Microcontrol Unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329
8.8.1 Vertical Microprogramming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329
8.8.2 Horizontal Microprogramming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331
8.8.3 Tradeoffs between Horizontal and Vertical Microprogramming . . . . . . . . . . . . . . 332
8.9 Summary and Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333
8.9.1 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333
8.9.2 Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334

9 Principles of Pipelining 337


9.1 A Pipelined Processor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337
9.1.1 The Notion of Pipelining . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337
9.1.2 Overview of Pipelining . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338
9.1.3 Performance Benefits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
9.2 Design of a Simple Pipeline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340
9.2.1 Splitting the Data Path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340
9.2.2 Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340
9.2.3 The Instruction Packet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341
9.3 Pipeline Stages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342
9.3.1 IF Stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342
9.3.2 OF Stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342
9.3.3 EX Stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343
9.3.4 MA Stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344
9.3.5 RW Stage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344
9.3.6 Putting it All Together . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345
9.4 Pipeline Hazards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345
9.4.1 The Pipeline Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345
9.4.2 Data Hazards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348
9.4.3 Control Hazards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350
9.4.4 Structural Hazards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351
9.5 Solutions in Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352
9.5.1 RAW Hazards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352
9.5.2 Control Hazards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353
7 c Smruti R. Sarangi

9.6 Pipeline with Interlocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355


9.6.1 A Conceptual Look at a Pipeline with Interlocks . . . . . . . . . . . . . . . . . . . . . 357
9.6.2 Ensuring the Data-Lock Condition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359
9.6.3 Ensuring the Branch-Lock condition . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361
9.7 Pipeline with Forwarding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362
9.7.1 Basic Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362
9.7.2 Forwarding Paths in a Pipeline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365
9.7.3 Data Hazards with Forwarding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367
9.7.4 Implementation of a Pipeline with Forwarding . . . . . . . . . . . . . . . . . . . . . . 369
9.7.5 Forwarding Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372
9.8 Support for Interrupts/ Exceptions* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 378
9.8.1 Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 378
9.8.2 Exceptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379
9.8.3 Precise Exceptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379
9.8.4 Saving and Restoring Program State . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381
9.8.5 SimpleRisc Assembly Code of an Interrupt Handler . . . . . . . . . . . . . . . . . . . 384
9.8.6 Processor with Support for Exceptions . . . . . . . . . . . . . . . . . . . . . . . . . . . 386
9.9 Performance Metrics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387
9.9.1 The Performance Equation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387
9.9.2 Performance of an Ideal Pipelined Processor . . . . . . . . . . . . . . . . . . . . . . . . 389
9.9.3 Performance of a Non-Ideal Pipeline . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391
9.9.4 Performance of a Suite of Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394
9.9.5 Inter-Relationship between Performance, the Compiler, Architecture, and Technology 395
9.10 Power and Temperature Issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
9.10.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
9.10.2 Dynamic Power . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399
9.10.3 Leakage Power . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401
9.10.4 Modeling Temperature* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 402
9.10.5 The ED2 Metric . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 402
9.11 Advanced Techniques* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404
9.11.1 Branch Prediction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404
9.11.2 Multiple Issue In-Order Pipeline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 408
9.11.3 EPIC and VLIW Processors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 410
9.11.4 Out-of-Order Pipelines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 411
9.12 Summary and Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413
9.12.1 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413
9.12.2 Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415

III Organisation: System Design 421

10 The Memory System 423


10.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424
10.1.1 Need for a Fast Memory System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424
10.1.2 Memory Access Patterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425
10.1.3 Temporal and Spatial Locality of Instruction Accesses . . . . . . . . . . . . . . . . . . 426
10.1.4 Characterising Temporal Locality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 426
10.1.5 Characterising Spatial Locality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 427
c Smruti R. Sarangi 8

10.1.6 Utilising Spatial and Temporal Locality . . . . . . . . . . . . . . . . . . . . . . . . . . 429


10.1.7 Exploiting Temporal Locality – Hierarchical Memory System . . . . . . . . . . . . . . 429
10.1.8 Exploiting Spatial Locality – Cache Blocks . . . . . . . . . . . . . . . . . . . . . . . . 432
10.2 Caches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433
10.2.1 Overview of a Basic Cache . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433
10.2.2 Cache Lookup and Cache Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435
10.2.3 Data read and data write Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442
10.2.4 The insert Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 443
10.2.5 The replace Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 443
10.2.6 The evict Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445
10.2.7 Putting all the Pieces Together . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445
10.3 The Memory System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447
10.3.1 Mathematical Model of the Memory System . . . . . . . . . . . . . . . . . . . . . . . . 448
10.3.2 Cache Misses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 450
10.3.3 Reduction of Hit Time and Miss Penalty . . . . . . . . . . . . . . . . . . . . . . . . . . 452
10.3.4 Summary of Memory System Optimisation Techniques . . . . . . . . . . . . . . . . . . 453
10.4 Virtual Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 454
10.4.1 Process – A Running Instance of a Program . . . . . . . . . . . . . . . . . . . . . . . . 454
10.4.2 The “Overlap” and “Size” Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . 459
10.4.3 Implementation of Virtual Memory with Paging . . . . . . . . . . . . . . . . . . . . . 460
10.4.4 Swap Space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 466
10.4.5 Memory Management Unit (MMU) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 466
10.4.6 Advanced Features of the Paging System . . . . . . . . . . . . . . . . . . . . . . . . . 467
10.5 Summary and Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 469
10.5.1 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 469
10.5.2 Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471

11 Multiprocessor Systems 477


11.1 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 479
11.1.1 Moore’s Law . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 480
11.1.2 Implications of the Moore’s Law . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 480
11.2 Software for Multiprocessor Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481
11.2.1 Strong and Loosely Coupled Multiprocessing . . . . . . . . . . . . . . . . . . . . . . . 481
11.2.2 Shared Memory vs Message Passing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482
11.2.3 Amdahl’s Law . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 487
11.3 Design Space of Multiprocessors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 488
11.4 MIMD Multiprocessors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 489
11.4.1 Logical Point of View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 490
11.4.2 Coherence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491
11.4.3 Memory Consistency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 493
11.4.4 Physical View of Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 501
11.4.5 Shared Caches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 504
11.4.6 Coherent Private Caches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505
11.4.7 Implementing a Memory Consistency Model* . . . . . . . . . . . . . . . . . . . . . . . 511
11.4.8 Multithreaded Processors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 515
11.5 SIMD Multiprocessors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 518
11.5.1 SIMD – Vector Processors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 519
11.5.2 Software Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 520
9 c Smruti R. Sarangi

11.5.3 A Practical Example using SSE Instructions . . . . . . . . . . . . . . . . . . . . . . . . 522


11.5.4 Predicated Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 523
11.5.5 Design of a Vector Processor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 525
11.6 Interconnection Networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 525
11.6.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 525
11.6.2 Bisection Bandwidth and Network Diameter . . . . . . . . . . . . . . . . . . . . . . . 526
11.6.3 Network Topologies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 528
11.7 Summary and Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 535
11.7.1 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 535
11.7.2 Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 537

12 I/O and Storage Devices 545


12.1 I/O System – Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 546
12.1.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 546
12.1.2 Requirements of the I/O System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 548
12.1.3 Design of the I/O System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 549
12.1.4 Layers in the I/O System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 552
12.2 Physical Layer – Transmission Sublayer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 553
12.2.1 Single Ended Signalling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 555
12.2.2 Low Voltage Differential Signalling (LVDS) . . . . . . . . . . . . . . . . . . . . . . . . 556
12.2.3 Transmission of Multiple Bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 557
12.2.4 Return to Zero (RZ) Protocols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 557
12.2.5 Manchester Encoding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 558
12.2.6 Non Return to Zero (NRZ) Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . 560
12.2.7 Non Return to Zero (NRZI) Inverted Protocol . . . . . . . . . . . . . . . . . . . . . . 560
12.3 Physical Layer – Synchronisation Sublayer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 560
12.3.1 Synchronous Buses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 561
12.3.2 Source Synchronous Bus* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 564
12.3.3 Asynchronous Buses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 564
12.4 Data Link Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 568
12.4.1 Framing and Buffering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 569
12.4.2 Error Detection and Correction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 569
12.4.3 Arbitration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 575
12.4.4 Transaction-Oriented Buses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 578
12.4.5 Split Transaction Buses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 579
12.5 Network Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 580
12.5.1 I/O Port Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 580
12.5.2 Memory Mapped Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 583
12.6 Protocol Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 584
12.6.1 Polling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 584
12.6.2 Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 585
12.6.3 DMA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 586
12.7 Case Studies – I/O Protocols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 587
12.7.1 PCI Express R . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 587
12.7.2 SATA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 589
12.7.3 SCSI and SAS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 590
12.7.4 USB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 592
12.7.5 FireWire Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 595
c Smruti R. Sarangi 10

12.8 Storage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 597


12.8.1 Hard Disks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 598
12.8.2 RAID Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 604
12.8.3 Optical Disks – CD, DVD, Blu-ray . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 608
12.8.4 Flash Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 612
12.9 Summary and Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 617
12.9.1 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 617
12.9.2 Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 619

IV Appendix 623

A Case Studies of Real Processors 625


A.1 ARM R Processors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 625
A.1.1 ARM R Cortex R -M3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 626
A.1.2 ARM R Cortex R -A8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 628
A.1.3 ARM R Cortex R -A15 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 629
A.2 AMD R Processors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 632
A.2.1 AMD Bobcat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 632
A.2.2 AMD Bulldozer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 633
A.3 Intel R Processors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 636
A.3.1 Intel R AtomTM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 636
A.3.2 Intel Sandy Bridge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 639

B Graphics Processors 643


B.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 643
B.1.1 Graphics Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 643
B.1.2 Graphics Pipeline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 644
B.1.3 Fusion of High Performance Computing and Graphics Computing . . . . . . . . . . . 645
B.2 NVIDIA Tesla Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 646
B.2.1 Work Distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 646
B.2.2 GPU Compute Engines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 647
B.2.3 Interconnection Network, DRAM Modules, L2 Caches, and ROPs . . . . . . . . . . . 648
B.3 Streaming Multiprocessors (SMs) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 648
B.4 Computation on a GPU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 649
B.5 CUDA Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 651
Introduction to Computer Architecture
1
Welcome to the exciting world of computer architecture. Computer architecture is the study of comput-
ers. We shall study the basic design principles of computers in this book including the basic technologies,
algorithms, design methodologies and future trends.
The field of computer architecture is a very fast moving field, and every couple of years there are a
plethora of new inventions. Fifty years ago, the existence of computers was almost unknown to the common
man. Computers were visible only in large financial institutions or in top universities. However, today
billions of people all over the world have access to some form of computing device. They use it actively,
and have found a place for it in their daily activities. Such kind of an epic transformation in the use, and
ubiquity of computers has made the field of computer architecture extremely interesting.
In this chapter, we shall present an overview of computer architecture from an academic standpoint, and
explain the major principles behind today’s computers. We shall observe that there are two perspectives in
computer architecture. We can look at computer architecture from the point of view of software applications.
This point of view is sometimes referred to as architecture in literature. It is very important for students of
computer architecture to study computer architecture from the viewpoint of a software designer because they
need to know about the expectations of software writers from hardware. Secondly, it is also important for
software writers to know about computer architecture because they can tailor their software appropriately
to make it more efficient. In the case of system software such as operating systems and device drivers, it
is absolutely essential to know the details of the architecture because the design of such kind of software is
very strongly interlinked with low level hardware details.
The other perspective is the point of view of hardware designers. Given the software interface, they need
to design hardware that is compatible with it and also implement algorithms that make the system efficient
in terms of performance and power. This perspective is also referred to as organisation in literature.

Definition 1

Architecture The view of a computer presented to software designers.


Organisation The actual implementation of a computer in hardware.

11
c Smruti R. Sarangi 12

Computer architecture is a beautiful amalgam of software concepts and hardware concepts. We design
hardware to make software run efficiently. Concomitantly, we also design software keeping in mind the
interface and constraints presented by hardware. Both the perspectives run hand in hand. Let us start out
by looking at the generic definition of a computer.

1.1 What is a Computer?


Let us now answer the following questions.

Question 1
What is a computer?
What it can do, and what it cannot do?
How do we make it do intelligent things?

Let us start out with some basic definitions. The first question that we need to answer is – What is
a computer? Well to answer this question, we just need to look all around us. We are surrounded by
computers. Nowadays, computers are embedded in almost any kind of device such as mobile phones, tablets,
mp3 players, televisions, dvd players, and obviously desktops and laptops. What is common between all
of these devices? Well, each one of them has a computer that performs a specific task. For example, the
computer in a mp3 player can play a song, and the computer in a dvd player can play a movie. It is absolutely
not necessary that the mp3 player and dvd player contain different types of computers. In fact, the odds
are high that both the devices contain the same type of computer. However, each computer is programmed
differently, and processes different kinds of information. An mp3 player processes music files, and a dvd
player processes video files. One can play a song, while the other can play a video.
Using these insights, let us formally define a computer in Definition 2.

Definition 2
A computer is a general purpose device that can be programmed to process information, and yield mean-
ingful results.

Note that there are three important parts to the definition as shown in Figure 1.1 – the computer,
information store, and the program. The computer takes as an input a program, and in response performs
a set of operations on the information store. At the end it yields meaningful results. A typical program
contains a set of instructions that tell the computer regarding the operations that need to be performed on
the information store. The information store typically contains numbers and pieces of text that the program
can use. Let us consider an example.

Example 1
Here is a snippet of a simple C program.
13 c Smruti R. Sarangi

Information
Program
store

Computer

Results
Figure 1.1: A basic computer

1: a = 4;
2: b = 6;
3: c = a + b;
4: print c

A computer will produce the output - 10. This C program contains four statements. Here, each
statement can conceptually be treated as an instruction. Each statement instructs the computer to do
something. Statements 1 and 2 instruct the computer to assign the variables a and b, the values 4 and
6 respectively. Statement 3 instructs the computer to add a and b, and assign the result to variable c.
Finally, statement 4 instructs the computer to print the value of c (output of the program).

Given the fact that we have defined a computer as a sophisticated device that follows the instructions in
a program to produce an output, let us see how it can be built. Modern day computers are made of silicon
based transistors and copper wires to connect them. However, it is absolutely not necessary that computers
need to be built out of silicon and copper. Researchers are now looking at building computers with electrons
(quantum computers), photons(optical computers), and even DNA. If we think about it, our own brains are
extremely powerful computers themselves. They are always in the process of converting thoughts(program)
into action(output).

1.2 Structure of a Typical Desktop Computer


Let us now open the lid of a desktop computer, and see what is inside (shown in Figure 1.2). There are three
main parts of a typical desktop computer – CPU (Central Processing Unit), Main Memory, and Hard Disk.
The CPU is also referred to as the processor or simply machine in common parlance. We will use the terms
interchangeably in this book. The CPU is the main part of the computer that takes a program as input,
and executes it. It is the brain of the computer. The main memory is used to store data that a program
might need during its execution (information store). For example, let us say that we want to recognise all
the faces in an image. Then the image will be stored in main memory. There is some limited storage on the
c Smruti R. Sarangi 14

Figure 1.2:

processor itself. However, we shall discuss this aspect later. When we turn off the power, the processor and
main memory lose all their data. However, the hard disk represents permanent storage. We do not expect
to lose our data when we shut down the system. This is because all our programs, data, photos, videos, and
documents are safely backed up in the hard disk.

Memory Hard disk

Computer
Figure 1.3: Block diagram of a simple computer

Figure 1.3 shows a simplistic block diagram of the three components. Along with these main components,
there are a host of peripheral components that are connected to the computer. For example, the keyboard and
mouse are connected to a computer. They take inputs from the user and communicate them to programs
running on the processor. Similarly, to show the output of a program, the processor typically sends the
output data to a monitor that can graphically display the result. It is also possible to print the result using
a printer. Lastly the computer can be connected to other computers through the network. A revised block
diagram with all the peripherals is shown in Figure 1.4.
Other documents randomly have
different content
The Project Gutenberg eBook of Mr. Wycherly's
Wards
This ebook is for the use of anyone anywhere in the United
States and most other parts of the world at no cost and with
almost no restrictions whatsoever. You may copy it, give it away
or re-use it under the terms of the Project Gutenberg License
included with this ebook or online at www.gutenberg.org. If you
are not located in the United States, you will have to check the
laws of the country where you are located before using this
eBook.

Title: Mr. Wycherly's Wards

Creator: L. Allen Harker

Release date: March 23, 2017 [eBook #54418]

Language: English

Credits: Produced by Al Haines

*** START OF THE PROJECT GUTENBERG EBOOK MR. WYCHERLY'S


WARDS ***
MR. WYCHERLY'S WARDS

BY
L. ALLEN HARKER
AUTHOR OF "MISS ESPERANCE AND MR. WYCHERLY,"
"MASTER AND MAID," "A ROMANCE OF THE NURSERY,"
"CONCERNING PAUL AND FIAMETTA," ETC.

NEW YORK
CHARLES SCRIBNER'S SONS
1912

COPYRIGHT, 1912, BY
CHARLES SCRIBNER'S SONS
Published January, 1912
BOOKS BY L. ALLEN HARKER
PUBLISHED BY CHARLES SCRIBNER'S SONS
Miss Esperance and Mr. Wycherly
Mr. Wycherly's Wards
Master and Maid
Concerning Paul and Fiammetta
A Romance of the Nursery

To
MY DEAR FRIEND
JEAN MARGARET CARNEGIE BROWN
Emerson says, "To have a friend you must be a friend."
That, dear, is why you have so many.

CONTENTS
CHAPTER

I. "The Flittin'"
II. The House Opposite
III. The Princess
IV. The Beggar Maid
V. Their Meeting
VI. Mr. Wycherly Adds to His Responsibilities
VII. Jane-Anne Swears Fealty
VIII. Jane-Anne Assists Providence
IX. The Quest
X. Fortune's Wheel
XI. The Cult of Bruey
XII. Found!
XIII. A Far Cry
XIV. An Experiment
XV. The Philosophy of Beauty
XVI. The Pursuit Continued
XVII. The Philosophy of Effort
VIII. Gantry Bill
XIX. The Starling Flies Away

MR. WYCHERLY'S WARDS

CHAPTER I
"THE FLITTIN'"

"When lo there came a rumour,


A whispering to me
Of the grey town, the fey town,
The town where I would be."
FRANCIS BRETT BRETT-SMITH.
The village was thunderstruck. Nay, more; the village was
disapproving, almost scandalised.
It was astounded to the verge of incredulity when it heard that a
man who had lived in its midst quietly and peaceably for five-and-
twenty years was suddenly, and without any due warning whatsoever,
going to remove to the south of England not only himself, but the
entire household effects of a dwelling that had never belonged to him.
It is true that the minister pointed out to certain of these adverse
critics that by her will Miss Esperance had left both house and
furniture to Mr. Wycherly in trust for her great-nephews; but people
shook their heads: "Once the bit things were awa' to Oxford wha'
kenned what he'd dae wi' them?"
Such conscientious objectors mistrusted Oxford, and they deeply
distrusted the motives that led Mr. Wycherly to go there in little more
than a month after the death of his true and tried old friend.
That it was a return only made matters worse, and the postman,
who was also one of the church elders, summed up the feelings of the
community in the ominous words: "He has gone back to the husks."
Even Lady Alicia, who liked and trusted Mr. Wycherly, thought it
was odd of him to depart so soon, and that it would have been better
to have the boys up to Scotland for their Easter holidays.
What nobody realised was that poor Mr. Wycherly felt his loss so
poignantly, missed the familiar, beneficent presence so cruelly, that he
dreaded a like experience for the boys he loved. The "wee hoose" in
the time of its mistress had always been an abode of ordered
cheerfulness, and Mr. Wycherly wanted that memory and no other to
abide in the minds of the two boys.
It was all very well to point out to remonstrating neighbours that
March and not May is "the term" in England; that he was not moving
till April, and that the time would just coincide with their holidays and
thus save Edmund and Montagu the very long journey to Burnhead.
Neither of these were the real reasons.
The "wee hoose" had become intolerable to him. Hour by hour he
found himself waiting, ever listening intently for the light, loved
footstep; for the faint rustle that accompanies gracious, gentle
movements; for the sound of a kind and welcoming old voice. And
there came no comfort to Mr. Wycherly, till one day in a letter from
Montagu at Winchester he found these words: "I suppose now you
will go back to Oxford. Mr. Holt thinks you ought, and I'm sure Aunt
Esperance would like it. She always said she hoped you would go
back when she wasn't there any more. It must be dreadfully lonely
now at Remote, and it would be easier for us in the holidays."
"I suppose now you will go back to Oxford." All that day the
sentence rang in Mr. Wycherly's head. That night for the first time
since her death he slept well. He dreamed that he walked with Miss
Esperance in the garden of New College beside the ancient city wall,
and that she looked up at him, smiling, and said, "It is indeed good to
be here."
Next day, as Robina, the servant, put it, "he took the train," and
four days later returned to announce that he had rented a house in
Oxford and was going there almost at once.

* * * * *

If Mr. Wycherly's sudden move was made chiefly with the hope of
sparing the boys sadness and sense of bereavement in this, their first
holidays without their aunt, that hope was abundantly fulfilled.
It was a most delightful house: an old, old house in Holywell with
three gables resting on an oaken beam which, in its turn, was
supported by oak corbels in the form of dragons and a rotund,
festive-looking demon who nevertheless clasped his hands over "the
place where the doll's wax ends" as though he had a pain.
Two of the gables possessed large latticed windows, but the third
was blank, having, however, a tiny window at the side which looked
down the street towards New College.
At the back was a long crooked garden that widened out like a
tennis racquet at the far end.
It was all very delightful and exciting while the furniture was
going in and the three stayed at the King's Arms at the corner.
Edmund and Montagu between them took it upon themselves to
settle the whereabouts of the furniture and drove the removal men
nearly distracted by suggesting at least six positions for each thing as
it was carried in. But finally Mr. Wycherly was bound to confess that
there was a certain method in their apparent madness. For as the
rooms in Holywell filled up, he found that, allowing for difference in
their dimensions and, above all, their irregularity of shape, every big
piece of furniture was placed in relation to the rest exactly as it had
been in the small, square rooms at Remote.
Boys are very conservative, and in nothing more so than in their
attachment to the familiar. They pestered and worried that most
patient foreman till each room contained exactly the same furniture,
no more and no less, that had, as Edmund put it, "lived together" in
their aunt's house.
Then appeared a cloud on the horizon. Lady Alicia, who loved
arranging things for people, had very kindly written to a friend of her
own at Abingdon, and through her had engaged "a thoroughly
capable woman" to "do for" Mr. Wycherly in Oxford.
"She can get a young girl to help her if she finds it too much after
you're settled, but you ought to try and do with one at first; for a
move, and such a move—why couldn't you go into Edinburgh if you
want society?—will about ruin you. And, remember, no English servant
washes."
"Oh, Lady Alicia, I'm sure you are mistaken there," Mr. Wycherly
exclaimed, indignant at this supposed slur on his country-women. "I'm
sure they look even cleaner and neater than the Scotch."
"Bless the man! I'm not talking of themselves—I mean they won't
do the washing, the clothes and sheets and things; you'll have to put
it out or have someone in to do it. Is there a green?"
"There is a lawn," Mr. Wycherly said, dubiously—"it's rather a
pleasant garden."
"Is there a copper?"
"I beg your pardon?" replied the bewildered Mr. Wycherly,
thinking this must be some "appurtenance" to a garden of which he
was ignorant.
"There, you see, there are probably hundreds of things missing in
that house that ought to be in it. You'd better put out the washing."
Mr. Wycherly felt and looked distinctly relieved. The smell of wet
soapsuds that had always pervaded Remote on Monday mornings did
not appeal to him.
And now, when all the furniture was in its place and the carpets
laid; when the china and pots and pans had been unpacked by the
removal men and laid upon shelves; when the beds had been set up
and only awaited their customary coverings; on the very day that the
"thoroughly capable woman" was to come and take possession of it
all, there came a letter from her instead to the effect that "her mother
was took bad suddint," and she couldn't leave home. Nor did she
suggest any date in the near future when she would be at liberty to
come. Moreover, she concluded this desolating intelligence with the
remark, "after having thinking it over I should prefer to go where
there's a missus, so I hopes you'll arrange according."
Here was a knock-down blow!
They found the letter in the box at the new house when they
rushed there directly after breakfast to gloat over their possessions.
The wooden shutters were shut in the two downstairs sitting-
rooms; three people formed a congested crowd in the tiny shallow
entrance, even when one of the three was but ten years old. So they
went through the parlour and climbed a steep and winding staircase
to one of the two large front bedrooms. There, in the bright sunlight
of an April morning, Mr. Wycherly read aloud this perturbing missive.
"Bother the woman's mother," cried Edmund who was not of a
sympathetic disposition. "Let's do without one altogether, Guardie. We
could pretend we're the Swiss Family Robinson and have awful fun."
"I fear," said Mr. Wycherly sadly, "that I, personally, do not
possess the ingenuity of the excellent father of that most resourceful
family."
"Shall I telegraph to Lady Alicia?" asked Montagu, who had lately
discovered the joys of the telegraph office. "She could poke up that
friend of hers in Abingdon to find us an orphan."
"No!" replied Mr. Wycherly with decision. "We won't do that. We
must manage our own affairs as best we can and not pester our
friends with our misfortunes."
"How does one get servants?" asked Montagu.
Nobody answered. Even Edmund for once was at a loss. None of
the three had ever heard the servant question discussed. Old Elsa had
lived with Miss Esperance from girlhood; dying as she had lived in the
service of her beloved mistress. Robina had come when the little boys
were added to the household and remained till Mr. Wycherly left for
Oxford, when she at last consented to marry "Sandie the Flesher,"
who had courted her for nine long years.
Mr. Wycherly sat down on a chair beside his bed immersed in
thought. Montagu perched on the rail at the end of the bed and
surveyed the street from this eminence. As there were neither
curtains nor blinds in the window his view was unimpeded. Edmund
walked about the room on his hands till he encountered a tin-tack
that the men had left, then he sat on the floor noisily sucking the
wounded member.
It seemed that his gymnastic exercises had been mentally
stimulating, for he took his hand out of his mouth to remark:
"What's 'A High-class Registry Office for servants'?"
Mr. Wycherly turned to him in some excitement.
"I suppose a place where they keep the names of the disengaged
upon their books to meet the needs of those who seek servants.
Why? Have you seen one?"
Edmund nodded. "Yesterday, in yon street where you went to the
bookseller. It was about three doors up, a dingy window with a wire
blind and lots of wee cards with 'respectable' coming over and over
again. They were all 'respectable' whether they were ten pounds or
twenty-four. I read them while I was waiting for you."
"Dear me, Edmund," exclaimed Mr. Wycherly admiringly, "what an
observant boy you are. I'll go there at once and make inquiries. In the
meantime I daresay we could get a charwoman to come in and make
up the beds for us, and so move in to-morrow as arranged. They can't
all be very busy yet as the men have not come up."
"But there's only three beds," Edmund objected; "she can't make
them all day."
"She can do other things, doubtless," said Mr. Wycherly
optimistically; "she'll need to cook for us and," with a wave of the
hand, "dust, you know, and perhaps assist us to unpack some of
those cases that are as yet untouched. There are many ways in which
she could be most useful."
"I'd rather have Swissed it," Edmund murmured sorrowfully.
"Shall we come with you?" asked Montagu, who had an
undefined feeling that his guardian ought not to be left to do things
alone.
"No," said Mr. Wycherly, rising hastily. "You might, if you would be
so good, find the boxes that contain blankets and sheets and begin
unpacking them. I'll go to that office at once."
He hurried away, walking fast through the sunny streets, so
strange and yet so familiar, till he came to the window with the wire
blind that Edmund had indicated. Here he paused, fixed his
eyeglasses firmly on his nose and read the cards exhibited. Alas! they
nearly all referred to the needs of the servantless, and only two
emanated from handmaidens desirous of obtaining situations. Of
these, one was a nursemaid, and the other "as tweeny," a species
unknown to Mr. Wycherly, and as her age was only fourteen he did
not allow his mind to dwell upon her possibilities.
He opened the door and an automatic bell rang loudly. He shut
the door, when it rang again, greatly to his distress. He seemed to be
making so much noise.
The apartment was sparsely furnished with a largish table
covered with rather tired-looking ledgers; two cane chairs stood in
front of the table, while behind it was a larger leather-covered chair
on which was seated a stout, formidable woman, who glared rather
than looked at Mr. Wycherly as he approached.
She really was of great bulk, with several chins and what
dressmakers would call "a fine bust." Her garments were apparently
extremely tight, for her every movement was attended by an ominous
creaking. Her hair was frizzed in front right down to her light
eyebrows; at the back it was braided in tight plaits. She regarded Mr.
Wycherly with small, hostile eyes.
He had removed his hat on entrance, and stood before her with
dignified white head bowed in deference towards her, courteously
murmuring, "Good morning."
As she did not make any response, he continued, "I am in need
of a competent cook-housekeeper, and thought perhaps——"
"How many servants kep'?" she demanded with a fire and
suddenness that startled Mr. Wycherly.
"I had thought of trying to do with one."
"'Ow many in fambly?" and this alarming woman opened one of
the books in front of her and seized a pen. There was in her tone
such a dreadful suggestion of, "Anything you may say will be used
against you," that when she dipped her pen into the ink Mr. Wycherly
positively trembled; and grasped the back of one of the cane chairs as
a support.
"For the larger portion of the year I shall be alone," he said
rather sadly, "but during the holidays my two wards——"
"Male or female?"
"Really," Mr. Wycherly remonstrated, "what has that got to do
with it? As a matter of fact my wards are boys."
All this time she had been making entries in the ledger; now she
looked up to fire off, abruptly as before:
"The booking fee is one-and-six."
Mr. Wycherly took a handful of silver out of his pocket and
abstracted this sum and laid it upon the desk. She of the ledger
ignored the offering and continued her cross-examination:
"What wages?"
Mr. Wycherly mentally invoked a blessing upon Lady Alicia's
practical head as he replied quite glibly, "From twenty to twenty-five
pounds, but she must be trustworthy and capable."
"What outings?"
Here was a poser! But the fighting spirit had been roused in Mr.
Wycherly. He would not be browbeaten by this stout, ungracious
person who took his eighteenpence, and so far had done nothing but
ask questions, affording him no information whatsoever.
"That," he retorted with dignity, "can be arranged later on."
"Your name and address?" was the next query, and when he
furnished this information, carefully spelling his name, it pained him
inexpressibly to note that she wrote it down as "Witcherby," at the
same time remarking in a rumbling tone indicative of displeasure,
"Very old 'ouses, most inconvenient, most trying stairs.... 'Ow soon do
you want a general?"
"A what?" asked Mr. Wycherly, this time thoroughly mystified.
"A general, that's what she is if there's no more kep'. You won't
get no cook-'ousekeeper unless she's to 'ave 'er meals along with you,
and a little girl to do the rough work."
"She can't possibly have her meals with me," cried Mr. Wycherly,
crimson at the very thought. "It would be most unpleasant—for both
of us."
"Then as I said it's a general you wants."
"And have you upon your books any staid and respectable young
woman—preferably an orphan—" Mr. Wycherly interpolated,
remembering Montagu's suggestion, "who could come to us at once?"
"Not, so to speak, to-day, I 'aven't; but they often comes in of a
Monday, and I'll let you know. I could send 'er along; it isn't far."
The ledger was shut with a bang as an intimation that the
interview was at an end, and Mr. Wycherly fared forth into the street
with heated brow and a sense that, in spite of his heroism in braving
so dreadful a person, he was not much further on his quest. "Monday,
she said," he kept repeating to himself, "and to-day is only Thursday."
When he got back to Holywell, the boys were standing at the
front door on the lookout for him. They rushed towards him
exclaiming in delighted chorus: "We've got a woman. We thought
we'd ask at the King's Arms, and they told us of one."
"What? A servant?" asked Mr. Wycherly with incredulous joy.
"No, no, a day-body. The boots knew about her; she lives down
Hell Lane, just about opposite."
"Edmund!" Mr. Wycherly remonstrated. "However did you get
hold of that name?"
"Hoots!" replied Edmund. "Everyone calls it that. Her name is
Griffin, and she's coming at once. Have you got one?"
"No," said Mr. Wycherly, "not yet. Boys, it's a most bewildering
search. Can either of you tell me since when maid-servants have
taken to call themselves after officers in the army? The rather
alarming person in charge of that office informs me that what we
require is a 'general.' Do you suppose that if we should need a
younger maid to help her we must ask for a 'sub-lieutenant'?"
"Perhaps they are called generals when they're old," said
Montagu thoughtfully; "at that rate we ought to call Mrs. Griffin a
field-marshal. She's pretty old, I can tell you, but she's most
agreeable."
"Probably," said Mr. Wycherly, "in time to come they will get tired
of the army and take to the nomenclature of the Universities. Then
we shall have provosts and deans and wardens. But I'm glad that you
have been more successful than I have. I've no doubt we can manage
with Mrs. Griffin until we get a maid of our own."
"I think it was mean of that body with the mother," said Edmund;
"she didn't even say she'd come as soon as she could. But I think the
Griffin will be fun, and if she can't do it all we'll get the Mock-Turtle to
help her."
"Was it very high-class, that registry?" he continued; "it didn't
look at all grand outside."
"I cannot judge of its class, I have never been to such a place
before and I earnestly hope I may never be called upon to go there
again, for it is a species of inquisition, and they write your answers
down in a book. A horrid experience." And Mr. Wycherly shuddered.
By this time they had reached the house and he was sitting,
exhausted, in his arm-chair in his own dining-room. The boys had
opened the shutters and casement, and in spite of a thick coating of
dust everywhere it looked home-like and comfortable.
"Richly built, never pinchingly" is as true of ancient Oxford houses
as of her colleges. There seemed some mysterious affinity between
the queer old furniture from Remote and that infinitely older room.
The horse-hair sofa with the bandy legs and slippery seat that stood
athwart the fireless hearth was in no way discordant with the
beautiful stone fireplace and shallow mantelshelf.
Mr. Wycherly surveyed the scene with kind, pleased eyes; nor did
he realise then that what made it all seem so endearing and familiar
was the fact that on the horse-hair sofa there sprawled—"sat" is far
too decorous a word—a lively boy of ten, with rumpled, curly, yellow
hair and a rosy handsome face from which frank blue eyes looked
forth upon a world that, so far, contained little that he did not
consider in the light of an adventure.
While balanced on the edge of the table—again "sat" is quite
undescriptive—another boy swung his long legs while his hands were
plunged deep in his trouser pockets. A tall, thin boy this, with grave
dark eyes, long-lashed and gentle, and a scholar's forehead.
Montagu, nearly fourteen, had just reached the age when clothes
seem always rather small, sleeves short, likewise trousers: when
wrists are red and obtrusive and hair at the crown of the head stands
straight on end.
Neither of the boys ever sat still except when reading. Then
Montagu, at all events, was lost to the world. They frequently talked
loudly and at the same time, and were noisy, gay and restless as is
the usual habit of their healthy kind.
Strange companions truly for a scholarly recluse! Yet the boys
were absolutely at ease with and fearless of their guardian.
With him they were even more artlessly natural than with
schoolfellows of their own age. Their affection for him was literally a
part of their characters, and, in Montagu's case, passionately
protective. The elder boy had already realised how singularly unfitted
Mr. Wycherly was, both by temperament and habit, to grapple with
practical difficulties.
"Ah'm awfu' hungry," said Edmund presently, in broadest Doric.
"Edmund," remarked his guardian, "I have noticed on several
occasions since you returned from school that you persist in talking
exactly like the peasantry at Burnhead. Why?"
"Well, you see, Guardie, for one thing I'm afraid of forgetting it.
And then, you know, it amuses the chaps. They admire it very much."
"But you never did it in Scotland," Mr. Wycherly expostulated.
"Oh, didn't I. Not to you and Aunt Esperance, perhaps, but you
should have heard me when I got outside——
"I don't like it, Edmund, and I wonder your masters have not
found fault with you."
"They think I can't help it, and it makes them laugh—you should
hear me say my collect exactly like Sandie Croall——"
"Indeed I wish to hear nothing of the kind," said Mr. Wycherly in
dignified reproof. "I can't think why you should copy the lower classes
in your mode of speech."
"I'm a Bethune," Edmund replied in an offended voice. "I want
people to know I'm a Scot."
"Your name is quite enough to make them sure of that," Mr.
Wycherly argued, "and you may take it from me that Scottish
gentlemen don't talk in the least like Sandie Croall."
At that particular moment Edmund was busily engaged in doing a
handspring on the end of the sofa, so he forebore to reply. The fact
was, that like the immortal "Christina McNab" Edmund had, early in
his career at school, decided that to be merely "Scotch" was ordinary
and uninteresting, but to be "d—d Scotch" was both distinguished and
amusing, and he speedily attained to popularity and even a certain
eminence among his schoolfellows when he persisted in answering
every question with a broadness of vowel and welter of "r's"
characteristic of those whom Mr. Wycherly called "the peasantry of
Burnhead." Moreover, he used many homely and expressive adjectives
that were seized upon by his companions as a new and sonorous form
of slang. Altogether Edmund was a social success in the school world.
His report was not quite equally enthusiastic, but, as he
philosophically remarked to Montagu, "It would be monotonous for
Guardie if we both had good reports, and your's makes you out to be
a fearful smug."
Whereupon Montagu suitably chastised his younger brother with
a slipper, and the subject was held over to the next debate.
Presently there came a meek little tinkle from the side-door bell.
"That'll be the Griffin," cried Edmund joyfully; "I'll open to her."
It was the Griffin, and their troubles began in earnest.

CHAPTER II
THE HOUSE OPPOSITE

"Still on the spire the pigeons flutter;


Still by the gateway flits the gown;
Still on the street, from corbel and gutter,
Faces of stone look down.

Faces of stone, and other faces...."


A. T. QUILLER-COUCH.

Mrs. Griffin was not in the least like her name. She was a sidling,
snuffling, apologetic little woman, who, whenever a suggestion was
made, always acquiesced with breathless enthusiasm, gasping:
"Yessir; suttingly sir; anythink you please sir."
That night they dined at the comfortable King's Arms for the last
time and moved in after breakfast on the morrow. Mrs. Griffin did not
shine as a cook. Their first meal consisted of burnt chops, black
outside and of an angry purple within, watery potatoes and a stony
cauliflower. This was followed by a substantial apple dumpling whose
paste strongly resembled caramels in its consistency, while the apples
within were quite hard. Even the lumpy white sauce that tasted
chiefly of raw flour, hardly made this an appetising dish.
She had, it is true, by Mr. Wycherly's order, lit fires in all four front
rooms. The bedrooms were over the two living-rooms, and, like them,
were wainscotted, irregular in shape, and fairly large, light and well-
proportioned, each with wide casement window. Except the study,
every room in the house had at least two doors, and between the two
front bedrooms there was yet another, in a delightful, passage-like
recess. In Mr. Wycherly's study, which was on the first floor at the
back—with a high oriel window that looked forth on the garden—no
fire had been put as yet, for his books were not unpacked but stood
in great wooden cases, stacked against the wall, one on the top of the
other, three deep. Wisps of straw and pieces of paper still lay about;
and where his books were concerned Mr. Wycherly was quite
practical.
During the day Mrs. Griffin, as she put it, "swep' up the bits" in
the other rooms (Mr. Wycherly locked the study and carried the key),
and volunteered to go out and "get in some stores" for the morrow.
This offer he gratefully accepted, entrusting her with a couple of
sovereigns to that end. It took her the whole afternoon, and she
seemed to have patronised a variety of shops, for Mr. Wycherly, who
remained in the house to look after it, was kept busy answering the
side door and receiving parcels.

You might also like