Fundamentals of Computer Architecture
Fundamentals of Computer Architecture
Architecture
Fundamentals of Computer
Architecture
Mark Burrell
c Mark Burrell, 2004
All rights reserved. No reproduction, copy or transmission of this
publication may be made without written permission.
No paragraph of this publication may be reproduced, copied or transmitted
save with written permission or in accordance with the provisions of the
Copyright, Designs and Patents Act 1988, or under the terms of any licence
permitting limited copying issued by the Copyright Licensing Agency, 90
Tottenham Court Road, London W1T 4LP.
Any person who does any unauthorised act in relation to this publication
may be liable to criminal prosecution and civil claims for damages.
The authors have asserted their rights to be identified
as the author of this work in accordance with the Copyright,
Designs and Patents Act 1988.
First published 2004 by
PALGRAVE MACMILLAN
Houndmills, Basingstoke, Hampshire RG21 6XS and
175 Fifth Avenue, New York, N.Y. 10010
Companies and representatives throughout the world
PALGRAVE MACMILLAN is the global academic imprint of the Palgrave
Macmillan division of St. Martin’s Press, LLC and of Palgrave Macmillan Ltd.
Macmillan r is a registered trademark in the United States, United Kingdom
and other countries. Palgrave is a registered trademark in the European Union
and other countries.
ISBN 978-0-333-99866-3 ISBN 978-1-137-11313-9 (eBook)
DOI 10.1007/978-1-137-11313-9
This book is printed on paper suitable for recycling and made from fully
managed and sustained forest sources.
A catalogue record for this book is available from the British Library.
10 9 8 7 6 5 4 3 2 1
13 12 11 10 09 08 07 06 05 04
Contents
Preface xv
Acknowledgements xxi
Chapter overview 3
Chapter summary 15
Chapter overview 17
v
Fundamentals of Computer Architecture
Chapter summary 38
Chapter overview 43
Chapter summary 61
Chapter 4 Registers 63
Chapter overview 63
Chapter summary 78
vi
Contents
Chapter overview 81
Chapter summary 99
vii
Fundamentals of Computer Architecture
viii
Contents
ix
Fundamentals of Computer Architecture
x
Contents
xi
Fundamentals of Computer Architecture
V Appendices 313
xii
Contents
xiii
Fundamentals of Computer Architecture
Bibliography 475
Index 477
xiv
Preface
This book teaches the reader how the key components of any computer - the
processor and memory - actually work. This core topic of computing is known
as computer architecture and organization.
To meet this essential aim the text is based around a software simulation of a
simple processor. By using a simplified processor the student gains an under-
standing of the fundamental concepts of computer systems architecture and
organization, upon which he or she can subsequently build to understand the
more advanced facilities and techniques employed by modern day processors.
xv
Fundamentals of Computer Architecture
This book is intended to be the primary text for a first computer architecture
course - PDF slides for each chapter are available from the book website
(details are within this preface).
The book can be used in a number of ways, to suit the wide range of computer
architecture syllabi.
The exercises at the end of chapters can be used as either seminar or home-
work materials as required. All solutions are available to lecturers from the
website listed later.
This book consists of four key parts, together with a number of appendices.
The main parts are: -
Each section consists of a number of chapters - the largest sections being the
first two. Each chapter consists of the same sub-divisions. These are:
xvi
Preface
An overview;
The main body of the chapter (using practical examples, either programs
for a simulated processor called JASP or circuit designs for a circuit
simulation tool called Digital Works);
A summary;
Where appropriate, a set of self test questions - answers are in appendix
G;
Where appropriate, a set of further exercises to aid the learning process.
The contents of each section and the chapters within it are given below.
We look at the processor from the viewpoint of the hardware engineer. This
part establishes the key concepts and introduces a simple processor, focusing
on how it can be built from relatively basic elements (registers, an ALU, a
control unit, and buses to interconnect them). We then discuss how these
elements, in conjunction with a memory, form a basic computer system.
We look at the processor from the point of view of the programmer. This
part establishes the practical usability of such a processor, starting with sim-
ple programs and building up to using memory-mapped I/O and interrupts.
Additionally, tools that can be used to aid program development are discussed.
In this final part we take a look at the features of real processors and point
out the similarities they share with our simple processor - and hence come
full circle by showing the relevance, simplicity and practicality of our simple
processor as a basis for understanding modern processors.
xvii
Fundamentals of Computer Architecture
Appendices
The appendices contain reference material for the JASP processor and its
instruction sets as well as a brief introduction to the Digital Works package.
Software
The software packages distributed with this text are the JASP toolkit and
Digital Works. Each is detailed below.
The JASP toolkit is based around the design of a simple processor named
JASP - Just Another Simulated Processor.
Most screen shots of JASPer within this text make use of a simple graphic
display to better show the functionality of the processor.
All the tools within the JASP toolkit are copyright Mark Burrell, except for the
C−− cross-compiler which is copyright David Harrison.
Digital Works
xviii
Preface
Is There A Website?
http://www.palgrave.com/science/computing/burrell/
Mark has held a UK Private Pilot’s License since 1995, although he doesn’t
get time to use it these days - instead he currently get his kicks by riding fast
motorcycles.
xix
Acknowledgements
I would like to thank the many friends and colleagues who helped me, in so
many ways, to write this text. They include Jago Boardman, Michael Brockway,
Ian Chilton, Jonathan Edwards, Mark Elsom-Cook, David Harrison, William
Henderson, Dan Hodgson, Adrian Jones, Alun Moon, Tony Morrell, John
Morton, Adrian Robson, Gregor Schwake and Iain Wallace. Apologies to all
those I have inadvertently missed out, my thanks and appreciation go to you
all.
I must also thank Dave Hatter and Rebecca Mashayekh of Palgrave and John
Dobson of Matrix Multimedia for their great support of this text.
Additionally, I must thank the couple of thousand students who have helped
field test JASPer for the last eight years or so. Special mention goes to those
students who took time out to find errors, query particular sections, and gener-
ally help improve this text, notably Merle Cavagin, Sam Stevens, Lee Charlton
and Wai-Ching Leung. This text is better for their input.
Lastly, as is traditional, I must of course point out that any remaining errors
within this text are entirely my own.
xxi