实例介绍
For courses in Computer Science and Programming Computer systems: A Programmer’s Perspective explains the underlying elements common among all computer systems and how they affect general application performance. Written from the programmer’s perspective, this book strives to teach students how unde
This page is intentionally left blank. Computer Systems a Py rogrammer's Perspective THIRD EDITION GLOBAL EDITION Randal. bryant Carnegie mellon university Davidrohallaron Carnegie Mellon University Global edition contributions bi Manasa s NMAM Institute of Technology Mohit tahiliani National Institute of Technology karnataka PEARSON Boston Columbus Hoboken Indianapolis New York San francisco Amsterdam Cape Town Dubai London Madrid Milan Munich Paris Montreal Toronto Delhi Mexico City Sao Paulo Sydney Hong Kong Seoul Singapore Taipei Tokyo Vice President and Editorial Director: Marcia J. Horton Senior Production Manufacturing Controller, Executive Editor: Matt Goldstein Global Editions: Trudy Kimber Editorial Assistant: Kelsey Loans Procurement Manager: Mary Fischer Acquisitions Editor, Global Editions: Karthik Subramanian Senior Specialist, Program Planning and Support: VP of Marketing Christy Lesko Maura zaldivar-Garcia Director of Field Marketing: Tim Galligan Media Production Manager, Global Editions Product Markcting Manager: Bram van Kcmpcn Ⅴ ikram Kumar Field Marketing Manager: Demetrius hall Cover Designer: Lumina Datamatics Marketing Assistant: Jon bryant Manager, Rights Management: Rachel Youdelman Director of Product Management: Erin Gregg Associate Project Manager, Rights Management Team Lead Product Management: Scott Disanno William J. opaluch Program Manager: Joanne Manning Full-Service Project Management: Paul Anagnostopoulos Project Editor, Global Editions: K.K. Neelakantan Windfall Software Pearson education limited Edinburgh gate Harlow Essex cm20 JE England and Associated Companies throughout the world Visit us on the world widc Web at www.pearsonglobaleditions.com C Pearson Education Limited 2016 The rights of Randal e. Bryant and David r. O hallaron to be identified as the authors of this work have been asserted by them in accordance with the Copyright, Designs and Patents Act 1988 Authorized adaptation from the United States edition, entitled Computer Systems: A Programmer's Perspective, 3rd edition, ISBN978-0-13-409266-9, by Randal e. Bryant and David R O Hallaron published by Pearson Education C 2016 All rights reserved. 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 or otherwise, without either the prior written permission of the publisher or a license permitting restricted copying in the United Kingdom issued by the Copyright licensing Agency Ltd Saffron House, 6-10 Kirby Street, London ECIN STS All trademarks used herein are the property of their respective owners. The use of any trademark in this text does not vest in the author or publisher any trademark ownership rights in such trademarks, nor does the use of such trademarks imply any affiliation with or endorsement of this book by such owners British Library Cataloguing-in-Publication Data a catalogue record for this book is available from the british library 10987654321 ISBN10:1-292-10176-8 ISBN13:978-1-292-10176-7( Print) ISBN13:978-1-488-67207-1(PDF) Typeset in 10/12 Times Ten, ITC Stone Sans by Windfall Software Printed in malaysia To the students and instructors of the 15-213 course at Carnegie Mellon University, for inspiring us to develop and refine the material for this book Masteringengineering For Computer SystemS: A Programmer's perspective third edition Mastering is Pearson's proven online Tutorial Homework program, newly available with the third edition of Computer Systems: A Programmer's Perspective. The Mastering platform allows you to integrate dynamic homework--with many problems taken directly from the Bryant/o'Hallaron textbook--with automatic grading. Mastering allows you to easily track the performance of your entire class on an assignment -- assignment basis or view the detailed work of an individual student Formoreinformationorademonstrationofthecoursevisitwww.masteringengINeering.com Contents Preface 19 About the authors 3.5 1 A Tour of computer Systems 37 1.1 Information is bits Context 39 1.2 Programs Are Translated by Other Programs into Different Forms 40 It Pays to Understand How Compilation Systems Work 42 1. 4 Processors Read and Interpret Instructions Stored in Memory 43 1.4.1 Hardware Organization of a System 44 1.4.2 Running the hello Program 46 1.5 Caches matter 47 1.6 Storage Devices Form a Hierarchy 50 1.7 The Operating system Manages the Hardware 50 1.7.1P s51 1.7.2 Threads 53 1.7.3 Virtual Memory 54 1.7.4 Files 55 1.8 Systems Communicate with Other Systems Using Networks 55 1.9 Important Themes 58 1.9.1 Amdahl's Law 58 1.9.2 Concurrency and Parallelism 60 1.9.3 The Importance of Abstractions in Computer Systems 62 1.10 Summary 63 Bibliographic Notes 64 Solutions to practice problems 64 PartI Program Structure and Execution 2 Representing and Manipulating Information 67 2.1 Information Storage 70 2.1.1 Hexadecimal Notation 72 2.1.2 Data sizes 75 8 Contents 2.1.3 Addressing and Byte Ordering 78 2.1.4 Representing Strings 85 2.1.5 Representing Code 85 2.1.6 Introduction to Boolean algebra 86 2.1.7 Bit-Level Operations in C 90 2.1.8 Logical Operations inc 92 2.1.9 Shift Operations in C 93 2.2 Integer Representations 95 2.2.1 Integral Data Types 96 2.2.2 Unsigned Encodings 98 2.2.3 Two's-Complement Encodings 100 2.2.4 Conversions between Signed and Unsigned 106 2.2.5 Signed versus Unsigned in C 110 2.2.6 Expanding the Bit Representation of a Number 112 2.2.7 Truncating Numbers 117 2.2.8 Advice on Signed versus Unsigned 119 2.3 Intcger Arithmetic 120 2.3.1 Unsigned Addition 120 2.3.2 Twos-Complement Addition 126 2.3.3 Twos-Complement Negation 131 2.3.4 Unsigned Multiplication 132 2.3.5 Twos-Complement Multiplication 133 2.3.6 Multiplying by Constants 137 2.3.7 Dividing by Powers of 2 139 2.3.8 Final Thoughts on Integer Arithmetic 143 2. 4 Floating point 144 2.4.1 Fractional binary Numbers 145 2.4.2 IEEE Floating-Point Representat 2.4.3 Example numbers 151 24.4 Round 156 2.4.5 Floating-Point Operati 2.4.6 Floating Point inC 160 2.5 Summary 162 Bibliographic note Homework problems 164 Solutions to Practice Problems 179 3 Machine-Level Representation of Programs 199 3.1 A Historical Perspective 202 Contents 9 3.2 Program Encodings 205 3.2.1 Machine-Level code 206 3.2.2 Code Examples 208 3.2.3 Notes on Formatting 211 3.3 Data Formats 213 3.4 Accessing Information 215 3.4.1 Operand Specifiers 216 3.4.2 Data movement instructions 218 3.4.3 Data Movement Example 222 3.4.4 Pushing and Popping Stack Data 225 3.5 Arithmetic and Logical Opcrations 227 3.5.1 Load Effective address 227 3.5.2 Unary and Binary Opcrations 230 3.5.3 Shift Operations 230 3.5.4 Discussion 232 3.5.5 Special Arithmetic Operations 233 3.6 Control 236 3.6.1 Condition Codes 237 3.6.2 Accessing the Condition Codes 238 3.6.3 Jump Instructions 241 3.6.4 Jump Instruction Encodings 243 3.6.5 Implementing conditional branches with Conditional control 245 3.6.6 Implementing Conditional Branches with Conditional moves 250 3.6.7 Loops 256 3.6.8 Switch Statements 268 3.7 Procedures 274 3.7.1 The run-Time stack 275 3.7.2 Control Transfer 277 3.7.3 Data Transfer 281 3.7. 4 Local Storage on the Stack 284 3.7.5 Local Storage in Registers 287 3.7.6 Recursive procedures 289 3.8 Array Allocation and Access 291 3.8.1 Basic Principles 291 3.8.2 Pointer arithmetic 293 3.8.3 Nested Arrays 294 3.8.4 Fixed-Size Arrays 296 3.8.5 Variable-Size arrays 298 【实例截图】
【核心代码】
标签:
小贴士
感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。
- 类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
- 相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
- 提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
- 请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。
关于好例子网
本站旨在为广大IT学习爱好者提供一个非营利性互相学习交流分享平台。本站所有资源都可以被免费获取学习研究。本站资源来自网友分享,对搜索内容的合法性不具有预见性、识别性、控制性,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,平台无法对用户传输的作品、信息、内容的权属或合法性、安全性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论平台是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二与二十三条之规定,若资源存在侵权或相关问题请联系本站客服人员,点此联系我们。关于更多版权及免责申明参见 版权及免责申明
网友评论
我要评论