Bitwise versus Logical Negation
Digital signal processing and control logic frequently require both bitwise inversion of data buses and logical checks to determine if a bus is completely empty. Mixing up the operators for these two distinct operations is a common source of bugs in hardware design.
This module receives an 8-bit input bus and computes two distinct outputs concurrently. The first output provides a bit-by-bit inverted version of the input data. The second output acts as a zero-detection flag, asserting high only when the entire 8-bit input bus is exactly zero.
The circuit is purely combinational. There is no clock or reset, and outputs must reflect the input state continuously.
| Signal | Direction | Width | Description | |--------|-----------|-------|-------------| | in_bus | input | 8 | The 8-bit input data bus | | out_bitwise | output | 8 | The bitwise negation of in_bus | | out_logical | output | 1 | The logical negation of in_bus; evaluates to 1 when in_bus is zero |
Constraints
- The design must be purely combinational with no latches or registers
out_logicalmust be exactly 1 bit wideout_bitwisemust be exactly 8 bits wide
Topics
Solve this problem
Write the module in Verilog, SystemVerilog or VHDL. Your submission is compiled and simulated against a real testbench — you get the waveform back, not a stored answer.
This problem is part of Codiode Pro. The statement above is free to read.
The circuit builder and code editor need a desktop screen. On a phone, read the problem here and open it on a laptop to solve.