# Boolean Algebra: Chapter 6

Circuits 2011-2012
SACC

# Boolean Algebra: Chapter 6

## // INTRODUCTION

BCD binary numbers represent Decimal digits 0 to 9. A 4-bit BCD code is used to represent the ten numbers 0 to 9. Since the 4-bit Code allows 16 possibilities, the first 10 4-bit combinations are considered to be valid BCD combinations. The latter six combinations are invalid and do not occur.

You can produce a one-bit sum and one bit carry using 2 boolean functions:
`Sum=AB +AB`
Carry=AB
Together these functions produce a half-adder, which adds two bits together, but cannot add in a carry from a previous operation.

A full-adder adds 3 1-bit inputs (2-bits and a carry from a previous addition) and produces two outputs (sum and the carry):
Sum=(A BCin) +(ACin)+(AB Cin)+(ABCin)
Cout=(AB)+ACin)+BCin)

## // LAB

1. Design a circuit to add 2 2-bit numbers using a 7483 4-bit adder. Use 2 switches on the designer to input 1 value and 2 other switches to input the other value.

• The 7483 adds 2 4-bit values. What must be done with the unused inputs?
• What should be done with the carry input?
• How many outputs from the adder must be connected to the LEDs to see all the possible outputs?

2. Design a circuit to display the decimal equivalent of a 4-bit BCD value. Use a 7447 BCD, and a seven-segment common anode display.

3. Design a circuit to subtract values. Take the number you want to subtract, invert it, add 1 to it, then add this value to the number you want to subtract from.

4. For sums between 10 and 18, you must subtract 10 and produce a carry. Subtract 10 from 10102 and add 2s complement >01102

For sums >9 you need to add 2's complement of 1010 to the uncorrected result(S3,S2,S1,S0).

Correction is also needed when a carry out (C3 is generated (16,17,18)

A decoder is needed to detect when carry out (Cn to the next stage is needed.

K-Map for Cn
 S'1S;0 S'3S;2 00 01 11 10 00 0 1 3 2 01 4 5 7 6 11 10 8 9

Cn=C'3+S'3S'2+S'3S'1

To implement a 4-bit BDC adder you need 2 4-bit full adders. One to add 2 4-bit BCD numbers and the other full adder to add the 2's complement of 1010 to the result if Cn=1

You also need 2 AND gates and one OR gate to generate Cn

5. BDCD Subtraction

Design a 9's Complement Generator for a BCD Digit 9's complement
The 9's complement of a decimal number is found by subtracting each digit in the number from 9
 Decimal Digit 9's complement 0 9 1 8 2 7 | | 9 0

the 9's complement of 28=99-28=71
the 9's complement of 562=999-562=437

Subtraction of a smaller decimal number from a larger one can be done by adding the 9's complement of the smaller number to the larger number and then adding the carry to the result (end around carry). When subtracting a larger number from a smaller one there is no carry and the result in the 9's complement form is negative:

86-99=-13

Rules
• Add 9's complement of B to A
• If result>9, correct by adding 0110
• If most significant carry is produced (i.e.=1), then the result is positive and the end around carry must be added
• If the most significant carry is 0 (no carry) then the result is negative and you get the 9's complement of the result

But, unfortunately subtractors are not widely available. Fortunately, you can generate the 9's complement b adding 1010 to the inverted number:
 BCD Digit DIGIT DIGIT+1010 0000 1111 1001 0001 1110 1000 0010 1101 0111 0011 1100 0110 0100 1011 0101 0101 1010 0100 0110 1001 0011 0111 1000 0010 1000 0111 0001 1001 0110 0000

Ignore the carry out

Source: Passafine, John and Michael Douglas, Digital Logic Design