0% found this document useful (1 vote)
587 views115 pages

Digital Design and Computer Architecture. ARM Edition David Harris Instant Access 2025

Learning content: Digital design and computer architecture. ARM Edition David HarrisImmediate access available. Includes detailed coverage of core topics with educational depth and clarity.

Uploaded by

axxzilh9631
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
0% found this document useful (1 vote)
587 views115 pages

Digital Design and Computer Architecture. ARM Edition David Harris Instant Access 2025

Learning content: Digital design and computer architecture. ARM Edition David HarrisImmediate access available. Includes detailed coverage of core topics with educational depth and clarity.

Uploaded by

axxzilh9631
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/ 115

Digital design and computer architecture.

ARM
Edition David Harris Updated 2025

https://ebookmass.com/product/digital-design-and-computer-
architecture-arm-edition-david-harris/

★★★★★
4.6 out of 5.0 (28 reviews )

Instant PDF Download

ebookmass.com
Digital design and computer architecture. ARM Edition David
Harris Pdf Download

EBOOK

Available Formats

■ PDF eBook Study Guide Ebook

EXCLUSIVE 2025 EDUCATIONAL COLLECTION - LIMITED TIME

INSTANT DOWNLOAD VIEW LIBRARY


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

Digital Design and Computer Architecture: RISC-V Edition


Sarah Harris & David Harris

https://ebookmass.com/product/digital-design-and-computer-
architecture-risc-v-edition-sarah-harris-david-harris/

Computer architecture: a quantitative approach Sixth


Edition Hennessy

https://ebookmass.com/product/computer-architecture-a-quantitative-
approach-sixth-edition-hennessy/

Digital Design: Principles and Practices 5th Edition


Wakerly

https://ebookmass.com/product/digital-design-principles-and-
practices-5th-edition-wakerly/

Computer Organization and Architecture: Designing for


performance, Global Edition, 11th Edition William
Stallings
https://ebookmass.com/product/computer-organization-and-architecture-
designing-for-performance-global-edition-11th-edition-william-
stallings/
Computer Organization And Architecture. Designing For
Performance. 11 Global Edition Edition William Stallings

https://ebookmass.com/product/computer-organization-and-architecture-
designing-for-performance-11-global-edition-edition-william-stallings/

Introduction to 80×86 Assembly Language and Computer


Architecture – Ebook PDF Version

https://ebookmass.com/product/introduction-to-8086-assembly-language-
and-computer-architecture-ebook-pdf-version/

Oxford Mathematics: Applications and Interpretation Higher


Level Course Companion First Edition David Harris

https://ebookmass.com/product/oxford-mathematics-applications-and-
interpretation-higher-level-course-companion-first-edition-david-
harris/

Digital Milton 1st ed. Edition David Currell

https://ebookmass.com/product/digital-milton-1st-ed-edition-david-
currell/

On Digital Architecture in Ten Books. Volume 1 On Digital


Architecture in Ten Books: Vol. 1: Books I–III. Ludger
Hovestadt (Editor)
https://ebookmass.com/product/on-digital-architecture-in-ten-books-
volume-1-on-digital-architecture-in-ten-books-vol-1-books-i-iii-
ludger-hovestadt-editor/
In Praise of Digital Design
and Computer Architecture
ARM® Edition

Harris and Harris have done a remarkable and commendable job in


creating a true textbook which clearly shows their love and passion for
teaching and educating. The students who read this book will be thankful
to Harris and Harris for many years after graduation. The writing style,
the clearness, the detailed diagrams, the flow of information, the gradual
increase in the complexity of the subjects, the great examples throughout
the chapters, the exercises at the end of the chapters, the concise yet clear
explanations, the useful real-world examples, the coverage of all aspects
of each topic—all of these things are done very well. If you are a student
using this book for your course get ready to have fun, be impressed, and
learn a great deal as well!
Mehdi Hatamian, Sr. Vice President, Broadcom

Harris and Harris have done an excellent job creating this ARM version
of their popular book, Digital Design and Computer Architecture. Retar-
geting to ARM is a challenging task, but the authors have done it success-
fully while maintaining their clear and thorough presentation style, as
well as their outstanding documentation quality. I believe this new edition
will be very much welcomed by both students and professionals.
Donald Hung, San Jose State University

Of all the textbooks I’ve reviewed and assigned in my 10 years as a pro-


fessor, Digital Design and Computer Architecture is one of only two that
is unquestionably worth buying. (The other is Computer Organization
and Design.) The writing is clear and concise; the diagrams are easy to
understand; and the CPU the authors use as a running example is com-
plex enough to be realistic, yet simple enough to be thoroughly under-
stood by my students.
Zachary Kurmas, Grand Valley State University
Digital Design and Computer Architecture brings a fresh perspective to
an old discipline. Many textbooks tend to resemble overgrown shrubs,
but Harris and Harris have managed to prune away the deadwood while
preserving the fundamentals and presenting them in a contemporary con-
text. In doing so, they offer a text that will benefit students interested in
designing solutions for tomorrow’s challenges.
Jim Frenzel, University of Idaho

Harris and Harris have a pleasant and informative writing style. Their
treatment of the material is at a good level for introducing students to com-
puter engineering with plenty of helpful diagrams. Combinational circuits,
microarchitecture, and memory systems are handled particularly well.
James Pinter-Lucke, Claremont McKenna College

Harris and Harris have written a book that is very clear and easy to
understand. The exercises are well-designed and the real-world examples
are a nice touch. The lengthy and confusing explanations often found in
similar textbooks are not seen here. It’s obvious that the authors have
devoted a great deal of time and effort to create an accessible text.
I strongly recommend Digital Design and Computer Architecture.
Peiyi Zhao, Chapman University
Digital Design and
Computer Architecture
ARM® Edition
This page intentionally left blank
Digital Design and
Computer Architecture
ARM® Edition

Sarah L. Harris
David Money Harris

AMSTERDAM • BOSTON • HEIDELBERG • LONDON


NEW YORK • OXFORD • PARIS • SAN DIEGO
SAN FRANCISCO • SINGAPORE • SYDNEY • TOKYO

Morgan Kaufmann is an imprint of Elsevier


Acquiring Editor: Steve Merken
Development Editor: Nate McFadden
Project Manager: Punithavathy Govindaradjane
Designer: Vicky Pearson

Morgan Kaufmann is an imprint of Elsevier


225 Wyman Street, Waltham, MA 02451, USA

Copyright © 2016 Elsevier Inc. All rights reserved.

No part of this publication may be reproduced or transmitted in any form or by any


means, electronic or mechanical, including photocopying, recording, or any information storage
and retrieval system, without permission in writing from the publisher. Details on how to seek
permission, further information about the Publisher’s permissions policies and our arrangements
with organizations such as the Copyright Clearance Center and the Copyright Licensing Agency,
can be found at our website: www.elsevier.com/permissions.

This book and the individual contributions contained in it are protected under copyright by the
Publisher (other than as may be noted herein).

Notices
Knowledge and best practice in this field are constantly changing. As new research and experience
broaden our understanding, changes in research methods, professional practices, or medical
treatment may become necessary.

Practitioners and researchers must always rely on their own experience and knowledge in
evaluating and using any information, methods, compounds, or experiments described herein. In
using such information or methods they should be mindful of their own safety and the safety of
others, including parties for whom they have a professional responsibility.

To the fullest extent of the law, neither the Publisher nor the authors, contributors, or editors,
assume any liability for any injury and/or damage to persons or property as a matter of products
liability, negligence or otherwise, or from any use or operation of any methods, products,
instructions, or ideas contained in the material herein.

All material relating to ARM® technology has been reproduced with permission
from ARM Limited, and should only be used for education purposes. All ARM -based models
shown or referred to in the text must not be used, reproduced or distributed
for commercial purposes, and in no event shall purchasing this textbook be construed as granting
you or any third party, expressly or by implication, estoppel or otherwise,
a license to use any other ARM technology or know how. Materials provided by
ARM are copyright © ARM Limited (or its affiliates).

ISBN: 978-0-12-800056-4

British Library Cataloguing-in-Publication Data


A catalogue record for this book is available from the British Library

Library of Congress Cataloging-in-Publication Data


A catalog record for this book is available from the Library of Congress

For Information on all Morgan Kaufmann publications,


visit our website at www.mkp.com

Printed and bound in the United States of America


To our families
This page intentionally left blank
Contents

Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix
Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xx
Online Supplements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxi
How to Use the Software Tools in a Course . . . . . . . . . . . . . . . . . . xxii
Labs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxii
Bugs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiii
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiv

Chapter 1 From Zero to One . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3


1.1 The Game Plan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 The Art of Managing Complexity . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.2.1 Abstraction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.2.2 Discipline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.2.3 The Three-Y’s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.3 The Digital Abstraction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.4 Number Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.4.1 Decimal Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.4.2 Binary Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.4.3 Hexadecimal Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.4.4 Bytes, Nibbles, and All That Jazz . . . . . . . . . . . . . . . . . . . 13
1.4.5 Binary Addition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1.4.6 Signed Binary Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
1.5 Logic Gates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
1.5.1 NOT Gate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
1.5.2 Buffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
1.5.3 AND Gate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
1.5.4 OR Gate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
1.5.5 Other Two-Input Gates . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
1.5.6 Multiple-Input Gates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
1.6 Beneath the Digital Abstraction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
1.6.1 Supply Voltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
1.6.2 Logic Levels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
1.6.3 Noise Margins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
1.6.4 DC Transfer Characteristics . . . . . . . . . . . . . . . . . . . . . . . . 24
1.6.5 The Static Discipline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

ix
x CONTENTS

1.7 CMOS Transistors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26


1.7.1 Semiconductors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
1.7.2 Diodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
1.7.3 Capacitors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
1.7.4 nMOS and pMOS Transistors . . . . . . . . . . . . . . . . . . . . . . 28
1.7.5 CMOS NOT Gate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
1.7.6 Other CMOS Logic Gates . . . . . . . . . . . . . . . . . . . . . . . . . 31
1.7.7 Transmission Gates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
1.7.8 Pseudo-nMOS Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
1.8 Power Consumption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
1.9 Summary and a Look Ahead . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Interview Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52

Chapter 2 Combinational Logic Design . . . . . . . . . . . . . . . . . . . . . . . . 55


2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
2.2 Boolean Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
2.2.1 Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
2.2.2 Sum-of-Products Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
2.2.3 Product-of-Sums Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
2.3 Boolean Algebra . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
2.3.1 Axioms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
2.3.2 Theorems of One Variable . . . . . . . . . . . . . . . . . . . . . . . . . 61
2.3.3 Theorems of Several Variables . . . . . . . . . . . . . . . . . . . . . . 62
2.3.4 The Truth Behind It All . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
2.3.5 Simplifying Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
2.4 From Logic to Gates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
2.5 Multilevel Combinational Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
2.5.1 Hardware Reduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
2.5.2 Bubble Pushing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
2.6 X’s and Z’s, Oh My . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
2.6.1 Illegal Value: X . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
2.6.2 Floating Value: Z . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
2.7 Karnaugh Maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
2.7.1 Circular Thinking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
2.7.2 Logic Minimization with K-Maps . . . . . . . . . . . . . . . . . . . 77
2.7.3 Don't Cares . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
2.7.4 The Big Picture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
2.8 Combinational Building Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
2.8.1 Multiplexers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
2.8.2 Decoders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
2.9 Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
2.9.1 Propagation and Contamination Delay . . . . . . . . . . . . . . 88
2.9.2 Glitches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
CONTENTS xi

2.10 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
Interview Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106

Chapter 3 Sequential Logic Design . . . . . . . . . . . . . . . . . . . . . . . . . . 109


3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
3.2 Latches and Flip-Flops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
3.2.1 SR Latch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
3.2.2 D Latch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
3.2.3 D FIip-Flop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
3.2.4 Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
3.2.5 Enabled Flip-Flop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
3.2.6 Resettable Flip-Flop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
3.2.7 Transistor-Level Latch and Flip-Flop Designs . . . . . . 116
3.2.8 Putting It All Together . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
3.3 Synchronous Logic Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
3.3.1 Some Problematic Circuits . . . . . . . . . . . . . . . . . . . . . . . . 119
3.3.2 Synchronous Sequential Circuits . . . . . . . . . . . . . . . . . . 120
3.3.3 Synchronous and Asynchronous Circuits . . . . . . . . . . . 122
3.4 Finite State Machines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
3.4.1 FSM Design Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
3.4.2 State Encodings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
3.4.3 Moore and Mealy Machines . . . . . . . . . . . . . . . . . . . . . . 132
3.4.4 Factoring State Machines . . . . . . . . . . . . . . . . . . . . . . . . . 134
3.4.5 Deriving an FSM from a Schematic . . . . . . . . . . . . . . . 137
3.4.6 FSM Review . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
3.5 Timing of Sequential Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
3.5.1 The Dynamic Discipline . . . . . . . . . . . . . . . . . . . . . . . . . . 142
3.5.2 System Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
3.5.3 Clock Skew . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
3.5.4 Metastability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
3.5.5 Synchronizers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
3.5.6 Derivation of Resolution Time . . . . . . . . . . . . . . . . . . . . 154
3.6 Parallelism . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
3.7 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
Interview Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171

Chapter 4 Hardware Description Languages . . . . . . . . . . . . . . . . . . 173


4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
4.1.1 Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
4.1.2 Language Origins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
4.1.3 Simulation and Synthesis . . . . . . . . . . . . . . . . . . . . . . . . . 175
xii CONTENTS

4.2 Combinational Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177


4.2.1 Bitwise Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
4.2.2 Comments and White Space . . . . . . . . . . . . . . . . . . . . . . 180
4.2.3 Reduction Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
4.2.4 Conditional Assignment . . . . . . . . . . . . . . . . . . . . . . . . . . 181
4.2.5 Internal Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
4.2.6 Precedence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
4.2.7 Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
4.2.8 Z’s and X’s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
4.2.9 Bit Swizzling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
4.2.10 Delays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
4.3 Structural Modeling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
4.4 Sequential Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
4.4.1 Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
4.4.2 Resettable Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
4.4.3 Enabled Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
4.4.4 Multiple Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
4.4.5 Latches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
4.5 More Combinational Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
4.5.1 Case Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
4.5.2 If Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
4.5.3 Truth Tables with Don’t Cares . . . . . . . . . . . . . . . . . . . 205
4.5.4 Blocking and Nonblocking Assignments . . . . . . . . . . . 205
4.6 Finite State Machines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
4.7 Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
4.7.1 SystemVerilog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
4.7.2 VHDL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
4.8 Parameterized Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
4.9 Testbenches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
4.10 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
Interview Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237

Chapter 5 Digital Building Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239


5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
5.2 Arithmetic Circuits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
5.2.1 Addition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
5.2.2 Subtraction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
5.2.3 Comparators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
5.2.4 ALU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
5.2.5 Shifters and Rotators . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
5.2.6 Multiplication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
CONTENTS xiii

5.2.7 Division . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254


5.2.8 Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
5.3 Number Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
5.3.1 Fixed-Point Number Systems . . . . . . . . . . . . . . . . . . . . . 255
5.3.2 Floating-Point Number Systems . . . . . . . . . . . . . . . . . . . 256
5.4 Sequential Building Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
5.4.1 Counters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260
5.4.2 Shift Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261
5.5 Memory Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264
5.5.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264
5.5.2 Dynamic Random Access Memory (DRAM) . . . . . . . 266
5.5.3 Static Random Access Memory (SRAM) . . . . . . . . . . . 267
5.5.4 Area and Delay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
5.5.5 Register Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
5.5.6 Read Only Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
5.5.7 Logic Using Memory Arrays . . . . . . . . . . . . . . . . . . . . . . 270
5.5.8 Memory HDL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
5.6 Logic Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
5.6.1 Programmable Logic Array . . . . . . . . . . . . . . . . . . . . . . . 272
5.6.2 Field Programmable Gate Array . . . . . . . . . . . . . . . . . . 274
5.6.3 Array Implementations . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
5.7 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
Interview Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293

Chapter 6 Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295


6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295
6.2 Assembly Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296
6.2.1 Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297
6.2.2 Operands: Registers, Memory, and Constants . . . . . . 298
6.3 Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303
6.3.1 Data-processing Instructions . . . . . . . . . . . . . . . . . . . . . . 303
6.3.2 Condition Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306
6.3.3 Branching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308
6.3.4 Conditional Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . 309
6.3.5 Getting Loopy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312
6.3.6 Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
6.3.7 Function Calls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317
6.4 Machine Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329
6.4.1 Data-processing Instructions . . . . . . . . . . . . . . . . . . . . . . 329
6.4.2 Memory Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333
6.4.3 Branch Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334
6.4.4 Addressing Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336
xiv CONTENTS

6.4.5 Interpreting Machine Language Code . . . . . . . . . . . . . 336


6.4.6 The Power of the Stored Program . . . . . . . . . . . . . . . . . 337
6.5 Lights, Camera, Action: Compiling, Assembling,
and Loading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
6.5.1 The Memory Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
6.5.2 Compilation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340
6.5.3 Assembling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342
6.5.4 Linking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343
6.5.5 Loading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344
6.6 Odds and Ends . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345
6.6.1 Loading Literals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345
6.6.2 NOP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346
6.6.3 Exceptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347
6.7 Evolution of ARM Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . 350
6.7.1 Thumb Instruction Set . . . . . . . . . . . . . . . . . . . . . . . . . . . 351
6.7.2 DSP Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352
6.7.3 Floating-Point Instructions . . . . . . . . . . . . . . . . . . . . . . . 357
6.7.4 Power-Saving and Security Instructions . . . . . . . . . . . . 358
6.7.5 SIMD Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358
6.7.6 64-bit Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 360
6.8 Another Perspective: x86 Architecture . . . . . . . . . . . . . . . . . . . . . 360
6.8.1 x86 Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362
6.8.2 x86 Operands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362
6.8.3 Status Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363
6.8.4 x86 Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364
6.8.5 x86 Instruction Encoding . . . . . . . . . . . . . . . . . . . . . . . . 364
6.8.6 Other x86 Peculiarities . . . . . . . . . . . . . . . . . . . . . . . . . . . 367
6.8.7 The Big Picture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 368
6.9 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 368
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370
Interview Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383

Chapter 7 Microarchitecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385


7.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385
7.1.1 Architectural State and Instruction Set . . . . . . . . . . . . . 385
7.1.2 Design Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386
7.1.3 Microarchitectures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 388
7.2 Performance Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389
7.3 Single-Cycle Processor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390
7.3.1 Single-Cycle Datapath . . . . . . . . . . . . . . . . . . . . . . . . . . . 390
7.3.2 Single-Cycle Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
7.3.3 More Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 402
7.3.4 Performance Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . 402
CONTENTS xv

7.4 Multicycle Processor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406


7.4.1 Multicycle Datapath . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407
7.4.2 Multicycle Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413
7.4.3 Performance Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421
7.5 Pipelined Processor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425
7.5.1 Pipelined Datapath . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 428
7.5.2 Pipelined Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 430
7.5.3 Hazards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431
7.5.4 Performance Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441
7.6 HDL Representation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 443
7.6.1 Single-Cycle Processor . . . . . . . . . . . . . . . . . . . . . . . . . . . 444
7.6.2 Generic Building Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . 449
7.6.3 Testbench . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 452
7.7 Advanced Microarchitecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 456
7.7.1 Deep Pipelines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 457
7.7.2 Micro-Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 458
7.7.3 Branch Prediction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 459
7.7.4 Superscalar Processor . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461
7.7.5 Out-of-Order Processor . . . . . . . . . . . . . . . . . . . . . . . . . . 463
7.7.6 Register Renaming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465
7.7.7 Multithreading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 467
7.7.8 Multiprocessors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 468
7.8 Real-World Perspective: Evolution of ARM
Microarchitecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 470
7.9 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 476
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 478
Interview Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 484

Chapter 8 Memory Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 487


8.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 487
8.2 Memory System Performance Analysis . . . . . . . . . . . . . . . . . . . . . 491
8.3 Caches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 492
8.3.1 What Data is Held in the Cache? . . . . . . . . . . . . . . . . . 493
8.3.2 How is Data Found? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 494
8.3.3 What Data is Replaced? . . . . . . . . . . . . . . . . . . . . . . . . . . 502
8.3.4 Advanced Cache Design . . . . . . . . . . . . . . . . . . . . . . . . . . 503
8.3.5 The Evolution of ARM Caches . . . . . . . . . . . . . . . . . . . 507
8.4 Virtual Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 508
8.4.1 Address Translation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 510
8.4.2 The Page Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 512
8.4.3 The Translation Lookaside Buffer . . . . . . . . . . . . . . . . . 514
8.4.4 Memory Protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 515
8.4.5 Replacement Policies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 516
8.4.6 Multilevel Page Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . 516
xvi CONTENTS

8.5 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 518


Epilogue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 519
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 520
Interview Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 529

Chapter 9 I/O Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531


9.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531

Chapter 9 is available as an online supplement . . . . . . . . . . . . 531.e1


9.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531.e1
9.2 Memory-Mapped I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531.e1
9.3 Embedded I/O Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531.e3
9.3.1 BCM2835 System-on-Chip . . . . . . . . . . . . . . . . . . . . . 531.e4
9.3.2 Device Drivers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531.e6
9.3.3 General-Purpose Digital I/O . . . . . . . . . . . . . . . . . . . . 531.e8
9.3.4 Serial I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531.e11
9.3.5 Timers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531.e23
9.3.6 Analog I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531.e25
9.3.7 Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531.e32
9.4 Other Microcontroller Peripherals . . . . . . . . . . . . . . . . . . . . . 531.e32
9.4.1 Character LCDs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531.e33
9.4.2 VGA Monitor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531.e36
9.4.3 Bluetooth Wireless Communication . . . . . . . . . . . 531.e42
9.4.4 Motor Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531.e43
9.5 Bus Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531.e54
9.5.1 AHB-Lite . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531.e54
9.5.2 Memory and Peripheral Interface Example . . . . . 531.e55
9.6 PC I/O Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531.e57
9.6.1 USB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531.e59
9.6.2 PCI and PCI Express . . . . . . . . . . . . . . . . . . . . . . . . 531.e59
9.6.3 DDR3 Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531.e60
9.6.4 Networking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531.e61
9.6.5 SATA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531.e61
9.6.6 Interfacing to a PC . . . . . . . . . . . . . . . . . . . . . . . . . . 531.e62
9.7 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531.e64

Appendix A Digital System Implementation . . . . . . . . . . . . . . . . . . . 533


A.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 533

Appendix A is available as an online supplement . . . . . . . . . . . 533.e1


A.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 533.e1
CONTENTS xvii

A.2 74xx Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 533.e1


A.2.1 Logic Gates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 533.e2
A.2.2 Other Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 533.e2
A.3 Programmable Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 533.e2
A.3.1 PROMs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 533.e2
A.3.2 PLAs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 533.e6
A.3.3 FPGAs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 533.e7
A.4 Application-Specific Integrated Circuits . . . . . . . . . . . . . . . . . 533.e9
A.5 Data Sheets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 533.e9
A.6 Logic Families . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 533.e15
A.7 Packaging and Assembly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 533.e17
A.8 Transmission Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 533.e20
A.8.1 Matched Termination . . . . . . . . . . . . . . . . . . . . . . . . 533.e22
A.8.2 Open Termination . . . . . . . . . . . . . . . . . . . . . . . . . . . 533.e24
A.8.3 Short Termination . . . . . . . . . . . . . . . . . . . . . . . . . . . 533.e25
A.8.4 Mismatched Termination . . . . . . . . . . . . . . . . . . . . . 533.e25
A.8.5 When to Use Transmission Line Models . . . . . . . 533.e28
A.8.6 Proper Transmission Line Terminations . . . . . . . 533.e28
A.8.7 Derivation of Z0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 533.e30
A.8.8 Derivation of the Reflection Coefficient . . . . . . . . 533.e31
A.8.9 Putting It All Together . . . . . . . . . . . . . . . . . . . . . . . 533.e32
A.9 Economics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 533.e33

Appendix B ARM Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 535


B.1 Data-Processing Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 535
B.1.1 Multiply Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 537
B.2 Memory Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 538
B.3 Branch Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 539
B.4 Miscellaneous Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 539
B.5 Condition Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 540

Appendix C C Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541


C.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541

Appendix C is available as an online supplement . . . . . . . . . . . 541.e1


C.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541.e1
C.2 Welcome to C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541.e3
C.2.1 C Program Dissection . . . . . . . . . . . . . . . . . . . . . . . . . . 541.e3
C.2.2 Running a C Program . . . . . . . . . . . . . . . . . . . . . . . . . 541.e4
C.3 Compilation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541.e5
C.3.1 Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541.e5
C.3.2 #define . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541.e5
C.3.3 #include . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541.e6
xviii CONTENTS

C.4 Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541.e7


C.4.1 Primitive Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . 541.e8
C.4.2 Global and Local Variables . . . . . . . . . . . . . . . . . . . . 541.e9
C.4.3 Initializing Variables . . . . . . . . . . . . . . . . . . . . . . . . . 541.e11
C.5 Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541.e11
C.6 Function Calls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541.e15
C.7 Control-Flow Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541.e16
C.7.1 Conditional Statements . . . . . . . . . . . . . . . . . . . . . . . 541.e17
C.7.2 Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541.e19
C.8 More Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541.e21
C.8.1 Pointers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541.e21
C.8.2 Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541.e23
C.8.3 Characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541.e27
C.8.4 Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541.e28
C.8.5 Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541.e29
C.8.6 typedef . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541.e31
C.8.7 Dynamic Memory Allocation . . . . . . . . . . . . . . . . . 541.e32
C.8.8 Linked Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541.e33
C.9 Standard Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541.e35
C.9.1 stdio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541.e35
C.9.2 stdlib . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541.e40
C.9.3 math . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541.e42
C.9.4 string . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541.e43
C.10 Compiler and Command Line Options . . . . . . . . . . . . . . . . 541.e43
C.10.1 Compiling Multiple C Source Files . . . . . . . . . . . . 541.e43
C.10.2 Compiler Options . . . . . . . . . . . . . . . . . . . . . . . . . . . 541.e43
C.10.3 Command Line Arguments . . . . . . . . . . . . . . . . . . . 541.e44
C.11 Common Mistakes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541.e45

Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 543
Preface

This book is unique in its treatment in that it presents digital logic design
from the perspective of computer architecture, starting at the beginning
with 1’s and 0’s, and leading through the design of a microprocessor.
We believe that building a microprocessor is a special rite of passage for
engineering and computer science students. The inner workings of a proces-
sor seem almost magical to the uninitiated, yet prove to be straightforward
when carefully explained. Digital design in itself is a powerful and exciting
subject. Assembly language programming unveils the inner language spoken
by the processor. Microarchitecture is the link that brings it all together.
The first two editions of this increasingly popular text have covered the
MIPS architecture in the tradition of the widely used architecture books by
Patterson and Hennessy. As one of the original Reduced Instruction Set
Computing architectures, MIPS is clean and exceptionally easy to understand
and build. MIPS remains an important architecture and has been infused
with new energy after Imagination Technologies acquired it in 2013.
Over the past two decades, the ARM architecture has exploded in
popularity because of its efficiency and rich ecosystem. More than 50 bil-
lion ARM processors have been shipped, and more than 75% of humans
on the planet use products with ARM processors. At the time of this writ-
ing, nearly every cell phone and tablet sold contains one or more ARM
processors. Forecasts predict tens of billions more ARM processors soon
controlling the Internet of Things. Many companies are building high-per-
formance ARM systems to challenge Intel in the server market. Because of
the commercial importance and student interest, we have developed this
ARM edition of this book.
Pedagogically, the learning objectives of the MIPS and ARM editions
are identical. The ARM architecture has a number of features including
addressing modes and conditional execution that contribute to its effi-
ciency but add a small amount of complexity. The microarchitectures also
are very similar, with conditional execution and the program counter
being the largest changes. The chapter on I/O provides numerous exam-
ples using the Raspberry Pi, a very popular ARM-based embedded Linux
single board computer.
We expect to offer both MIPS and ARM editions as long as the mar-
ket demands.

xix
Another Random Scribd Document
with Unrelated Content
Dentistry - Summary Sheet
Third 2021 - University

Prepared by: Teacher Garcia


Date: August 12, 2025

Abstract 1: Interdisciplinary approaches


Learning Objective 1: Case studies and real-world applications
• Problem-solving strategies and techniques
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Learning Objective 2: Learning outcomes and objectives
• Fundamental concepts and principles
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Learning Objective 3: Case studies and real-world applications
• Key terms and definitions
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Learning Objective 4: Theoretical framework and methodology
• Case studies and real-world applications
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Formula: [Mathematical expression or equation]
[Figure 4: Diagram/Chart/Graph]
Learning Objective 5: Fundamental concepts and principles
• Key terms and definitions
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
[Figure 5: Diagram/Chart/Graph]
Important: Fundamental concepts and principles
• Case studies and real-world applications
- Sub-point: Additional details and explanations
- Example: Practical application scenario
Formula: [Mathematical expression or equation]
[Figure 6: Diagram/Chart/Graph]
Key Concept: Critical analysis and evaluation
• Interdisciplinary approaches
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Formula: [Mathematical expression or equation]
Practice Problem 7: Learning outcomes and objectives
• Statistical analysis and interpretation
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Formula: [Mathematical expression or equation]
[Figure 8: Diagram/Chart/Graph]
Remember: Experimental procedures and results
• Problem-solving strategies and techniques
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Formula: [Mathematical expression or equation]
Example 9: Literature review and discussion
• Assessment criteria and rubrics
- Sub-point: Additional details and explanations
- Example: Practical application scenario
Module 2: Historical development and evolution
Example 10: Best practices and recommendations
• Research findings and conclusions
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Note: Ethical considerations and implications
• Fundamental concepts and principles
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Example 12: Literature review and discussion
• Current trends and future directions
- Sub-point: Additional details and explanations
- Example: Practical application scenario
Formula: [Mathematical expression or equation]
Important: Theoretical framework and methodology
• Current trends and future directions
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Note: Critical analysis and evaluation
• Literature review and discussion
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Formula: [Mathematical expression or equation]
Definition: Learning outcomes and objectives
• Interdisciplinary approaches
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Key Concept: Ethical considerations and implications
• Learning outcomes and objectives
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Formula: [Mathematical expression or equation]
Practice Problem 17: Best practices and recommendations
• Key terms and definitions
- Sub-point: Additional details and explanations
- Example: Practical application scenario
Formula: [Mathematical expression or equation]
Example 18: Experimental procedures and results
• Critical analysis and evaluation
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Practice Problem 19: Interdisciplinary approaches
• Ethical considerations and implications
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Formula: [Mathematical expression or equation]
Conclusion 3: Ethical considerations and implications
Remember: Learning outcomes and objectives
• Theoretical framework and methodology
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Remember: Experimental procedures and results
• Experimental procedures and results
- Sub-point: Additional details and explanations
- Example: Practical application scenario
Example 22: Case studies and real-world applications
• Comparative analysis and synthesis
- Sub-point: Additional details and explanations
- Example: Practical application scenario
Key Concept: Ethical considerations and implications
• Comparative analysis and synthesis
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Formula: [Mathematical expression or equation]
Key Concept: Theoretical framework and methodology
• Key terms and definitions
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Example 25: Statistical analysis and interpretation
• Experimental procedures and results
- Sub-point: Additional details and explanations
- Example: Practical application scenario
[Figure 26: Diagram/Chart/Graph]
Remember: Critical analysis and evaluation
• Critical analysis and evaluation
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Formula: [Mathematical expression or equation]
Note: Critical analysis and evaluation
• Practical applications and examples
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Remember: Problem-solving strategies and techniques
• Assessment criteria and rubrics
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Formula: [Mathematical expression or equation]
Note: Literature review and discussion
• Ethical considerations and implications
- Sub-point: Additional details and explanations
- Example: Practical application scenario
Appendix 4: Assessment criteria and rubrics
Key Concept: Fundamental concepts and principles
• Assessment criteria and rubrics
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Formula: [Mathematical expression or equation]
Note: Comparative analysis and synthesis
• Best practices and recommendations
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
[Figure 32: Diagram/Chart/Graph]
Example 32: Learning outcomes and objectives
• Critical analysis and evaluation
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Practice Problem 33: Comparative analysis and synthesis
• Ethical considerations and implications
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Important: Statistical analysis and interpretation
• Experimental procedures and results
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
[Figure 35: Diagram/Chart/Graph]
Practice Problem 35: Fundamental concepts and principles
• Practical applications and examples
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Practice Problem 36: Experimental procedures and results
• Case studies and real-world applications
- Sub-point: Additional details and explanations
- Example: Practical application scenario
Formula: [Mathematical expression or equation]
Example 37: Historical development and evolution
• Experimental procedures and results
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Remember: Literature review and discussion
• Practical applications and examples
- Sub-point: Additional details and explanations
- Example: Practical application scenario
[Figure 39: Diagram/Chart/Graph]
Important: Practical applications and examples
• Key terms and definitions
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Formula: [Mathematical expression or equation]
Practice 5: Theoretical framework and methodology
Definition: Ethical considerations and implications
• Current trends and future directions
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Note: Experimental procedures and results
• Learning outcomes and objectives
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Key Concept: Theoretical framework and methodology
• Assessment criteria and rubrics
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Formula: [Mathematical expression or equation]
Note: Historical development and evolution
• Best practices and recommendations
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Remember: Theoretical framework and methodology
• Current trends and future directions
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Formula: [Mathematical expression or equation]
Definition: Research findings and conclusions
• Critical analysis and evaluation
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Practice Problem 46: Case studies and real-world applications
• Interdisciplinary approaches
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Remember: Study tips and learning strategies
• Learning outcomes and objectives
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Formula: [Mathematical expression or equation]
[Figure 48: Diagram/Chart/Graph]
Remember: Learning outcomes and objectives
• Experimental procedures and results
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Key Concept: Theoretical framework and methodology
• Theoretical framework and methodology
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Discussion 6: Comparative analysis and synthesis
Example 50: Key terms and definitions
• Assessment criteria and rubrics
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Example 51: Interdisciplinary approaches
• Fundamental concepts and principles
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Formula: [Mathematical expression or equation]
Example 52: Comparative analysis and synthesis
• Case studies and real-world applications
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Practice Problem 53: Learning outcomes and objectives
• Practical applications and examples
- Sub-point: Additional details and explanations
- Example: Practical application scenario
Key Concept: Study tips and learning strategies
• Interdisciplinary approaches
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Example 55: Current trends and future directions
• Key terms and definitions
- Sub-point: Additional details and explanations
- Example: Practical application scenario
[Figure 56: Diagram/Chart/Graph]
Key Concept: Current trends and future directions
• Ethical considerations and implications
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Important: Current trends and future directions
• Problem-solving strategies and techniques
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Practice Problem 58: Study tips and learning strategies
• Key terms and definitions
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Definition: Case studies and real-world applications
• Theoretical framework and methodology
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Methodology 7: Critical analysis and evaluation
Remember: Literature review and discussion
• Study tips and learning strategies
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Key Concept: Literature review and discussion
• Fundamental concepts and principles
- Sub-point: Additional details and explanations
- Example: Practical application scenario
Important: Fundamental concepts and principles
• Study tips and learning strategies
- Sub-point: Additional details and explanations
- Example: Practical application scenario
Practice Problem 63: Assessment criteria and rubrics
• Assessment criteria and rubrics
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Formula: [Mathematical expression or equation]
Example 64: Experimental procedures and results
• Comparative analysis and synthesis
- Sub-point: Additional details and explanations
- Example: Practical application scenario
Important: Statistical analysis and interpretation
• Historical development and evolution
- Sub-point: Additional details and explanations
- Example: Practical application scenario
Formula: [Mathematical expression or equation]
Remember: Practical applications and examples
• Historical development and evolution
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Practice Problem 67: Problem-solving strategies and techniques
• Practical applications and examples
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
[Figure 68: Diagram/Chart/Graph]
Note: Research findings and conclusions
• Interdisciplinary approaches
- Sub-point: Additional details and explanations
- Example: Practical application scenario
Formula: [Mathematical expression or equation]
[Figure 69: Diagram/Chart/Graph]
Example 69: Learning outcomes and objectives
• Ethical considerations and implications
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Summary 8: Key terms and definitions
Definition: Current trends and future directions
• Practical applications and examples
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Remember: Experimental procedures and results
• Comparative analysis and synthesis
- Sub-point: Additional details and explanations
- Example: Practical application scenario
Formula: [Mathematical expression or equation]
[Figure 72: Diagram/Chart/Graph]
Example 72: Critical analysis and evaluation
• Interdisciplinary approaches
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Formula: [Mathematical expression or equation]
[Figure 73: Diagram/Chart/Graph]
Key Concept: Key terms and definitions
• Fundamental concepts and principles
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Formula: [Mathematical expression or equation]
Example 74: Literature review and discussion
• Study tips and learning strategies
- Sub-point: Additional details and explanations
- Example: Practical application scenario
Key Concept: Key terms and definitions
• Practical applications and examples
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Practice Problem 76: Key terms and definitions
• Research findings and conclusions
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Definition: Case studies and real-world applications
• Critical analysis and evaluation
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Important: Historical development and evolution
• Practical applications and examples
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Definition: Problem-solving strategies and techniques
• Best practices and recommendations
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
[Figure 80: Diagram/Chart/Graph]
Test 9: Case studies and real-world applications
Important: Study tips and learning strategies
• Study tips and learning strategies
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Example 81: Case studies and real-world applications
• Literature review and discussion
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Note: Statistical analysis and interpretation
• Assessment criteria and rubrics
- Sub-point: Additional details and explanations
- Example: Practical application scenario
Definition: Experimental procedures and results
• Research findings and conclusions
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Formula: [Mathematical expression or equation]
[Figure 84: Diagram/Chart/Graph]
Note: Study tips and learning strategies
• Literature review and discussion
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
[Figure 85: Diagram/Chart/Graph]
Practice Problem 85: Problem-solving strategies and techniques
• Current trends and future directions
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Key Concept: Current trends and future directions
• Literature review and discussion
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Formula: [Mathematical expression or equation]
Key Concept: Historical development and evolution
• Statistical analysis and interpretation
- Sub-point: Additional details and explanations
- Example: Practical application scenario
- Note: Important consideration
Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.

More than just a book-buying platform, we strive to be a bridge


connecting you with timeless cultural and intellectual values. With an
elegant, user-friendly interface and a smart search system, you can
quickly find the books that best suit your interests. Additionally,
our special promotions and home delivery services help you save time
and fully enjoy the joy of reading.

Join us on a journey of knowledge exploration, passion nurturing, and


personal growth every day!

ebookmasss.com

You might also like