Prev Problem
Next Problem

10. Splitting Vector

Back To All Submissions
Previous Submission
Next Submission

Solving Approach

How do you plan to solve it?

assign the vector indexing map with the bit they want to arrange. in this problem bit 0->3 of out1 need to map in_vec with the index from 4-7
Range of vector indexing need to be behind vector's name

// Note: range of vector indexing need to be behind vector's name

 

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[3:0] = in_vec[7:4];
    assign out2[1:0] = in_vec[3:2];
    assign out3 = in_vec[1];
    assign out4 = in_vec[0];
endmodule

 

Was this helpful?
Upvote
Downvote