13 Addition and subtraction Flashcards

1
Q

The most basic arithmetic operation is the sum of two binary bits:

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Adder TT

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Half adder logic circuit

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Adder circuit diagram

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Full adders overview?

A

Full adders allow the addition of n-bit binary numbers. The addition process is bit by bit, from the least significant bit to the most significant bit.

The addition at each position adds not only the respective bits, but also the possible carry bit from the addition at the previous position.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

input and outputs of a full adder

A

Thus, a full adder is a combinatorial arithmetic circuit composed of the input bits, variable A, B and Cin, and two output bits, S, Cout.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Full adder TT and K Maps

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Full adder digital circuits

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

x2 half adders running as a full adder

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Addition: Ripple Carry Adder

cascade architecture

A
  • Multiple full adders can be in connected in a cascade architecture to build a n-bit binary adder.
  • The output carry, Cout, from each full adder is connected to the input carry, Cin, of the next full adder in the chain.
  • Addition of n-bit numbers requires a chain of n full adders or onehalf-adder and n-1 full adders.
  • Also known as Ripple Carry Adder (RCA).
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Ripple Carry Adder (RCA) diagram

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Ripple Carry Adder (RCA). Consider the following two number: A=0101 and B=0111.

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Ripple Carry Adder, delays

A

In the Ripple Carry Adder (RCA) each full adder waits for the carry output from the previous full adder.

The output S2 from adder 2 cannot complete until carry C1 is provided by adder 1, output S3 from adder 3 cannot complete until carry C2 is provided by adder 2 and so on.

This creates a delay to compute the addition of two numbers. This delay can be considerable when implementing adders with large input sizes, e.g., 32 bit adder and 64 bit adder.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Ripple Carry Adder The problems with the delay?

A

This creates a delay to compute the addition of two numbers. This delay can be considerable when implementing adders with large input sizes, e.g., 32 bit adder and 64 bit adder.

Then, depending on the number input bits, the adder can become slow.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Addition: Carry Lookahead Adder

A
  • The Carry Lookahead Adder (CLA) is a type of adder that overcomes the disadvantage from the RCA circuit.
  • The CLA divides the adder into blocks providing circuitry to quickly determine the carry out of a block as soon as the carry in is known.
  • This approach looks ahead across the block rather waiting the carry out to propagate through all the full adders.
  • The CLA requires additional circuitry which increases the complexity of the design.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Addition: Carry Lookahead Adder

carry generate, G, and carry propagate, P

A

The Carry Lookahead Adder uses a carry generate, G, and carry propagate, P, signals to determine the carry out.

  1. Carry is generated if the adder produces a carry out independent of the carry in. A carry Ci is guaranteed if Ai and Bi are both 1 (Gi=Ai Bi).
  2. Carry is generated if the adder produces a carry out whenever there is a carry in. A carry will be propagated if either Ai or Bi is 1.
17
Q

ADD: Carry Lookahead Adder logical circuit

A
18
Q

Addition: Carry Lookahead Adder, repeated carrys

A
19
Q

Circuitry of the carry look ahead generator for three full adders, C0 to C3

A
20
Q

Circuitry of the carry look ahead generator for three full adders, C0 to C3.

Overall realisation

A
21
Q

Subtraction overview

A

A subtraction can also be thought of as an addition of one value to the 2’s complement of another.

Adders can add positive and negative numbers using 2’s complement number representation.

The 2’s complement of a number can be obtained by taking the 1’s complement and adding 1 to the least significant pair of bits.

The 1’s complement can be implemented using inverters and a 1 can be added to the sum through the input carry.

22
Q
A
23
Q

The Adder-Subtractor

A
  • The addition and subtraction functions can be combined into one circuit with one common binary adder.
  • For this process, an additional input is required for control of the operation mode: addition/subtraction.
  • An exclusive-OR gate can be used with each full adder to select the operation mode.
  • This exclusive-OR gate also inverts all the bits of the input B for the subtraction operation mode, and initialise the carry of the first full adder to 0 or 1 for addition or subtraction, respectively.
24
Q

Adder-Subtractor circuit?

A
25
Q

Overflow?

A

When two numbers with n digits each are added and the sum is a number occupying n + 1 digits, we say that an overflow occurred.

Overflow is a problem because the number of bits that hold the number is finite and a result that contains n + 1 bits cannot be accommodated by an n -bit word.

When two unsigned numbers are added, an overflow is detected from the end carry out of the most significant position.

When two signed numbers are added the end carry does not indicate an overflow and additional circuitry is needed.

26
Q

Overflow example

Two signed binary numbers, +70 and +80, are stored in two eight-bit registers. The range of numbers that each register can accommodate is from binary +127 to binary -128. Since the sum of the two numbers is +150, it exceeds the capacity of an eight-bit register.

A
27
Q

Overflow detection?

A
28
Q

Verilog: Half adder?

A
29
Q

Verilog: Full adder?

A
30
Q

Ripple carry 4 bit adder System Verilog?

A
31
Q

Example of implementation of a full adder

A
32
Q

Example of implementation of a subtractor

A
33
Q
A