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

Lecture Digital logic design - Lecture 14: Binary adders and subtractors

38 45 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

Thông tin cơ bản

Định dạng
Số trang 38
Dung lượng 863,19 KB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

The following will be discussed in this chapter: Addition and subtraction of binary data is fundamental, represent inputs and outputs, hardware features, same hardware can be used for addition and subtraction with minor changes, dealing with overflow.

Trang 1

Lecture 14

Binary Adders and Subtractors

Trang 2

w

° Addition and subtraction of binary data is fundamental

• Need to determine hardware implementation

° Represent inputs and outputs

• Inputs: single bit values, carry in

• Outputs: Sum, Carry

° Hardware features

• Create a single-bit adder and chain together

° Same hardware can be used for addition and

subtraction with minor changes

° Dealing with overflow

• What happens if numbers are too big?

Trang 3

° Add two binary numbers

• A 0 , B 0 -> single bit inputs

• S 0 -> single bit sum

• C 1 -> carry out

Trang 4

1 1

1 1

  Ai+Bi

  Ci

Si

Ci+1

° Consider single-bit adder for each bit position.

Each bit position creates a sum and carry

Trang 5

Si

° Full adder includes carry in C i

° Notice interesting pattern in Karnaugh map.

Trang 6

° Full adder includes carry in C i

° Alternative to XOR implementation

Trang 7

Full Adder

Si = Ci’ Ai’ Bi

+ Ci’ Ai Bi’

+ Ci Ai’ !Bi’ + Ci Ai Bi

Trang 8

Full Adder (S in SOP)

Trang 9

Ci+1

° Now consider implementation of carry out

° Two outputs per full adder bit (Ci+1, Si)

Note: 3 inputs

Trang 10

° Now consider implementation of carry out

° Minimize circuit for carry out - C i+1

Trang 11

Full Adder (C in SOP)

Trang 14

° Hardware repetition simplifies hardware design

Trang 15

° Putting it all together

• Single-bit full adder

• Common piece of computer hardware

Trang 16

° Chain single-bit adders together.

° What does this do to delay?

Trang 17

Negative Numbers – 2’s

Complement.

110 = 0116 = 00000001-110 = FF16 = 11111111

12810 = 8016 = 10000000-12810 = 8016 = 10000000

° Subtracting a number is the same as:

1 Perform 2’s complement

2 Perform addition

° If we can augment adder with 2’s complement

hardware?

Trang 19

Adder- Subtractor Circuit

Trang 20

Overflow in two’s complement

addition

° Definition: When two values of the same signs are

added:

• Result won’t fit in the number of bits provided

• Result has the opposite sign.

Trang 21

  1101   1010

­­­­­­­­

11

  1110   1101

­­­­­­­­

01

  0011   0110

­­­­­­­­

11

  1110   0100

 2

­4

­2

­2  4   2

Trang 22

Addition cases and overflow

Trang 23

Binary Parallel Adder (Again)

° To add n-bit numbers:

• Use n Full-Adders in parallel

• The carries propagates as in addition by hand

°This adder is called ripple carry adder

°Src: Mano’s Book

Trang 24

Ripple Adder Delay

°How to improve?

Trang 25

Carry Look Ahead Adder

• How to reduce propagation delay of ripple carry adders?

• Carry look ahead adder: All carries are computed as a

function of C 0 (independent of n !)

• It works on the following standard principles:

• A carry bit is generated when both input bits Ai and Bi

are 1, or

• When one of input bits is 1, and a carry in bit exists

Trang 26

Carry Look Ahead Adder

Trang 27

Carry Look Ahead Adder

Trang 28

Carry Look Ahead Adder

Trang 29

Carry Look Ahead Generator

Trang 30

Carry Look Ahead Adder

Conclusion: Each carry bit can be expressed in

terms of the input carry Co, and not based on its

preceding carry bit

Each carry bit can be expressed as a SOP, and can

be implemented using a two-level circuit, i.e a gate delay of 2T

Trang 31

Carry Look Ahead Adder

Trang 32

BCD Adder

° BCD digits are valid for decimal numbers 0-9

° Addition of two BCD numbers will generate an

output, that may be greater than 1001 (9).

° In such cases, the BCD number 0110 is added to

the result as a correction step

° When adding two BCD numbers, the maximum

result that can be obtained is:

9 + 9 = 18

If we include a carry in bit, then the maximum

result that can be obtained is: 19 (10011)

Both numbers 18 and 19 are invalid BCD digits Therefore, a 6 needs to be added to bring them

to correct BCD format.

Trang 33

Derivation of BCD adder

Trang 34

Derivation of BCD adder

°Combinations 1010 through 1111 need correction

°When K=1, it is necessary to add 0110 to the binary sum

Trang 36

Binary Multiplication

Trang 37

Binary Multiplication

° Therefore, for multiplying two 2-bit numbers, AND

gates and ADDERS will be sufficient

°Half

Adders

Trang 38

° Addition and subtraction are fundamental to computer

systems

° Key – create a single bit adder/subtractor

• Chain the single-bit hardware together to create bigger designs

° The approach is call ripple-carry addition

• Can be slow for large designs

° Overflow is an important issue for computers

• Processors often have hardware to detect overflow

° Next time: encoders/decoder

Ngày đăng: 13/02/2020, 01:39

TỪ KHÓA LIÊN QUAN