Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Half Adder
A
0 0 1 1
B
0 1 0 1
Sum
0 1 1 0
Carry
0 0 0 1
Sum AB AB A B Carry AB
Half Adder
Full Adder
A 0 0 0 0 1 1 1 1 B 0 0 1 1 0 0 1 1 Cin 0 1 0 1 0 1 0 1 Sum 0 1 1 0 1 0 0 1 Cout 0 0 0 1 0 1 1 1
Full Adder
4- Bits adder
BCD Adder
BCD Adder
When the sum of two digits is less than or equal to 9 then the ordinary 4-bit adder can be used But if the sum of two digits is greater than 9 then a correction must be added I.e adding 0110 We need to design a circuit that is capable of doing the correct addition
BCD Adder
The cases where the sum of two 4-bit numbers is greater than 9 are in the following table:
S4 0 0 0 0 0 0 1 1 1 S3 1 1 1 1 1 1 0 0 0 S2 0 0 1 1 1 1 0 0 0 S1 1 1 0 0 1 1 0 0 1 S0 0 1 0 1 0 1 0 1 0 10 11 12 13 14 15 16 17 18
BCD Adder
Whenever S4=1 (sums greater than 15) Whenever S3=1 and either S2 or S1 or both are 1 (sums 10 to 15) The previous table can be expressed as: X = S4 + S3 ( S2 + S1) So, whenever X = 1 we should add a correction of 0110 to the sum.
0011
0101
0 0 0 0 1000 1 1 0 0 0 0000 1 0 0 0
0110
0111
0 1 1 1 1101 1 0 0 1 1 0110 1 1 0 1
Example
Determine the inputs and the outputs when the above circuit is used to add 538 to 247. Assume a CARRY IN = 0 Solution:
Represent the decimal numbers in BCD
247 = 0010 0100 0111 538 = 0101 0011 1000 Put these numbers in registers [A] and [B] [A] = 0010 0100 0111 [B] = 0101 0011 1000
Example
0 0 1 0 0 0111 0 1000 0 1 0 0 1 0 0101 0 1 1 1
0 1 0 1
0 0 1 1
1 0 0 0