Prev Problem
Next Problem

10. Splitting Vector

Back To All Submissions
Previous Submission
Next Submission

Solving Approach

How do you plan to solve it?

The approach is to extract specific portions of the 8-bit input vector by using part-selects and bit-selects, allowing each output to be assigned directly to the corresponding group of bits or individual bit positions from the input.

 

Code

module vector_splitter (
    input  [7:0] in_vec,
    output [3:0] out1,
    output [1:0] out2,
    output       out3,
    output       out4
);
    // TODO: Assign outputs using part-selects and bit-selects
    assign out1 = in_vec[7:4];
    assign out2 = in_vec[3:2];
    assign out3 = in_vec[1];
    assign out4 = in_vec[0];
endmodule

 

Was this helpful?
Upvote
Downvote