Introduction to Digital Logic with Lab Exercises & Circuit Design by James Feher

Khám phá logic số kỹ thuật số qua tài liệu toàn diện kèm bài tập thực hành chi tiết. Nắm vững thiết kế mạch số và ứng dụng thực tiễn hiệu quả nhất.

Trường đại học

McKendree University

Chuyên ngành

Computer Science

Người đăng

Ẩn danh

Thể loại

Lab Manual

2010

100
1
0

Phí lưu trữ

35 Point

Tóm tắt

I. Tổng quan về Digital Logic và mạch số cơ bản

Digital Logic là nền tảng của khoa học máy tính và kỹ thuật điện tử. Hệ thống này xử lý tín hiệu ở hai trạng thái: logic 0 và logic 1. Các cổng logic cơ bản bao gồm AND, OR, NOT, NAND, NOR, XOR và XNOR. Mỗi cổng thực hiện một phép toán Boolean đơn giản trên đầu vào để tạo ra đầu ra tương ứng. Transistor là thành phần vật lý cơ bản nhất, hoạt động như công tắc điện tử để xây dựng nên các cổng logic. Bộ nghịch (inverter) đảo ngược tín hiệu đầu vào, biến 0 thành 1 và ngược lại. Lịch sử phát triển chip logic bắt đầu từ những năm 1960 với sự ra đời của dòng transistor-transistor logic (TTL) 7400 series. Dòng chip này trở thành tiêu chuẩn công nghiệp trong nhiều thập kỷ. Cuốn sách 'Introduction to Digital Logic with Laboratory Exercises' của James Feher cung cấp hướng dẫn toàn diện từ cổng đơn giản đến máy trạng thái phức tạp. Phương pháp học kết hợp lý thuyết với thực hành phòng thí nghiệm giúp sinh viên nắm vững nguyên lý hoạt động của mạch số.

1.1. Các cổng logic cơ bản và bảng chân trị

Các cổng logic là khối xây dựng cơ bản của mọi mạch số. Cổng AND cho đầu ra 1 chỉ khi tất cả đầu vào đều là 1. Cổng OR cho đầu ra 1 khi ít nhất một đầu vào là 1. Cổng NOT đảo ngược tín hiệu đầu vào. Cổng NAND và NOR là dạng đảo của AND và OR, được gọi là cổng phổ quát vì có thể xây dựng bất kỳ hàm logic nào từ chúng. Bảng chân trị liệt kê tất cả tổ hợp đầu vào có thể và đầu ra tương ứng. Việc hiểu rõ bảng chân trị là bước đầu tiên thiết yếu trong thiết kế mạch số.

1.2. Transistor và vai trò trong mạch logic

Transistor là thành phần bán dẫn nền tảng cấu tạo nên mọi cổng logic hiện đại. Trong kỹ thuật số, transistor hoạt động ở chế độ cắt và bão hòa, tương ứng với trạng thái logic 0 và 1. Bộ nghịch (inverter) đơn giản nhất sử dụng một transistor kết hợp với điện trở kéo. Khi đầu vào ở mức cao, transistor dẫn điện kéo đầu ra xuống mức thấp. Khi đầu vào thấp, transistor cắt khiến đầu ra bị kéo lên mức cao. Nguyên lý này mở rộng để xây dựng các cổng logic phức tạp hơn bằng cách kết hợp nhiều transistor theo cấu hình khác nhau.

II. Các vấn đề trong thiết kế và gỡ lỗi mạch số

Thiết kế mạch số đối mặt với nhiều thách thức phức tạp. Bài toán tối giản hóa hàm Boolean là vấn đề cốt lõi đầu tiên. Hàm logic ban đầu thường chứa nhiều hạng tử dư thừa, dẫn đến mạch sử dụng quá nhiều cổng không cần thiết. Điều này làm tăng chi phí, tiêu thụ điện năng và giảm độ tin cậy. Karnaugh map (K-map) là công cụ trực quan để rút gọn biểu thức Boolean. K-map sắp xếp các ô theo mã Gray sao cho các ô kề nhau chỉ khác một biến. Nhóm các ô có giá trị 1 thành các nhóm có kích thước lũy thừa hai để loại bỏ biến không cần thiết.Điều kiện 'don't care' xuất hiện khi một số tổ hợp đầu vào không bao giờ xảy ra trong thực tế. Ví dụ, bộ đếm chỉ đếm từ 0 đến 5 sẽ không bao giờ gặp trạng thái 6 và 7. Các ô don't care có thể được gán giá trị 0 hoặc 1 tùy theo cách nhóm để đạt biểu thức tối giản nhất. De Morgan's laws cung cấp phép biến đổi giữa các dạng biểu thức: (AB)' = A' + B' và (A + B)' = A'B'. Quy tắc này rất hữu ích khi cần chuyển đổi giữa các loại cổng logic trong quá trình thiết kế.

2.1. Sử dụng Karnaugh Map để tối giản hàm Boolean

Karnaugh Map là phương pháp đồ họa mạnh mẽ để đơn giản hóa biểu thức Boolean. K-map 2 biến có 4 ô, 3 biến có 8 ô, và 4 biến có 16 ô. Các ô được sắp xếp theo mã Gray đảm bảo tính liên tục logic. Nhóm các ô 1 liền kề thành hình chữ nhật có kích thước lũy thừa hai: 1, 2, 4, 8. Mỗi nhóm tương ứng với một tích trong biểu thức SOP tối giản. Nhóm lớn hơn loại bỏ nhiều biến hơn, dẫn đến biểu thức ngắn gọn hơn. Kỹ thuật đặt biến trên K-map đúng cách giúp việc nhóm trở nên dễ dàng và hiệu quả hơn.

2.2. Gỡ lỗi mạch và xây dựng phòng thí nghiệm

Gỡ lỗi là kỹ năng không thể thiếu khi xây dựng mạch số thực tế. Quy trình bao gồm kiểm tra kết nối, xác minh nguồn điện và đo tín hiệu tại từng nút mạch. Sổ tay phòng thí nghiệm là công cụ ghi chép sơ đồ, kết quả đo và các vấn đề gặp phải. Điện trở và tụ điện là linh kiện thụ động thường dùng trong mạch định thời và lọc nhiễu. Việc hiểu chân cắm (pinout) của chip 7400 series giúp kết nối đúng và tránh hư hỏng. Thực hành trong phòng thí nghiệm củng cố kiến thức lý thuyết và xây dựng kỹ năng kỹ thuật thực hành.

III. Giải pháp nâng cao Multiplexer và máy trạng thái

Multiplexer (MUX) là mạch số chọn một trong nhiều đầu vào dựa trên tín hiệu chọn. MUX có thể được sử dụng để triển khai bất kỳ hàm logic nào bằng cách cài đặt giá trị đầu vào phù hợp. Phương pháp này đặc biệt hữu ích khi cần triển khai hàm phức tạp mà không muốn sử dụng nhiều cổng logic rời rạc. Máy trạng thái (state machine) là mô hình tính toán tuần tự sử dụng bộ nhớ để lưu trạng thái hiện tại. Máy trạng thái bao gồm logic tổ hợp tính toán trạng thái kế tiếp và đầu ra dựa trên đầu vào cùng trạng thái hiện tại. Sơ đồ chuyển trạng thái mô tả trực quan các trạng thái và chuyển đổi giữa chúng. Bộ đếm là ứng dụng đơn giản nhất của máy trạng thái, ví dụ bộ đếm 4 trạng thái với đầu vào x sử dụng flip-flop D và logic NAND. Kích thước bộ nhớ cần thiết phụ thuộc vào số bit biểu diễn trạng thái: n bit hỗ trợ tối đa 2^n trạng thái. Các trạng thái không sử dụng cần được xử lý đúng để tránh lỗi không mong muốn trong hoạt động mạch.

3.1. Triển khai hàm logic bằng Multiplexer

Multiplexer cho phép triển khai hàm Boolean phức tạp bằng cách cài đặt trực tiếp giá trị logic trên các đầu vào dữ liệu. Với MUX có n dòng chọn, có thể triển khai hàm tối đa 2^n biến. Phương pháp này giảm số lượng chip cần thiết so với cách dùng cổng logic rời rạc. Ví dụ, một hàm 3 biến có thể triển khai bằng MUX 8-1 với các đầu vào được nối Vcc hoặc GND theo bảng chân trị. Công cụ nền tảng này thường được giới thiệu ngay sau phần học về K-map và tối giản hóa logic.

3.2. Thiết kế máy trạng thái với flip flop

Thiết kế máy trạng thái bắt đầu bằng việc vẽ sơ đồ chuyển trạng thái và lập bảng trạng thái. Bảng trạng thái liệt kê trạng thái hiện tại, đầu vào, trạng thái kế tiếp và đầu ra. Các hàm logic cho đầu vào flip-flop được rút gọn bằng K-map từ bảng trạng thái. Flip-flop D phổ biến nhất trong thiết kế vì đầu vào D chính là giá trị trạng thái kế tiếp. Đường CLEAR trên chip flip-flop phải được nối Vcc để tránh trạng thái không xác định. Các trạng thái không sử dụng nên được kiểm tra để đảm bảo mạch tự phục hồi về trạng thái hợp lệ.

IV. Kết luận và ứng dụng thực tiễn của Digital Logic

Digital Logic là lĩnh vực cốt lõi trong đào tạo kỹ thuật điện tử và khoa học máy tính. Kiến thức về cổng logic, tối giản hóa Boolean, multiplexer và máy trạng thái tạo thành nền tảng vững chắc cho việc hiểu hệ thống số phức tạp hơn. Thực hành phòng thí nghiệm đóng vai trò then chốt trong quá trình học tập. Sinh viên tiếp xúc trực tiếp với chip 7400 series, xây dựng mạch trên breadboard và gỡ lỗi thực tế. Kinh nghiệm thực hành này không thể thay thế bằng lý thuyết thuần túy.Ứng dụng của Digital Logic trải rộng trên nhiều lĩnh vực công nghệ hiện đại. Bộ vi xử lý chứa hàng tỷ transistor tổ chức theo nguyên lý logic số. Hệ thống nhúng, thiết bị IoT, bộ điều khiển công nghiệp đều dựa trên nguyên tắc mạch số. Nền tảng FPGA và thiết kế HDL mở rộng từ các khái niệm cơ bản được học trong môn Digital Logic. Tài liệu học tập mở theo giấy phép Creative Commons như cuốn sách của James Feher giúp tiếp cận kiến thức dễ dàng hơn. Sự kết hợp giữa tài liệu chất lượng và thực hành phòng thí nghiệm tạo nền tảng vững chắc cho kỹ sư số tương lai.

4.1. Vai trò của thực hành phòng thí nghiệm

Thực hành phòng thí nghiệm là phần không thể thiếu trong môn Digital Logic. Sinh viên xây dựng mạch thực tế trên breadboard, sử dụng chip 7400 series và các linh kiện thụ động. Sổ tay phòng thí nghiệm giúp ghi chép hệ thống hóa quá trình thiết kế, xây dựng và gỡ lỗi. Bài tập thực hành từ đơn giản như cổng logic đến phức tạp như máy trạng thái hoàn chỉnh. Kỹ năng đo lường bằng oscilloscope và logic analyzer được rèn luyện qua từng thí nghiệm. Phương pháp học tập này xây dựng tư duy kỹ thuật và khả năng giải quyết vấn đề thực tế hiệu quả.

4.2. Ứng dụng Digital Logic trong công nghệ hiện đại

Nguyên lý Digital Logic hiện diện trong mọi thiết bị điện tử ngày nay. Bộ vi xử lý CPU tích hợp hàng tỷ cổng logic trên một chip bán dẫn. FPGA cho phép lập trình lại cấu hình logic phần cứng, ứng dụng rộng rãi trong prototyping và xử lý thời gian thực. Thiết kế sử dụng ngôn ngữ mô tả phần cứng như VHDL và Verilog bắt nguồn trực tiếp từ khái niệm logic số. Hệ thống nhúng, thiết bị y tế, viễn thông và tự động hóa công nghiệp đều dựa trên nền tảng mạch số. Nắm vững Digital Logic mở ra con đường sự nghiệp rộng lớn trong ngành công nghiệp bán dẫn.

Tóm tắt và mô tả trên trang này được tạo với sự hỗ trợ của AI từ nội dung tài liệu gốc; tài liệu do người dùng đóng góp và được kiểm duyệt trước khi xuất bản. Báo lỗi nội dung.

18/04/2026

Trích đoạn nội dung tài liệu

Introduction to Digital Logic with Laboratory Exercises Introduction to Digital Logic with Laboratory Exercises James Feher Copyright © 2010 James Feher Editor-In-Chief: James Feher Associate Editor: Marisa Drexel Proofreaders: Jackie Sharman, Rachel Pugliese For any questions about this text, please email: drexel@uga.edu The Global Text Project is funded by the Jacobs Foundation, Zurich, Switzerland This book is licensed under a Creative Commons Attribution 3.0 License This book is licensed under a Creative Commons Attribution 3.0 License Table of Contents Preface. The transistor and inverter. 13 History of logic chips.18 De Morgan's laws. 19 Circuit design, construction and debugging.

More logic simplification.26 Additional K-map groupings. 26 Input placement on K-map. 27 Don't care conditions.30 Background on the “mux”. 30 Using a multiplexer to implement logical functions.

Timers and clocks. 35 Timing in digital circuits.46 What is a state machine?. 46 State transition diagrams. 46 State machine design.

More state machines.53 How many bits of memory does a state machine need?. 53 What are unused states?.60 Appendix A: Chip pinouts.61 Appendix B: Resistors and capacitors. 66 Appendix C: Lab notebook. 67 Appendix D: Boolean algebra.68 Appendix E: Equipment list.

69 Style Guidelines 3 A Global Text Appendix F: Solutions. 70 Chapter 1 review exercises. 70 Chapter 2 review exercises. 71 Chapter 3 review exercises.

74 Chapter 4 review exercises. 80 Chapter 5 review exercises. 83 Chapter 6 review exercises. 89 Chapter 7 review exercises.

92 Chapter 8 review exercises. 95 Chapter 9 review exercises. 97 4 This book is licensed under a Creative Commons Attribution 3.0 License About the author and reviewers Author: James Feher Jim currently teaches Computer Science at McKendree University in Lebanon, Illinois, USA. He is a huge open- source software proponent.

His research focuses on the use of open source software in the areas of hardware, programming and networking. His hobbies include triathlon, hiking, camping and the use of alternative energy. He lives with his wife and three kids in St. Louis, Missouri where he built and continues to perfect a solar hot water heating system for his home.

Reviewer: Andrew Van Camp Professor Van Camp is a retired electronics professor. In addition, he has extensive experience working and consulting in industry. He currently resides in central Missouri where he continues his consulting for industry. Reviewer: Kumud Bhandari Kumud graduated from McKendree University with degrees in computer science and mathematics.

He has interned at the University of Texas and the Massachusetts Institute of Technology. He currently is employed as a researcher with Argonne National Laboratory. Style Guidelines 5 A Global Text This book is licensed under a Creative Commons Attribution 3.0 License Preface This lab manual provides an introduction to digital logic, starting with simple gates and building up to state machines. Students should have a solid understanding of algebra as well as a rudimentary understanding of basic electricity including voltage, current, resistance, capacitance, inductance and how they relate to direct current circuits.

Labs will be built utilizing the following hardware: • breadboards with associated items required such as wire, wire strippers and cutters • some basic discrete components such as transistors, resistors and capacitors • basic 7400 series logic chips • 555 timer Discrete components will be included only when necessary, with most of the labs using the standard 7400 series logic chips. These items are commonly available and can be obtained relatively inexpensively. Labs will include learning objectives, relevant theory, review problems, and suggested procedure. In addition to the labs, several appendices of background material are provided.

Format for each chapter Each chapter is a combination of theory followed by review exercises to be completed as traditional homework assignments. Full solutions to all of the review exercises are available in the last appendix. Procedures for labs then follow that allow the student to implement the concepts in a hands on manner. The materials required for the labs were selected due to their ready availability at modest cost.

While students would gain from just reading and completing the review exercises, it is recommended that the procedures be completed as well. In addition to providing another means re-enforcing the material, it helps to develop real world debugging and design skills. This manual concentrates on the basic building blocks of digital electronics: logic gates and memory. It focuses on these items from the ground up.

The reader will first see how logic gates can be constructed from transistors and then how digital logic functions are constructed using those gates. The concept of memory is then introduced through the construction of an SR latch and then a D flip-flop. A clock is created to be used in a basic state machine design that aims to combine logic circuits with memory. Target audience This text will be geared toward computer science students; however it would be appropriate for any students who have the necessary background in algebra and elementary DC electronics.

Computer science students learn skills in analysis, design and debugging. These skills are also used in the virtual world of programming, where no physical devices are ever involved. By requiring the assembly and demonstration of actual circuits, students will not only learn about digital logic, but about the intricacies and difficulties that arise when physically implementing their designs as well. Global Text Project Education is the most powerful weapon you can use to change the world - Nelson Mandela The goal of this text is to allow more students to gain access to this material by publishing it in the Creative Commons as well as specifying inexpensive materials to be used in the labs.

For this reason the author chose to work with the Global Text project to develop this text. The Global Text Project will create open content electronic textbooks that will be freely available from a website. Distribution will also be possible via paper, CD, or DVD. The Style Guidelines 6 A Global Text Preface goal of the Global Text Project initially is to focus on content development and Web distribution, and work with relevant authorities to facilitate dissemination by other means when bandwidth is unavailable or inadequate.

The goal is to make textbooks available to the many who cannot afford them. Acknowledgments A work such as this would not be possible without the help of many. First, I would like to thank the Global Text Project for their vision of providing electronic textbooks for free to everyone. Marisa Drexel, Associate Editor at the Global Text Project provided countless suggestions and helpful hints for the document and for the creation of the document using OpenOffice.

Andrew Van Camp II, retired professor of electronics provided excellent suggestions for technical review of the content. Kumud Bhandari, currently a research aide at Argonne National Laboratory, also provided technical review of the material. My students Evan VanScoyk, Samantha Barnes, and Ben York all provided helpful corrections and review as well as countless diagrams found in the document. I would like to thank all of the countless open-source developers who produced such fine software as GNU/Linux, OpenOffice, Gimp, and Dia which were all used to create this document.

I am grateful to McKendree University for providing support in the form of a sabbatical to allow me to complete this work. And I certainly wish to thank Sandy who provided excellent review suggestions, support and an extremely patient ear when I ran into trouble trying to incorporate a new feature from OpenOffice or attempted to edit a particularly tricky graphic. 7 This book is licensed under a Creative Commons Attribution 3. Introduction It is nearly impossible to find a part of society that has not been touched by digital electronics.

Obvious applications such as computers, televisions, digital video reorders and countless other consumer electronics would not be possible without them. The Internet is run on a system of computers and routing equipment built with digital electronics. Yet even outside of some of these obvious applications we find that our cars and utilitarian home appliances such as microwaves, washers, dryers, coffee makers and even refrigerators are all increasingly being designed with digital electronic controls. You likely carry some sort of device designed with them with you nearly all your waking hours whether it is a watch, cell phone, MP3 player or PDA.

Indeed, digital electronics provide the foundation upon which we build the infrastructure of modern society. You no doubt have heard stories about some of the first computers. Machines built with mechanical relays and vacuum tubes that filled entire rooms. In the 1940s John Bardeen, Walter Brattain and William Shockley developed the first transistor; it allowed computers to be built cheaper, smaller and more reliable than ever before.

The integrated circuit, a single package with several transistors along with other circuit components, was developed in the late 1950s by Jack Kilby at Texas Instruments. This helped to further advance the digital revolution. Advances then became so common that in the 1960s Gordon Moore, co-founder of Intel Corporation, proposed his famous law stating that the capacity of computers we use would double every two years. This observation has held up since then, even being amended to doubling every eighteen months.

The quad core microprocessors of today contain millions of components, but the basic building blocks are digital logic functions combined with memory. Despite the fact that many of these devices are tremendously complex and require vast amounts of engineering in their design, they all share the ubiquitous bit as their fundamental unit of data. In essence it all starts with TRUE and FALSE or 0 and 1. And so the next chapter starts with the simplest of logic devices, the inverter, built with a single transistor.

You then continue your journey into the world of digital electronics by examining the NAND and NOR gates. Remember, the digital revolution would not be possible without these simple devices. Style Guidelines 8 A Global Text This book is licensed under a Creative Commons Attribution 3. The transistor and inverter Learning objectives: • Use the digital trainer and breadboard.

• Build a logic circuit with discrete components. The transistor A transistor is a three-terminal device that can be used as an amplifier or as a switch. When the transistor is used as an amplifier, it is working in analog mode. When it is being used as an electronic switch, it is functioning in digital mode.

The transistor will only be used in digital mode in these labs, which means the transistor will either be on or off. The terms ground, low, zero, zero volts, open switch, and dark lamp are all equivalent to the boolean value false. Likewise five volts, high, one, closed switch, and lit lamp (light-emitting diode, LED), are equivalent to the boolean value true. We will use false (F or 0) and true (T or 1) when speaking of the logical states in this manual.

Modern computers contain millions of transistors combined together in digital mode to create advanced circuits. Transistors are three pin devices that are similar to valves for controlling electricity. The amount of current that can flow between the collector and emitter is a function of the current flowing through the base of the transistor. If no current is flowing through the base of the transistor, no current will flow through the collector and emitter.

With the transistor operating in digital mode, it will be configured to carry the maximum (if on) or minimum (if off) amount of Exhibit 1.1: Common NPN transistors current from the collector to the emitter that the circuit will allow. The transistor used in this lab, the pn2222 or 2n2222, is an NPN, bipolar junction transistor which is sometimes referred to as a BJT. Other types of transistors exist, and while they differ in how they function, they are used in a similar manner in digital circuits. In this lab, a single transistor will be used to create an inverter.

The principles used to build this inverter could be applied to other circuits with other types of transistors.

Nội dung được bảo vệ bản quyền — Tải xuống đầy đủ