MH7442 BCD to Decimal Decoder

MH7442 BCD to Decimal Decoder
General Description
These BCD-to-decimal decoders consist of eight inverters
and ten, four-input NAND gates. The inverters are connected
in pairs to make BCD input data available for
decoding by the NAND gates. Full decoding of input logic
ensures that all outputs remain off for all invalid (10–15)
input conditions.

Features
■ Diode clamped inputs
■ Also for application as 4-line-to-16-line decoders; 3-line-to-8-line decoders
■ All outputs are high for invalid input conditions
■ Typical power dissipation 140 mW
■ Typical propagation delay 17 ns
  1. Arduino UNO
  2. MH7442
int pins[] = {2,3,4,5}; void setup() { for (int i = 3; i > -1; i--) { pinMode(pins[i], OUTPUT); } } void loop() { for (int a = 0; a < 10; a++) { for (int i = 3; i > -1; i--) { int pin = pins[i]; if (a & (1 << i)) { digitalWrite(pin, HIGH); } else { digitalWrite(pin, LOW); } } delay(200); } }
#include <avr/io.h> #include <util/delay.h> int pins[] = {PD2,PD3,PD4,PD5}; int main(void) { for (int i = 3; i > -1; i--) { DDRD |= (1<<pins[i]); } while (1) { for (int a = 0; a < 10; a++) { for (int i = 3; i > -1; i--) { int pin = pins[i]; if (a & (1 << i)) { PORTD |= (1<<pin); } else { PORTD &= ~(1<<pin); } } _delay_ms(200); } } return 0; }