summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/machine/74148.h
blob: 49da5bba82e35b28b53d0b51f141e6313b9f0cbf (plain) (blame)
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*****************************************************************************

  74148 8-line-to-3-line priority encoder


  Pin layout and functions to access pins:

  input_line_w(4)  [1] /IN4   VCC [16]
  input_line_w(5)  [2] /IN5   /EO [15]  enable_output_r
  input_line_w(6)  [3] /IN6   /GS [14]  output_valid_r
  input_line_w(7)  [4] /IN7  /IN3 [13]  input_line_w(3)
  enable_input_w   [5] /EI   /IN2 [12]  input_line_w(2)
  output_r         [6] /A2   /IN1 [11]  input_line_w(1)
  output_r         [7] /A1   /IN0 [10]  input_line_w(0)
                   [8] GND   /A0  [9]   output_r


  Truth table (all logic levels indicate the actual voltage on the line):

              INPUTS            |     OUTPUTS
                                |
    EI  I0 I1 I2 I3 I4 I5 I6 I7 | A2 A1 A0 | GS EO
    ----------------------------+----------+------
    H   X  X  X  X  X  X  X  X  | H  H  H  | H  H
    L   H  H  H  H  H  H  H  H  | H  H  H  | H  L
    L   X  X  X  X  X  X  X  L  | L  L  L  | L  H
    L   X  X  X  X  X  X  L  H  | L  L  H  | L  H
    L   X  X  X  X  X  L  H  H  | L  H  L  | L  H
    L   X  X  X  X  L  H  H  H  | L  H  H  | L  H
    L   X  X  X  L  H  H  H  H  | H  L  L  | L  H
    L   X  X  L  H  H  H  H  H  | H  L  H  | L  H
    L   X  L  H  H  H  H  H  H  | H  H  L  | L  H
    L   L  H  H  H  H  H  H  H  | H  H  H  | L  H
    ----------------------------+----------+------
    L   = lo (0)
    H   = hi (1)
    X   = any state

*****************************************************************************/

#ifndef TTL74148_H
#define TTL74148_H

#include "devlegcy.h"


typedef struct _ttl74148_config ttl74148_config;
struct _ttl74148_config
{
	void (*output_cb)(device_t *device);
};


#define MCFG_74148_ADD(_tag, _config) \
	MCFG_DEVICE_ADD(_tag, TTL74148, 0) \
	MCFG_DEVICE_CONFIG(_config)


/* must call ttl74148_update() after setting the inputs */
void ttl74148_update(device_t *device);

void ttl74148_input_line_w(device_t *device, int input_line, int data);
void ttl74148_enable_input_w(device_t *device, int data);
int  ttl74148_output_r(device_t *device);
int  ttl74148_output_valid_r(device_t *device);
int  ttl74148_enable_output_r(device_t *device);

DECLARE_LEGACY_DEVICE(TTL74148, ttl74148);

#endif