In this study, we propose a method using a single piece of hardware to detect two types of cyber-attacks, namely malware and malicious communications, on Internet of Things (IoT) devices. Because IoT devices are generally less powerful than computers and do not have the resources to constantly run security software, previous studies have implemented attack detection mechanisms in IoT devices in the form of hardware rather than software. We follow this approach by creating two types of discriminators representing normal programs and attacks, which are generated using machine learning for hardware-implemented attack detection mechanisms. We demonstrate two approaches to integrating the discriminators for application on a single piece of hardware. The accuracy of the proposed discriminators for malicious communication detection and malware detection are comparable to that of the respective single-functional discriminators, but the proposed integrated discriminators are smaller.