

The HEF4013B is a dual D-type flip-flop integrated circuit (IC) that features two identical, independent flip-flops with data, clock, and reset inputs. This IC is widely used in digital electronics for latching, storing bits, edge detection, and building counters and shift registers. Its ability to maintain a binary state makes it essential for sequential logic circuits.








| Pin Number | Name | Description |
|---|---|---|
| 1 | Q1 | Output of flip-flop 1 (non-inverted) |
| 2 | Q1' | Output of flip-flop 1 (inverted) |
| 3 | RST1 | Reset input for flip-flop 1 (active HIGH) |
| 4 | D1 | Data input for flip-flop 1 |
| 5 | CLK1 | Clock input for flip-flop 1 |
| 6 | - | Not connected (NC) |
| 7 | V_SS | Ground (0 V) |
| 8 | CLK2 | Clock input for flip-flop 2 |
| 9 | D2 | Data input for flip-flop 2 |
| 10 | RST2 | Reset input for flip-flop 2 (active HIGH) |
| 11 | Q2' | Output of flip-flop 2 (inverted) |
| 12 | Q2 | Output of flip-flop 2 (non-inverted) |
| 13 | - | Not connected (NC) |
| 14 | V_DD | Positive supply voltage |
Q: Can the HEF4013B be used with an Arduino? A: Yes, the HEF4013B can be interfaced with an Arduino, provided the voltage levels are compatible.
Q: What is the maximum frequency the HEF4013B can handle? A: The maximum clock frequency is 30 MHz at V_DD = 15 V, but it decreases with lower supply voltages.
Q: How do I reset the flip-flop? A: Apply a HIGH signal to the reset input (RST1 or RST2) to reset the respective flip-flop.
// Define the Arduino pins connected to the HEF4013B
const int dataPin = 2; // Connected to D1
const int clockPin = 3; // Connected to CLK1
const int resetPin = 4; // Connected to RST1
void setup() {
pinMode(dataPin, OUTPUT);
pinMode(clockPin, OUTPUT);
pinMode(resetPin, OUTPUT);
// Reset the flip-flop at the start
digitalWrite(resetPin, HIGH);
delay(10);
digitalWrite(resetPin, LOW);
}
void loop() {
// Set data to HIGH
digitalWrite(dataPin, HIGH);
// Toggle the clock to store the data
digitalWrite(clockPin, HIGH);
delay(10); // Wait for a short period
digitalWrite(clockPin, LOW);
delay(1000); // Wait for 1 second
// Reset the flip-flop
digitalWrite(resetPin, HIGH);
delay(10);
digitalWrite(resetPin, LOW);
delay(1000); // Wait for 1 second before the next loop iteration
}
This example demonstrates how to interface the HEF4013B with an Arduino to set and reset the flip-flop. Ensure that the voltage levels are compatible and use level shifters if necessary.