Challenge
Look at the following add_sub
module:
logic signed [BITS/2-1:0] a_in;
logic signed [BITS/2-1:0] b_in;
…
{a_in, b_in} = SW;
If you were to replace a_in
and b_in
with a custom type that encapsulates both, would you use a structure or a union? Modify the code so that it uses your custom type, and then simulate and try it on the board.