RSS feeds in the directory: 374
Added today: 0
Added yesterday: 0
Comparison of multi-digit numbers based on checking the equality of numbers of numbers. Let the two numbers A3A2A1A0 and V3V2V1V0 . Compares A3 and B3 , B2 and A2 , B1 and A1 , B0 and A0 , the results of the comparison, the conclusion is: if match and third digits, and the second, first and zero, the number is the same. The truth table of the bitwise comparison is shown in Fig. 22.7.
Fig. 22.7. The truth table of the bitwise comparison
using the laws of algebra of logic it is possible to provide an expression output:
Switching function F allows to implement a logical two-input NAND gates Exclusive OR. In Fig. 22.8 shows one embodiment of the implementation of the scheme comparison.
Fig. 22.8. Schemes comparison of IP 155LP5 and 155LR3
it is Possible to build more complex of the comparison circuit that determines equality of numbers, and which numbers more. It can determine equality of two binary numbers A and b with the same number of digits or the inequality A > b or A < B. the Digital Comparators have three outputs. Scheme one-bit comparator is a logical element "Exclusive OR NOT" (Fig. 22.9).
Fig. 11.9. Comparator with three outputs
From the analysis of the scheme it follows that if A = b, then F = 1, otherwise, i.e., if A ≠ V, F = 0. If A > b, ie A = 1, B = 0, C = 1 and if A < b ie A = 0, b = 1, D = 1.
If the pairs are equal, all bits of the two n-bit binary numbers, then equal and the two numbers A and B. Using a digital comparator for each category, for example, four digit numbers, and determining the values F1, F2, F3, F4 Boolean variables at the outputs of the Comparators, the equality A = To install in the case when F = F1• F2 • F3 • F4 = 1. If F = 0, then A ≠ C.
the Inequality A > In is provided (for four-digit numbers) in four cases: either A4 > B4 or A4 = B4 and A3 > B3 or A4 = B4, A3 = B3 and A2 > B2 or A4 = B4, A3 = B3, A2 = B2 and A1 > B1 (where A4 and B4 – significant bits of numbers A and b). Obviously, if you swap Ai and Bi, then you will run the inequality A < B.
currently, commercially available ready schemes of four-digit number comparison (Fig. 22.10).
Fig. 22.10. Digital Comparators: a) K134SP1, b) K555SP1
Presented circuits are the four-digit Comparators, in which each of one-bit comparator similar to the previously discussed scheme. These chips are extending the inputs A < B, A = b, And >that allows to increase the bit width of both numbers.