122,99 €
Updated to reflect the latest advances in the field, the Sixth Edition of Fundamentals of Digital Logic and Microcontrollers further enhances its reputation as the most accessible introduction to the basic principles and tools required in the design of digital systems.
Sie lesen das E-Book in den Legimi-Apps auf:
Seitenzahl: 711
Veröffentlichungsjahr: 2014
Cover
Title Page
Copyright
Dedication
Preface
Chapter 1: Introduction to Digital Systems
1.1 Explanation of Terms
1.2 Design Levels
1.3 Combinational and Sequential Circuits
1.4 Digital Integrated Circuits
1.6 CAD (Computer-Aided Design)
1.7 Evolution of the Microcontroller
1.8 Typical Microcontroller Applications
Chapter 2: Number Systems and Codes
2.1 Number Systems
2.6 Error Correction and Detection
Questions and Problems
Chapter 3: Boolean Algebra and Digital Logic Gates
3.1 Basic Logic Operations
3.2 Other Logic Operations
3.3 IEEE Symbols for Logic Gates
3.4 Positive and Negative Logic
3.5 Boolean Algebra
3.6 Standard Representations
3.7 Karnaugh Maps
3.8 Quine–McCluskey Method
3.9 Implementation of Digital Circuits with NAND, NOR, and Exclusive- OR/Exclusive-NOR Gates
Questions and Problems
Chapter 4: Combinational Logic
4.1 Basic Concepts
4.2 Analysis of a Combinational Logic Circuit
4.3 Design of a Combinational Circuit
4.4 Multiple-Output Combinational Circuits
4.5 Typical Combinational Circuits
4.6 IEEE Standard Symbols
4.7 Read-Only Memories (ROMs)
4.8 Programmable Logic Devices (PLDs)
4.9 Commercially Available Field Programmable Devices (FPDs)
4.10 Hardware Description Language (HDL)
4.11 Verilog basics
4.12 Verilog modeling examples for combinational circuits
Questions and Problems
Chapter 5: Sequential Logic
5.1 Basic Concepts
5.2 Latches and Flip-Flops
5.3 Flip-flop timing parameters for edge-triggered flip-flops
5.4 Preset and Clear Inputs
5.5 Summary of the gated SR latch and the Flip-Flops
5.6 Analysis of Synchronous Sequential Circuits
5.9 Design of Synchronous Sequential Circuits
5.10 Design of Counters
5.11 Examples of Synchronous Sequential Circuits
5.13 Asynchronous Sequential Circuits
5.14 Verilog description of typical synchronous sequential circuits
Questions and Problems
Chapter 6: CPU, Memory, and I/O
6.1 Design of the CPU
6.2 Memory Organization
6.3 Input/Output (I/O)
6.4 CPU design using Verilog
Questions and Problems
Chapter 7: Microcontroller Basics
7.1 Basic Blocks of a Microcontroller
7.2 Microcontroller Architectures
7.3 Basic Concept of Pipelining
7.4 RISC vs. CISC
7.5 Functional Representation of a Typical RISC Microcontroller—The PIC18F4321
7.6 Basics of Programming Languages
7.7 Choosing a Programming Language
7.8 Introduction to C Language
Questions and Problems
Chapter 8: PIC18F Hardware and Interfacing Using C: Part 1
8.1 PIC18F Pins and Signals
8.2 PIC18F4321 programmed I/O using C
8.3 PIC18F Interrupts
Questions and Problems
Chapter 9: PIC18F Hardware and Interfacing Using C: Part 2
9.1 PIC18F Timers
9.2 PIC18F Interface to an LCD (Liquid Crystal Display)
9.3 Analog Interface
9.4 Serial Interface
9.5 PIC18F4321 Capture/Compare/PWM (CCP) Modules
9.6 DC Motor Control
Questions and Problems
Appendix A: Answers to Selected Problems
Appendix B: Glossary
Appendix C: Tutorial for Compiling and Debugging A C-Program Using the MPLAB
Appendix D: Interfacing The PIC18F4321 to a Personal Computer or a Laptop Using PICkit™ 3
D.1 Initial Hardware Setup for the PIC18F4321
D.2 Connecting the Personal Computer (PC) or the Laptop to the PIC18F4321 via PICkit3
D.3 Programming the PIC18F4321 from a Personal Computer OR a Laptop Using the PICkit3
Bibliography
Credits
Index
End User License Agreement
xiii
xiv
xv
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
136
135
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
347
348
346
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
Cover
Table of Contents
Preface
Chapter 1: Introduction to Digital Systems
Figure 1.1
Figure 1.2
Figure 1.3
Figure 1.4
Figure 1.5
Figure 1.6
Figure 1.7
Figure 1.8
Figure 1.9
Figure 1.10
Figure 1.11
Figure 1.12
Figure 1.13
Figure 1.14
Figure 1.15
Figure 1.16
Figure 1.17
Figure 1.18
Figure 1.19
Figure 2.1
Figure 2.2
Figure 2.3
Figure 3.1
Figure 3.2
Figure 3.3
Figure 3.4
Figure 3.5
Figure 3.6
Figure 3.7
Figure 3.8
Figure 3.9
Figure 3.10
Figure 3.11
Figure 3.12
Figure 3.13
Figure 3.14
Figure 3.15
Figure 3.16
Figure 3.17
Figure 3.18
Figure 3.19
Figure 3.20
Figure 3.21
Figure 3.22
Figure 3.23
Figure 3.24
Figure 3.25
Figure 3.26
Figure 3.27
Figure 3.28
Figure 3.29
Figure 3.30
Figure 3.31
Figure 3.32
Figure 3.33
Figure 3.34
Figure 3.35
Figure 3.36
Figure 3.37
Figure 3.48
Figure 3.39
Figure 3.40
Figure 3.41
Figure 3.42
Figure 3.43
Figure 3.44
Figure 3.45
Figure 3.46
Figure 3.51
Figure 3.48
Figure 3.49
Figure 3.49
Figure 3.51
Figure 3.52
Figure 3.53
Figure 3.54
Figure 3.55
Figure 3.56
Figure 3.57
Figure 3.58(a)
Figure 3.58(b)
Figure 3.58(c)
Figure 3.59
Figure 3.60
Figure 4.1
Figure 4.2
Figure 4.3
Figure 4.4
Figure 4.5
Figure 4.6
Figure 4.7
Figure 4.8
Figure 4.9
Figure 4.10
Figure 4.11
Figure 4.12
Figure 4.13
Figure 4.14
Figure 4.15
Figure 4.16
Figure 4.17
Figure 4.18
Figure 4.19
Figure 4.20
Figure 4.23
Figure 4.21
Figure 4.22
Figure 4.24
Figure 4.25
Figure 4.26
Figure 4.27
Figure 4.28
Figure 4.29
Figure 4.30
Figure 4.31
Figure 4.32
Figure 4.33
Figure 4.34
Figure 4.35
Figure 4.36
Figure 4.37
Figure 4.38
Figure 4.39
Figure 4.40
Figure 4.41
Figure 4.42
Figure 4.43
Figure 4.44
Figure 4.45
Figure 4.46
Figure 4.47
Figure 4.48
Figure 4.49
Figure 4.50
Figure 4.51
Figure 4.52
Figure 4.53
Figure 4.54
Figure 4.55
Figure 4.56
Figure 4.57
Figure 4.58
Figure 4.59
Figure 4.60
Figure 4.61
Figure 4.62
Figure P4.16
Figure 5.1
Figure 5.2
Figure 5.3
Figure 5.4
Figure 5.5
Figure 5.6
Figure 5.7
Figure 5.8
Figure 5.9
Figure 5.10
Figure 5.11
Figure 5.12
Figure 5.13
Figure 5.16
Figure 5.17
Figure 5.19
Figure 5.20
Figure 5.21
Figure 5.22
Figure 5.23
Figure 5.24
Figure 5.25
Figure 5.15
Figure 5.26
Figure 5.27
Figure 5.28
Figure 5.29
Figure 5.30
Figure 5.31
Figure 5.32
Figure 5.32
Figure 5.34
Figure 5.35
Figure 5.36
Figure 5.37
Figure 5.38
Figure 5.39
Figure 5.40
Figure 5.41
Figure 5.42
Figure 5.43
Figure 5.44
Figure 5.45
Figure 5.46
Figure 5.47
Figure 5.48
Figure 5.49
Figure 5.50
Figure 5.51
Figure 5.52
Figure 5.53
Figure 5.54
Figure 5.55
Figure 5.56
Figure 5.57
Figure 5.58
Figure 5.59
Figure 5.60
Figure 5.61
Figure 5.62
Figure 5.63
Figure 5.64
Figure 5.65
Figure 5.66
Figure 5.67
Figure 5.68
Figure 5.69
Figure 5.70
Figure 5.71
Figure 5.72
Figure P5.5
Figure P5.7
Figure P5.8
Figure P5.9
Figure P5.10
Figure P5.15
Figure P5.17
Figure P5.18
Figure P5.19
Figure P5.22
Figure P5.25
Figure P5.27
Figure P5.28
Figure P5.33
Figure P5.34
Figure 6.1
Figure 6.2
Figure 6.3
Figure 6.4
Figure 6.5
Figure 6.6
Figure 6.7
Figure 6.8
Figure 6.9
Figure 6.10
Figure 6.11
Figure 6.12
Figure 6.13
Figure 6.14
Figure 6.15
Figure 6.16
Figure 6.17
Figure 6.18
Figure 6.19
Figure 6.20
Figure 6.21
Figure 6.22
Figure 6.23
Figure 6.24
Figure 6.25
Figure 6.26
Figure 6.27
Figure 6.28
Figure 6.29
Figure 6.30
Figure 6.31
Figure 6.32
Figure 6.33
Figure 6.34
Figure 6.35
Figure 6.36
Figure 6.37
Figure 6.38
Figure 6.39
Figure 6.40
Figure 6.41
Figure 6.42
Figure 6.43
Figure 6.44
Figure 6.45
Figure 6.46
Figure 6.47
Figure 6.48
Figure 6.49
Figure 6.50
Figure 6.51
Figure 6.52
Figure 6.53
Figure 6.54
Figure 6.55
Figure 6.56
Figure 6.57
Figure 6.58
Figure 6.59
Figure 6.60
Figure 6.61
Figure 6.62
Figure 6.63
Figure 6.64
Figure P6.13
Figure P6.22
Figure P6.32
Figure P6.33
Figure 7.1
Figure 7.2
Figure 7.3
Figure 7.4
Figure 7.5
Figure 7.6
Figure 7.7
Figure 7.8
Figure 7.9
Figure 7.10
Figure 7.11
Figure 7.12
Figure 7.13
Figure 7.14
Figure 7.15
Figure 7.16
Figure 7.17
Figure 8.1
Figure 8.2
Figure 8.3
Figure 8.4
Figure 8.5
Figure 8.6
Figure 8.7
Figure 8.8
Figure 8.9
Figure 8.10
Figure 8.11
Figure 8.12
Figure 8.13
Figure 8.14
Figure 8.15
Figure 8.16
Figure 8.17
Figure 8.18
Figure P8.6
Figure P8.7
Figure P8.9
Figure P8.11
Figure 9.1
Figure 9.2
Figure 9.3
Figure 9.4
Figure 9.5
Figure 9.6
Figure 9.7
Figure 9.8
Figure 9.9
Figure 9.10
Figure 9.11
Figure 9.12
Figure 9.13
Figure 9.14
Figure 9.15
Figure 9.16
Figure 9.17
Figure 9.18
Figure 9.19
Figure 9.20
Figure 9.21
Figure 9.22
Figure 9.23
Figure 9.24
Figure 9.25
Figure 9.26
Figure 9.27
Figure P9.14
Figure D.1
Figure D.2
Figure D.3
Figure D.4
Figure D.5.
Table 1.1
Table 1.2.
Table 1.3
Table 1.4
Table 2.1
Table 2.2
Table 2.3
Table 2.4
Table 2.5
Table 2.6
Table 2.7
Table 2.8
Table 3.1
Table 3.2
Table 3.3
Table 3.4
Table 4.1
Table 4.2
Table 4.3
Table 4.4
Table 4.5
Table 4.6(a)
Table 4.6
Table 4.7
Table 4.8
Table 4.9
Table 4.10
Table 4.11
Table 4.12
Table 4.13
Table 4.14
Table 4.15
Table 4.16
Table 4.17
Table 4.18
Table 4.19
Table 5.1
Table 5.2
Table 5.3
Table 5.4
Table 5.5
Table 5.6
Table 5.7
Table 5.8
Table 5.9
Table 5.9(b)
Table 5.10
Table 5.11
Table 5.12
Table 5.13
Table 5.14
Table 5.15
Table 5.16
Table 6.1
Table 6.2
Table 6.3
Table 6.4
Table 6.5
Table 6.6
Table 6.7
Table 6.8
Table 6.9
Table P6.34
Table P6.35
Table 7.1
Table 8.1
Table 8.2
Table 8.3
Table 9.1
Table 9.2
Sixth Edition
M. Rafiquzzaman, Ph.D.
Professor
California State Polytechnic University, Pomona
and
President
Rafi Systems, Inc.
Copyright © 2014 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, (978) 750-8400, fax (978) 646-8600, or on the web at www.copyright.com. Requests to the Publisher 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, or online at http://www.wiley.com/go/permissions.
Limit of Liability/Disclaimer of Warranty: While the publisher and author have used their best efforts in preparing this book, they make no representation 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 or for technical support, please contact our Customer Care Department within the United States at (800) 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 may not be available in electronic formats. For more information about Wiley products, visit our web site at www.wiley.com
Library of Congress Cataloging-in-Publication Data:
Rafiquzzaman, Mohamed.
[Fundamentals of digital logic and microcomputer design]
Fundamentals of digital logic and microcontrollers / M. Rafiquzzaman. – Sixth edition.
pages cm
Revised edition of: Fundamentals of digital logic and microcomputer design.
Includes index.
ISBN 978-1-118-85579-9 (cloth)
1. Logic circuits. 2. Microcomputers–Design and construction. 3. Electronic digital computers-Circuits. I. Title.
TK7888.4.R34 2014
621.39'5–dc23
2014017642
To my wife, Kusum; son, Tito; daughter-in-law,
Trina; and my grand children
The fifth edition of the book covered basics of computer engineering and science from digital logic to the design of a complete microcomputer system using Intel 8086 and Motorola 68000. With the growing popularity of microcontrollers, it is now necessary to have a clear understanding of the basic principles of microcontrollers at the undergraduate level. Microcontrollers play an important role in the design of digital systems. They are found in a wide range of applications including office automation systems such as copiers and fax machines, consumer electronics such as microwave ovens, digital instruments, and robotics.
Hence, a typical microcontroller such as Microchip Technology's PIC18F is used to replace the 8086 and 68000 in this edition. Several PIC18F-based simple practical applications using C-language are provided. The sixth edition covers an enhanced version of both combinational and sequential logic design, basics of computer organization and microcontrollers.
Like the fifth edition, emphasis is given on the basic concepts. To cite an example, we clearly point out that computers understand only 0's and 1's. It is, therefore, important that students be familiar with binary numbers. Furthermore, we focus on the fact that computers can normally only add. Hence, all other arithmetic operations such as subtraction are performed via addition. This can be accomplished using two's-complement arithmetic for binary numbers. This topic is, therefore, also included along with a clear explanation of signed and unsigned binary numbers. Basic concepts such as this are illustrated with simple examples throughout this edition.
As in the previous edition, three design levels are covered in this book: device level, logic level, and system level. Device-level design using simple devices such as transistors is included for typical logic gates such as NOT. Logic-level design is the technique in which logic gates are used; design of digital components such as an adder is provided. Finally, system-level applications are covered using a typical microcontroller such as the PIC18F.
Digital systems at the logic level are classified into two types of circuits: combinational and sequential. Combinational circuits have no memory whereas sequential circuits contain memory. Microcontrollers are designed using both combinational and sequential circuits. Therefore, these topics are covered in detail.
This edition of the book contains more details for synthesizing digital logic circuits using a popular hardware description language such as Verilog. An overview of contemporary digital circuit implementation using a popular programmable logic device (PLD) such as field programmable gate array (FPGA) along with the CAD (computer aided design) tools is included.
Several chapters in the previous edition containing digital logic design have been retained and even strengthened in this edition. A few chapters of this new edition are written to present the fundamental concepts of C language programming and interfacing techniques associated with Microchip Technology's PIC18F4321 microcontroller. The PIC18F family continues to be popular. The PIC18F family is an excellent educational tool for acquiring an understanding of both hardware and software aspects of typical microcontrollers.
Several PIC18F-based simple practical applications using C-language are provided. Most of the examples are implemented successfully in the laboratory. In summary, the sixth edition covers an enhanced version of both combinational and sequential logic, basics of computer organization, and microcontrollers.
The following major changes have been provided in this edition:
Revised Chapters 1 through 5 of the fifth edition to update and strengthen certain topics on both combinational and sequential circuits. Several new examples are included. In addition, certain topics such as timing diagrams, hazards, stability, and Verilog and FPGA are enhanced.
Chapter 6 of this edition contains design of the CPU, memory, and I/O. Design of both hardwired and microprogrammed CPU is included.
Chapters 7 through 9 of this edition include microcontroller basics and PIC18F-based applications using C.
In this edition, the book is divided into nine chapters as follow:
Chapter 1 presents an explanation of basic terminologies, fundamental concepts of digital integrated circuits using transistors; a comparison of LSTTL, HC, and HCT IC characteristics, evolution of the microcontroller, and technological forecasts.
Chapter 2 includes various number systems and codes suitable for representing information in typical digital systems.
Chapter 3 covers Boolean algebra along with k-map simplification of Boolean functions. Several examples are included. The basic characteristics of digital logic gates are also presented.
Chapter 4 presents the analysis and design of combinational circuits. Typical combinational circuits such as adder, decoder, encoder, multiplexer, demultiplexer, and ROMs are included. An introduction to PLDs and FPGA is provided. Synthesis of combinational logic design using Verilog is also included.
Chapter 5 covers various types of flip-flops. Analysis and design of sequential circuits such as counters and registers are covered. An overview of topics such as flip-flop set-up time, hold time, and metastability is provided. Finally, synthesis of sequential logic design using Verilog is included.
Chapter 6 introduces basic concepts associated with CPU, memory, and I/O. It also covers the design of CPU including registers, ALU, and the control unit.
Chapter 7 presents basics of microcontroller including organization, memory, I/O, and C programming concepts.
Chapter 8 provides typical C programs which include I/O examples with LEDs and switches. PIC18F-based programmed and interrupt I/O using C are covered in a simplified manner.
Chapter 9 contains simple PIC18F-based applications using C. These include A/D and D/A converters, LCD displays, on-chip timers, DC voltmeter, and motor control using PWM (pulse width modulation).
The book can easily be adopted as a text for “digital logic design” and/or “introduction to microcontrollers” at the undergraduate level in electrical/computer engineering and computer science. The book introduces microcontroller hardware and software to form a bridge between digital logic and an advanced follow-up course in microcontrollers. The book provides an introduction to one of today's popular microcontrollers, the PIC18F family. Although no advanced mathematical background is required, a basic course on DC circuits is required. A first course in C language programming is essential. Since C language programming is prerequisite for the course on microcontrollers, I/O and interfacing using C is included in this book. The audience for this book can also be practicing engineers and scientists in the industry. Practitioners of digital system design in the industry will find more simplified explanations, together with examples and comparison considerations, than are found in manufacturers’ manuals.
The author is especially indebted to his colleague, Dr. R. Chandra, of California State Polytechnic University, Pomona for reviewing the manuscript. The author is also grateful to his students Robert Benenyan, Michael Hachache, Cameron Chitsaz, Gagneet Bhatia, Luke Stankiewicz, and others for making constructive suggestions and to CJ Media of California for preparing the final version of the manuscript. Finally, the author is indebted to his deceased parents, who were primarily responsible for his accomplishments.
M. RAFIQUZZAMAN
Pomona, California
