Single Continuous Assignment
The simplest piece of combinational logic: an output that is always the AND of two inputs. assign describes a wire that never stops tracking its inputs.
This module takes two single-bit inputs and computes their logical AND. The output continuously reflects the evaluation of the inputs at any given moment.
This circuit is purely combinational. There is no clock signal and no reset signal. The output evaluates and updates immediately based on the current state of the inputs.
| Signal | Direction | Width | Description |
|---|---|---|---|
| a | input | 1 | First operand |
| b | input | 1 | Second operand |
| y | output | 1 | Logical AND of a and b |
Constraints
- The output
ymust update combinationally based on inputsaandb - The module contains no sequential elements; do not use a clock or reset
- Inputs and outputs are strictly 1-bit wide
Topics
Solve this problem
Write the module in Verilog, SystemVerilog or VHDL. Your submission is compiled and simulated against the problem's testbench. You get the waveform back, not a stored answer.
Free to solve. A Codiode account keeps your progress.
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.
Part of Verilog Syntax and Language Basics
Problem 21 of 25 in the Verilog Syntax and Language Basics track.
Related problems
Browse all problems · Verilog practice problems · Learning tracks