230 likes | 235 Views
This module implements a 4-bit equality comparator using XNOR gates. The circuit compares three 4-bit fields (A, B, and C) and outputs a logic high if they are all equal.
E N D
Equality Detector Module M5.1 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 FIELD A = [A0..3]; FIELD B = [B0..3]; FIELD C = [C0..3];
Bit Fields FIELD A = [A0..3]; FIELD B = [B0..3]; FIELD C = [C0..3]; A represents [A0, A1, A2, A3] B represents [B0, B1, B2, B3] C represents [C0, C1, C2, C3]
/******************************************************/ /* */ /* This is a 4-bit equality comparator */ /* using the ANDing of 4 XNOR gates */ /* */ /******************************************************/ /* Target Device: G16V8 */ /******************************************************/
C = !(A $ B) C0 = !(A0 $ B0) C1 = !(A1 $ B1) C2 = !(A2 $ B2) C3 = !(A3 $ B3)
1 20 Vcc I/CLK 2 19 I I/O 3 18 I/O I 4 17 I I/O 5 16 I I/O 6 15 I I/O 7 14 I I/O 8 13 I I/O 9 12 I I/O 10 11 GND I/OE GAL 16V8 The GAL 16V8
4-Bit Equality Comparator End of .doc file
Question Expand the following CUPL equation for F: FIELD A = [A2..0]; FIELD B = [B2..0]; FIELD F = [F2..0]; F = !A & B;