Decimal adder • When dealing with decimal numbers BCD code is used. • A decimal adders requires at least 9 inputs and 5 outputs. • BCD adder: each input does not exceed 9, the output can not exceed 19 • How are decimal numbers presented in BCD? • Decimal Binary BCD • 9 1001 1001 • 19 10011 (0001)(1001) • 1 9
15
Embed
Decimal adder - WordPress.com · • Example: BCD adder • Suppose we apply two BCD numbers to a binary adder then: • The result will be in binary and ranges from 0 through 19.
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Decimal adder
• When dealing with decimal numbers BCD code is used.
• A decimal adders requires at least 9 inputs and 5 outputs.
• BCD adder: each input does not exceed 9, the output can not exceed 19
• For numbers equal or less than 1001 binary and BCD are identical. • For numbers more than 1001, we should add 6(0110) to binary to get BCD. • example: 10011(binary) = 11001(BCD) =19 • ADD 6 to correct.
• Comparator is a combinational logic circuit that compares the magnitudes of two binary quantities to determine which one has the greater magnitude.
• In other word, a comparator determines the
relationship of two binary quantities.
• A exclusiveOR gate can be used as a basic comparator.
Magnitude Comparators
• How do we know if A>B?
• 1.Compare bits starting from the most significant pair of digits • 2.If the two are equal, compare the next lower significant bits • 3.Continue until a pair of unequal digits are reached • 4.Once the unequal digits are reached, A>B if Ai=1 and Bi=0, A<B if
• There are two different types of output relationship between the two binary quantities;
• Equality output indicates that the two binary numbers being compared is equal (A = B) and
• Inequality output that indicates one of the two binary number being compared is the larger.
• That is, there is an output that indicates when A is greater than B (A > B) and an output that indicates when A is less than B (A < B).
Example: Determine the A=B, A>B, and A<B outputs for the input numbers shown on the 4-bit comparator as given below.
Solution: The number on the A inputs is 0110 and the number on the B inputs is 1100. The A < B output is HIGH and the other outputs (A=B and A > B) are LOW