Thursday, June 28, 2018

A structural version of the 74LS107A

Since I'd tested a structural simulation of the 74107 master/slave J/K flip-flop, I thought it appropriate to also test a structural simulation of the 74LS107A edge-triggered J/K flip-flop. The datasheet for the SN74LS107A from Texas Instruments provides a schematic for their chip, so I started there:
 

Here's my structural Verilog translation:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
module sn74ls107a (
    input  wire         CLK,    // Data clock (active falling edge)
    input  wire         CLR,    // Async reset (active low)
    input  wire         J,      // Set
    input  wire         K,      // Reset
    output wire         Q,      // True Q output
    output wire         QN      // Inverted Q output
    );

    wire n1, n2;
    nand #(9,10) u1(n1, CLK, K, Q );
    nand #(9,10) u2(n2, CLK, J, QN);

    wire n3, n4;
    and #(9,10) u3(n3, CLK, QN);
    and #(9,10) u4(n4, CLK, Q, CLR);

    wire n5, n6;
    and #(9,10) u5(n5, n2, QN);
    and #(9,10) u6(n6, n1, Q, CLR);

    nor #(9,10) u7(Q,  n3, n5);
    nor #(9,10) u8(QN, n4, n6);

endmodule

The timing for this doesn't match that given in the datasheet, but for the purposes of my tests it doesn't matter as long as there is some propagation delay through each gate.

Both the ring and program (binary ripple) counters work, with some short glitches in the outputs about 18 ns after the falling edge of the clock. However, in the full SAP-1 configuration, it works perfectly with no double counting. The fact that this circuit is not sensitive to changes in J and K while the clock is high makes all the difference.

Thus I repeat my assertion from the previous post: The SAP-1 circuit will not work with a 74107 master/slave flip-flop in the program counter. This also means that Section 8-4 of the textbook is incorrect as written. The use of an edge-clocked device like the 74LS107A is essential in these circuits.

I now feel the urge to get a few 74107 and 74LS107A chips and prove this on my bench. Normally I'd just tack on the extra parts to my next DigiKey order, but they don't stock the 74107 as it's obsolete. Jameco says they stock both the original 74107 and the 74LS107, so I placed an order for some. After I get a chance to run some tests with them I'll post my results.

No comments:

Post a Comment