Mostafa Abd-El-BarrKing Fahd University of Petroleum & Minerals (KFUPM)

    Hesham El-RewiniSouthern Methodist University




    SERIES EDITOR: Albert Y. Zomaya

    Parallel & Distributed Simulation Systems / Richard Fujimoto

    Surviving the Design of Microprocessor and Multimicroprocessor Systems:

    Lessons Learned / Veljko Milutinovic

    Mobile Processing in Distributed and Open Environments / Peter Sapaty

    Introduction to Parallel Algorithms / C. Xavier and S.S. Iyengar

    Solutions to Parallel and Distributed Computing Problems: Lessons from

    Biological Sciences / Albert Y. Zomaya, Fikret Ercal, and Stephan Olariu (Editors)

    New Parallel Algorithms for Direct Solution of Linear Equations /C. Siva Ram Murthy, K.N. Balasubramanya Murthy, and Srinivas Aluru

    Practical PRAM Programming / Joerg Keller, Christoph Kessler, andJesper Larsson Traeff

    Computational Collective Intelligence / Tadeusz M. Szuba

    Parallel & Distributed Computing: A Survey of Models, Paradigms, and

    Approaches / Claudia Leopold

    Fundamentals of Distributed Object Systems: A CORBA Perspective /Zahir Tari and Omran Bukhres

    Pipelined Processor Farms: Structured Design for Embedded Parallel

    Systems / Martin Fleury and Andrew Downton

    Handbook of Wireless Networks and Mobile Computing / Ivan Stojmenoviic(Editor)

    Internet-Based Workflow Management: Toward a Semantic Web /Dan C. Marinescu

    Parallel Computing on Heterogeneous Networks / Alexey L. Lastovetsky

    Tools and Environments for Parallel and Distributed Computing Tools /Salim Hariri and Manish Parashar

    Distributed Computing: Fundamentals, Simulations and Advanced Topics,

    Second Edition / Hagit Attiya and Jennifer Welch

    Smart Environments: Technology, Protocols and Applications /Diane J. Cook and Sajal K. Das (Editors)

    Fundamentals of Computer Organization and Architecture / M. Abd-El-Barrand H. El-Rewini


    Mostafa Abd-El-BarrKing Fahd University of Petroleum & Minerals (KFUPM)

    Hesham El-RewiniSouthern Methodist University


  • This book is printed on acid-free paper. 1

    Copyright # 2005 by John Wiley & Sons, Inc. All rights reserved.

    Published by John Wiley & Sons, Inc., Hoboken, New Jersey.

    Published simultaneously in Canada.

    No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or

    by any means, electronic, mechanical, photocopying, recording, scanning, or otherwise, except as

    permitted under Section 107 or 108 of the 1976 United States Copyright Act, without either the prior

    written permission of the Publisher, or authorization through payment of the appropriate per-copy

    fee to the Copyright Clearance Center, Inc., 222 Rosewood Drive, Danvers, MA 01923,

    for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc.,

    111 River Street, Hoboken, NJ 07030; (201) 748-6011, fax (201) 748-6008.

    Limit of Liability/Disclaimer of Warranty: While the publisher and author have used their best efforts

    in preparing this book, they make no representations or warranties with respect to the accuracy or

    completeness of the contents of this book and specifically disclaim any implied warranties of

    merchantability or fitness for a particular purpose. No warranty may be created or extended by sales

    representatives or written sales materials. The advice and strategies contained herein may not be

    suitable for your situation. You should consult with a professional where appropriate. Neither the

    publisher nor author shall be liable for any loss of profit or any other commercial damages, including

    but not limited to special, incidental, consequential, or other damages.

    For general information on our other products and services please contact our Customer Care Department

    within the U.S. at 877-762-2974, outside the U.S. at 317-572-3993 or fax 317-572-4002.

    Wiley also publishes its books in a variety of electronic formats. Some content that appears in print,

    however, may not be available in electronic format.

    Library of Congress Cataloging-in-Publication Data:

    Abd-El-Barr, Mostafa.

    Fundamentals of computer organization and architecture / Mostafa Abd-El-Barr, Hesham El-Rewini

    p. cm. (Wiley series on parallel and distributed computing)

    Includes bibliographical references and index.

    ISBN 0-471-46741-3 (cloth volume 1) ISBN 0-471-46740-5 (cloth volume 2)

    1. Computer architecture. 2. Parallel processing (Electronic computers) I. Abd-El-Barr, Mostafa, 1950

    II. Title. III. Series.

    QA76.9.A73E47 2004



    Printed in the United States of America

    10 9 8 7 6 5 4 3 2 1

    978-750-8400, fax 978-646-8600, or on the web at Requests to the Publisher

  • To my family members (Ebtesam, Muhammad, Abd-El-Rahman, Ibrahim, and Mai)

    for their support and love

    Mostafa Abd-El-Barr

    To my students, for a better tomorrow

    Hesham El-Rewini


    Preface xi

    1. Introduction to Computer Systems 1

    1.1. Historical Background 2

    1.2. Architectural Development and Styles 4

    1.3. Technological Development 5

    1.4. Performance Measures 6

    1.5. Summary 11

    Exercises 12

    References and Further Reading 14

    2. Instruction Set Architecture and Design 15

    2.1. Memory Locations and Operations 15

    2.2. Addressing Modes 18

    2.3. Instruction Types 26

    2.4. Programming Examples 31

    2.5. Summary 33

    Exercises 34

    References and Further Reading 35

    3. Assembly Language Programming 37

    3.1. A Simple Machine 38

    3.2. Instructions Mnemonics and Syntax 40

    3.3. Assembler Directives and Commands 43

    3.4. Assembly and Execution of Programs 44

    3.5. Example: The X86 Family 47

    3.6. Summary 55

    Exercises 56

    References and Further Reading 57

    4. Computer Arithmetic 59

    4.1. Number Systems 59

    4.2. Integer Arithmetic 63


  • 4.3 Floating-Point Arithmetic 74

    4.4 Summary 79

    Exercises 79

    References and Further Reading 81

    5. Processing Unit Design 83

    5.1. CPU Basics 83

    5.2. Register Set 85

    5.3. Datapath 89

    5.4. CPU Instruction Cycle 91

    5.5. Control Unit 95

    5.6. Summary 104

    Exercises 104

    References 106

    6. Memory System Design I 107

    6.1. Basic Concepts 107

    6.2. Cache Memory 109

    6.3. Summary 130

    Exercises 131

    References and Further Reading 133

    7. Memory System Design II 135

    7.1. Main Memory 135

    7.2. Virtual Memory 142

    7.3. Read-Only Memory 156

    7.4. Summary 158

    Exercises 158

    References and Further Reading 160

    8. InputOutput Design and Organization 161

    8.1. Basic Concepts 162

    8.2. Programmed I/O 1648.3. Interrupt-Driven I/O 1678.4. Direct Memory Access (DMA) 175

    8.5. Buses 177

    8.6. InputOutput Interfaces 181

    8.7. Summary 182

    Exercises 183

    References and Further Reading 183

    viii CONTENTS

  • 9 Pipelining Design Techniques 185

    9.1. General Concepts 185

    9.2. Instruction Pipeline 187

    9.3. Example Pipeline Processors 201

    9.4. Instruction-Level Parallelism 207

    9.5. Arithmetic Pipeline 209

    9.6. Summary 213

    Exercises 213

    References and Further Reading 215

    10 Reduced Instruction Set Computers (RISCs) 215

    10.1. RISC/CISC Evolution Cycle 21710.2. RISCs Design Principles 218

    10.3. Overlapped Register Windows 220

    10.4. RISCs Versus CISCs 221

    10.5. Pioneer (University) RISC Machines 223

    10.6. Example of Advanced RISC Machines 227

    10.7. Summary 232

    Exercises 233

    References and Further Reading 233

    11 Introduction to Multiprocessors 235

    11.1. Introduction 235

    11.2. Classification of Computer Architectures 236

    11.3. SIMD Schemes 244

    11.4. MIMD Schemes 246

    11.5. Interconnection Networks 252

    11.6. Analysis and Performance Metrics 254

    11.7. Summary 254

    Exercises 255

    References and Further Reading 256

    Index 259



    This book is intended for students in computer engineering, computer science,

    and electrical engineering. The material covered in the book is suitable for a one-

    semester course on Computer Organization & Assembly Language and a one-

    semester course on Computer Architecture. The book assumes that students

    studying computer organization and/or computer architecture must have hadexposure to a basic course on digital logic design and an introductory course on

    high-level computer language.

    This book reflects the authors experience in teaching courses on computer organ-

    ization and computer architecture for more than fifteen years. Most of the material

    used in the book has been used in our undergraduate classes. The coverage in the

    book takes basically two viewpoints of computers. The first is the programmers

    viewpoint and the second is the overall structure and function of a computer. The

    first viewpoint covers what is normally taught in a junior level course on Computer

    Organization and Assembly Language while the second viewpoint covers what