1. Trang chủ
  2. » Kỹ Thuật - Công Nghệ

Chapter 9_Digital Arithmetic

14 58 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

1 Lecture: DIGITAL SYSTEMS Chapter 9: Digital Arithmetic: Operations and Circuits Nguyen Thanh Hai, PhD University of Technical Education Faculty of Electrical & Electronic Engineering Digital Arithmetic: Operations and Circuits University of Technical Education Faculty of Electrical & Electronic Engineering 2 Nguyen Thanh Hai, PhD 9.1 Binary Addition 9.2 Addition in the 2’s-Complement System 9.3 Subtraction in the 2’s-Complement System 9.4 BCD Addition 9.5 Adders and Subtractors Digital Arithmetic: Operations and Circuits University of Technical Education Faculty of Electrical & Electronic Engineering 3 Nguyen Thanh Hai, PhD 9.1 Binary Addition 0 1 1 (3) 1 1 0 (6) 1 0 0 1 (9) + 11.011 (3.375) 10.110 (2.750) 110.001 (6.125) + Example 9.1 Example 9.2 Digital Arithmetic: Operations and Circuits University of Technical Education Faculty of Electrical & Electronic Engineering 4 Nguyen Thanh Hai, PhD 9.2 Addition in 2’s-Complement System 1’s-Complement Form 1 0 1 1 0 1 0 1 0 0 1 0 original binary number complement each bit to form 1’s complement Digital Arithmetic: Operations and Circuits University of Technical Education Faculty of Electrical & Electronic Engineering 5 Nguyen Thanh Hai, PhD 9.2 Addition in 2’s-Complement System 2’s-Complement Form binary equivalent of 45 10 complement each bit to form 1’s complement 1 0 1 1 0 1 0 1 0 0 1 0 0 0 0 0 0 1 0 1 0 0 1 1 + add 1 to form 2’s complement 2’s complement (-45 10 ) of original binary number Digital Arithmetic: Operations and Circuits University of Technical Education Faculty of Electrical & Electronic Engineering 6 Nguyen Thanh Hai, PhD 9.2 Addition in 2’s-Complement System Digital Arithmetic: Operations and Circuits University of Technical Education Faculty of Electrical & Electronic Engineering 7 Nguyen Thanh Hai, PhD 9.3 Subtraction in the 2’s-Complement System 01001 (+9 10 ) 11100 (-4 10 ) 1 00101 (+5 10 ) + Disregard, result: 00101 = +5 10 Example 9.3 Digital Arithmetic: Operations and Circuits University of Technical Education Faculty of Electrical & Electronic Engineering 8 Nguyen Thanh Hai, PhD 9.3 Subtraction in the 2’s-Complement System 11100 (-4 10 ) 10111 (-9 10 ) 1 10011 (-13 10 ) + Disregard 11100 (-4 10 ) 01001 (+9 10 ) - Example 9.4 - complement each bit (+9) to form 1’s complement=10110 - add 1 to form 2’s complement and then obtain -9 =10111 - Use 2’s complement for 01001 (+9 10 ) Result: Digital Arithmetic: Operations and Circuits University of Technical Education Faculty of Electrical & Electronic Engineering 9 Nguyen Thanh Hai, PhD 9.4 BCD Addition Sum Equals 9 or less Example 9.5 Example 9.6 Digital Arithmetic: Operations and Circuits University of Technical Education Faculty of Electrical & Electronic Engineering 10 Nguyen Thanh Hai, PhD 9.4 BCD Addition Sum Greater than 9 Example 9.7 Example 9.8 Always + 6, due to 9 (BCD)+6=15, 4 bits can count from 0-15 Digital Arithmetic: Operations and Circuits University of Technical Education Faculty of Electrical & Electronic Engineering 11 Nguyen Thanh Hai, PhD 9.4 BCD Addition Sum Greater than 9 Example 9.9 Example 9.10 Digital Arithmetic: Operations and Circuits University of Technical Education Faculty of Electrical & Electronic Engineering 12 Nguyen Thanh Hai, PhD 9.4 BCD Addition 247 = 0010 0100 0111 538 = 0101 0011 1000 0111 0111 1111 0110 785 = 0111 1000 0101 + + Add 6 Greater than 9 Example 9.11 More example: Add 355 and 671 Digital Arithmetic: Operations and Circuits University of Technical Education Faculty of Electrical & Electronic Engineering 13 Half Adder Block diagram where A: Input digits B: Input digits S: Sum C 0 : Carry Output function BABABAS ⊕=+= ABC 0 = Truth table A B S C 0 0 0 0 1 1 0 1 1 0 0 1 0 1 0 0 1 Input Output 9.5 Adder and Subtractors Nguyen Thanh Hai, PhD Digital Arithmetic: Operations and Circuits University of Technical Education Faculty of Electrical & Electronic Engineering 14 Half adder logic diagram Write the output functions of these two circuits Nguyen Thanh Hai, PhD Digital Arithmetic: Operations and Circuits University of Technical Education Faculty of Electrical & Electronic Engineering 15 9.5 Adder and Subtractors Block diagram where A: input digits B: Input digits S: Sum out C 0 : Carry out C I : Carry in Full Adder Nguyen Thanh Hai, PhD Digital Arithmetic: Operations and Circuits University of Technical Education Faculty of Electrical & Electronic Engineering 16 Truth table Inputs Outputs A B C i S C 0 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 0 0 1 0 1 0 0 1 1 0 0 1 0 1 1 1 = S i CBA i CBA+ i CBA+ i ABC + )ABBA(C i += )BABA(C i ++ )BA(C i ⊕= )BA(C i ⊕+ i CBA ⊕ ⊕ = Output expression 9.5 Adder and Subtractors Nguyen Thanh Hai, PhD Digital Arithmetic: Operations and Circuits University of Technical Education Faculty of Electrical & Electronic Engineering 17 = S i CBA ⊕ ⊕ 00 01 11 10 0 0 0 1 0 1 0 1 1 1 C i AB = 0 C AB i C)BA(AB ++= i AC + i BC + Nguyen Thanh Hai, PhD Truth table Output expression Inputs Outputs A B C i S C 0 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 0 0 1 0 1 0 0 1 1 0 0 1 0 1 1 1 9.5 Adder and Subtractors Digital Arithmetic: Operations and Circuits University of Technical Education Faculty of Electrical & Electronic Engineering 18 Nguyen Thanh Hai, PhD Logic diagram of full Adder 9.5 Adder and Subtractors Digital Arithmetic: Operations and Circuits University of Technical Education Faculty of Electrical & Electronic Engineering 19 Add 2 binary digits of 4 bits, A 3 A 2 A 1 A 0 + B 3 B 2 B 1 B 0 Nguyen Thanh Hai, PhD 9.5 Adder and Subtractors Digital Arithmetic: Operations and Circuits University of Technical Education Faculty of Electrical & Electronic Engineering 20 Block diagram Output expression BABABAD ⊕=+= BAB 0 = A B D B 0 0 0 0 1 1 0 0 0 1 1 1 0 Inputs Outputs Truth table where A: Minuend B: subtrahend D: difference B 0 : Borrow 1 1 0 0 Half subtractor Nguyen Thanh Hai, PhD 9.5 Adder and Subtractors [...]...University of Technical Education Faculty of Electrical & Electronic Engineering Digital Arithmetic: Operations and Circuits 9.5 Adder and Subtractors Half subtractor Logic circuit 21 Nguyen Thanh Hai, PhD University of Technical Education Faculty of Electrical & Electronic Engineering Digital Arithmetic: Operations and Circuits 9.5 Adder and Subtractors Full subtractor Block diagram where... Engineering Digital Arithmetic: Operations and Circuits 9.5 Adder and Subtractors Full subtractor Output expression Truth table D = A BBi + ABBi + A BBi + ABBi = Bi (A B + AB) + Bi (AB + A B) = Bi (A ⊕ B) + Bi (A ⊕ B) = A ⊕ B ⊕ Bi Notice: C=Bi; B=Borrow; D=Difference 23 Nguyen Thanh Hai, PhD University of Technical Education Faculty of Electrical & Electronic Engineering Digital Arithmetic: Operations... Hai, PhD University of Technical Education Faculty of Electrical & Electronic Engineering Digital Arithmetic: Operations and Circuits 9.5 Adder and Subtractors Full subtractor Logic circuit 25 Nguyen Thanh Hai, PhD University of Technical Education Faculty of Electrical & Electronic Engineering Digital Arithmetic: Operations and Circuits 9.5 Adder and Subtractors Full subtractor Subtractor circuit with... University of Technical Education Faculty of Electrical & Electronic Engineering Digital Arithmetic: Operations and Circuits -Take a look Examples from pages - Answer Review questions at page - Homework 27 Nguyen Thanh Hai, PhD University of Technical Education Faculty of Electrical & Electronic Engineering Digital Arithmetic: Operations and Circuits The End 28 Nguyen Thanh Hai, PhD . 1 Lecture: DIGITAL SYSTEMS Chapter 9: Digital Arithmetic: Operations and Circuits Nguyen Thanh Hai, PhD University of Technical Education Faculty of Electrical & Electronic Engineering Digital Arithmetic: . Engineering 2 Nguyen Thanh Hai, PhD 9. 1 Binary Addition 9. 2 Addition in the 2’s-Complement System 9. 3 Subtraction in the 2’s-Complement System 9. 4 BCD Addition 9. 5 Adders and Subtractors Digital Arithmetic: Operations. Engineering 10 Nguyen Thanh Hai, PhD 9. 4 BCD Addition Sum Greater than 9 Example 9. 7 Example 9. 8 Always + 6, due to 9 (BCD)+6=15, 4 bits can count from 0-15 Digital Arithmetic: Operations and Circuits University

Ngày đăng: 19/07/2015, 19:52

Xem thêm: Chapter 9_Digital Arithmetic