Inside the Machine the Inside A Look Inside the Silicon Heart of Modern Computing Architecture Computer and Microprocessors to Introduction Illustrated An Computers perform countless tasks ranging from the business critical to the recreational, but regardless of how differently they may look and behave, they’re all amazingly similar in basic function. Once you understand how the microprocessor—or central processing unit (CPU)— Includes discussion of: works, you’ll have a firm grasp of the fundamental concepts at the heart of all modern computing. • Parts of the computer and microprocessor • Programming fundamentals (arithmetic Inside the Machine, from the co-founder of the highly instructions, memory accesses, control respected Ars Technica website, explains how flow instructions, and data types) microprocessors operate—what they do and how • Intermediate and advanced microprocessor they do it. The book uses analogies, full-color concepts (branch prediction and speculative diagrams, and clear language to convey the ideas execution) that form the basis of modern computing. After • Intermediate and advanced computing discussing computers in the abstract, the book concepts (instruction set architectures, examines specific microprocessors from Intel, RISC and CISC, the memory hierarchy, and IBM, and Motorola, from the original models up encoding and decoding machine language through today’s leading processors. It contains the instructions) most comprehensive and up-to-date information • 64-bit computing vs. 32-bit computing available (online or in print) on Intel’s latest • Caching and performance processors: the Pentium M, Core, and Core 2 Duo. Inside the Machine also explains technology terms Inside the Machine is perfect for students of and concepts that readers often hear but may not science and engineering, IT and business fully understand, such as “pipelining,” “L1 cache,” professionals, and the growing community “main memory,” “superscalar processing,” and of hardware tinkerers who like to dig into the “out-of-order execution.” guts of their machines. Jon “Hannibal” Stokes is co-founder and Senior CPU Editor of Ars Technica. He has written for a variety of publications on microprocessor architecture and the technical aspects of personal computing. Stokes holds a degree in computer engineering from Louisiana State University and two advanced degrees in the humanities from Harvard University. He is currently pursuing a Ph.D. at the University of Chicago. “This is, by far, the most well written text that I have seen on the subject of computer architecture.” Stokes An Illustrated Introduction to —John Stroman, Technical Account Manager, Intel Microprocessors and Computer Architecture THE FINEST IN GEEK ENTERTAINMENT™ www.nostarch.com $49.95 ($61.95 cdn) shelve in: Computer Hardware ISBN: 978-1-59327-104-6 5 4 9 9 5 Jon Stokes 9 7 81 5 93 2 71 04 6 6 89 1 45 7 10 42 7 INSIDE THE MACHINE ® San Francisco itm_TITLE_COPY.fm Page iv Wednesday, March 14, 2007 2:57 PM INSIDE THE MACHINE. Copyright © 2007 by Jon Stokes. All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system, without the prior written permission of the copyright owner and the publisher. Printed in Canada 10 09 08 07 2 3 4 5 6 7 8 9 ISBN-10: 1-59327-104-2 ISBN-13: 978-1-59327-104-6 Publisher: William Pollock Production Editor: Elizabeth Campbell Cover Design: Octopod Studios Developmental Editor: William Pollock Copyeditors: Sarah Lemaire, Megan Dunchak Compositor: Riley Hoffman Proofreader: Stephanie Provines Indexer: Nancy Guenther For information on book distributors or translations, please contact No Starch Press, Inc. directly: No Starch Press, Inc. 555 De Haro Street, Suite 250, San Francisco, CA 94107 phone: 415.863.9900; fax: 415.863.9950; [email protected]; www.nostarch.com Library of Congress Cataloging-in-Publication Data Stokes, Jon Inside the machine : an illustrated introduction to microprocessors and computer architecture / Jon Stokes. p. cm. Includes index. ISBN-13: 978-1-59327-104-6 ISBN-10: 1-59327-104-2 1. Computer architecture. 2. Microprocessors--Design and construction. I. Title. TK7895.M5S76 2006 621.39'2--dc22 2005037262 No Starch Press and the No Starch Press logo are registered trademarks of No Starch Press, Inc. Other product and company names mentioned herein may be the trademarks of their respective owners. Rather than use a trademark symbol with every occurrence of a trademarked name, we are using the names only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. The information in this book is distributed on an “As Is” basis, without warranty. While every precaution has been taken in the preparation of this work, neither the author nor No Starch Press, Inc. shall have any liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the information contained in it. The photograph in the center of the cover shows a small portion of an Intel 80486DX2 microprocessor die at 200x optical magnification. Most of the visible features are the top metal interconnect layers which wire most of the on-die components together. Cover photo by Matt Britt and Matt Gibbs. To my parents, who instilled in me a love of learning and education, and to my grandparents, who footed the bill. BRIEF CONTENTS Preface ........................................................................................................................ xv Acknowledgments ....................................................................................................... xvii Introduction ................................................................................................................. xix Chapter 1: Basic Computing Concepts ............................................................................. 1 Chapter 2: The Mechanics of Program Execution ............................................................. 19 Chapter 3: Pipelined Execution ...................................................................................... 35 Chapter 4: Superscalar Execution .................................................................................. 61 Chapter 5: The Intel Pentium and Pentium Pro .................................................................. 79 Chapter 6: PowerPC Processors: 600 Series, 700 Series, and 7400................................ 111 Chapter 7: Intel’s Pentium 4 vs. Motorola’s G4e: Approaches and Design Philosophies...... 137 Chapter 8: Intel’s Pentium 4 vs. Motorola’s G4e: The Back End ....................................... 161 Chapter 9: 64-Bit Computing and x86-64 ..................................................................... 179 Chapter 10: The G5: IBM’s PowerPC 970 .................................................................... 193 Chapter 11: Understanding Caching and Performance................................................... 215 Chapter 12: Intel’s Pentium M, Core Duo, and Core 2 Duo ............................................. 235 Bibliography and Suggested Reading ........................................................................... 271 Index ........................................................................................................................ 275 CONTENTS IN DETAIL PREFACE xv ACKNOWLEDGMENTS xvii INTRODUCTION xix 1 BASIC COMPUTING CONCEPTS 1 The Calculator Model of Computing ........................................................................... 2 The File-Clerk Model of Computing ............................................................................. 3 The Stored-Program Computer ...................................................................... 4 Refining the File-Clerk Model ........................................................................ 6 The Register File ....................................................................................................... 7 RAM: When Registers Alone Won’t Cut It ................................................................... 8 The File-Clerk Model Revisited and Expanded ................................................. 9 An Example: Adding Two Numbers ............................................................. 10 A Closer Look at the Code Stream: The Program ........................................................ 11 General Instruction Types ........................................................................... 11 The DLW-1’s Basic Architecture and Arithmetic Instruction Format .................... 12 A Closer Look at Memory Accesses: Register vs. Immediate ......................................... 14 Immediate Values ...................................................................................... 14 Register-Relative Addressing ....................................................................... 16 2 THE MECHANICS OF PROGRAM EXECUTION 19 Opcodes and Machine Language ............................................................................ 19 Machine Language on the DLW-1 ............................................................... 20 Binary Encoding of Arithmetic Instructions .................................................... 21 Binary Encoding of Memory Access Instructions ............................................ 23 Translating an Example Program into Machine Language ............................... 25
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages320 Page
-
File Size-