130 likes | 364 Views
Equality Detector. Lecture L6.3 Section 6.1. Equality Detector. XNOR. X Y Z 0 0 1 0 1 0 1 0 0 1 1 1. X. Z. Y. Z = !(X $ Y). 4-Bit Equality Comparator. A = [A3..A0]; B = [B3..B0]; C = [C3..C0];. Sets. A = [A3..A0]; B = [B3..B0]; C = [C3..C0];.
E N D
Equality Detector Lecture L6.3 Section 6.1
Equality Detector XNOR X Y Z 0 0 1 0 1 0 1 0 0 1 1 1 X Z Y Z = !(X $ Y)
4-Bit Equality Comparator A = [A3..A0]; B = [B3..B0]; C = [C3..C0];
Sets A = [A3..A0]; B = [B3..B0]; C = [C3..C0]; A represents [A3, A2, A1, A0] B represents [B3, B2, B1, B0] C represents [C3, C2, C1, C0]
ABEL Program MODULE eqcomp1 TITLE '4-BIT EQUALITY DETECTOR, R. Haskell, 9/21/02‘ DECLARATIONS " INPUT PINS " A3..A0 PIN 6, 7, 11, 5; A = [A3..A0]; B3..B0 PIN 72, 71, 66, 70; B = [B3..B0]; " OUTPUT PINS " A_EQ_B PIN 36; C3..C0 NODE; C = [C3..C0];
ABEL Program (cont.) EQUATIONS C = !(A $ B); A_EQ_B = C0 & C1 & C2 & C3; test_vectors ([A, B] -> [A_EQ_B]) [0, 0] -> [1]; [2, 5] -> [0]; [10, 12] -> [0]; [7, 8] -> [0]; [4, 2] -> [0]; [6, 6] -> [1]; [15, 15] -> [1]; END
EQUATIONS C = !(A $ B); A_EQ_B = C0 & C1 & C2 & C3; C = !(A $ B) C0 = !(A0 $ B0) C1 = !(A1 $ B1) C2 = !(A2 $ B2) C3 = !(A3 $ B3)
Question Expand the following ABEL equation for F: A = [A2..A0]; B = [B2..B0]; F = [F2..F0]; F = !A & B;
Question Expand the following ABEL equation for F: A = [A2..A0]; B = [B2..B0]; F = [F2..F0]; F = !A & B; F2 = !A2 & B2; F1 = !A1 & B1; F0 = !A0 & B0;