Shuffle

Design a shuffle circuit. It has two inputs (in1 and in2), two outputs (out1 and out2) and one control signal (swap). When swap=0, the inputs must be transferred to the outputs in the same order, i.e., out1=in1 and out2=in2. When swap=1, the inputs must be swapped, i.e., out1=in2 and out2=in1.

Specification

module shuffle(in1, in2, swap, out1, out2);
    input in1, in2, swap;
    output out1, out2;

Input

Output

Problem information

Author: Jordi Cortadella

Generation: 2026-02-03T12:19:11.180Z

© Jutge.org, 2006–2026.
https://jutge.org