nim64/chips/ic74373

    Dark Mode
Search:
Group by:

An emulation of the 74373 octal D-type transparent latch.

The 74373 is one of the 7400-series TTL logic chips, consisting of eight transparent latches. These latches normally allow data to flow freely from input to output, but when the latch enable pin LE is set to low, the output is latched. That means it retains its current state, no matter what the input pins do in the meantime. Once LE goes high again, the outputs once more reflect their inputs.

Since this chip is most often used in bus-type applications, the pins are named using more of a bus-type convention. The inputs are D and the outputs are Q, and the latches are numbered from 0 rather than from 1.

The chip has an active-low output enable pin, OE. When this is high, all outputs are set to a high impedance state.

OELEDnQn
HXXZ
LHLL
LHHH
LLXQ₀

Q₀ means whatever level the pin was in the previous state. If the pin was high, then it remains high. If it was low, it remains low.

The chip comes in a 20-pin dual in-line package with the following pin assignments.

        +---+--+---+
     OE |1  +--+ 20| VCC
     Q0 |2       19| Q7
     D0 |3       18| D7
     D1 |4       17| D6
     Q1 |5       16| Q6
     Q2 |6 74373 15| Q5
     D2 |7       14| D5
     D3 |8       13| D4
     Q3 |9       12| Q4
    GND |10      11| LE
        +----------+
GND and VCC are ground and power supply pins respectively, and they are not emulated.

In the Commodore 64, U26 is a 74LS373 (a lower-power, faster variant whose emulation is the same). It's used to connect the multiplexed address bus to the lower 8 bits of the main address bus. It latches the low 8 bits of the multiplexed bus so that, when the lines are switched to the high 8 bits, those bits do not leak onto the low 8 bits of the main bus.

Types

Ic74373 = ref object
  pins: Pins

Consts

OE = 1
The pin assignment for the output enable pin.
Q0 = 2
The pin assignment for data output pin 0.
D0 = 3
The pin assignment for data input pin 0.
D1 = 4
The pin assignment for data input pin 1.
Q1 = 5
The pin assignment for data output pin 1.
Q2 = 6
The pin assignment for data output pin 2.
D2 = 7
The pin assignment for data input pin 2.
D3 = 8
The pin assignment for data input pin 3.
Q3 = 9
The pin assignment for data output pin 3.
GND = 10
The pin assignment for the ground pin.
LE = 11
The pin assignment for the latch enable pin.
Q4 = 12
The pin assignment for data output pin 4.
D4 = 13
The pin assignment for data input pin 4.
D5 = 14
The pin assignment for data input pin 5.
Q5 = 15
The pin assignment for data output pin 5.
Q6 = 16
The pin assignment for data output pin 6.
D6 = 17
The pin assignment for data input pin 6.
D7 = 18
The pin assignment for data input pin 7.
Q7 = 19
The pin assignment for data output pin 7.
VCC = 20
The pin assignment for the +5V power supply pin.

Procs

proc `[]`(chip`gensym0: Ic74373; index`gensym0: int): Pin {...}{.inline, raises: [],
    tags: [].}
Looks up a pin by the pin's number.
proc `[]`(chip`gensym0: Ic74373; index`gensym0: string): Pin {...}{.inline,
    raises: [KeyError], tags: [].}
Looks up a pin by the pin's name.
proc pins(chip`gensym0: Ic74373): seq[PinInfo] {...}{.raises: [], tags: [].}
Returns a read-only view of the chip's pins.
proc newIc74373(): Ic74373 {...}{.raises: [Exception, KeyError, ValueError],
                             tags: [RootEffect].}

Iterators

iterator items(chip`gensym0: Ic74373): Pin {...}{.raises: [], tags: [].}
Iterates over the chip's pins, yielding them in order by pin number.
iterator pairs(chip`gensym0: Ic74373): (int, Pin) {...}{.raises: [], tags: [].}
Iterates over the chip's pins, yielding both the pin number and the pin itself.