Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module testbench;
- logic signed [7:0] x = 8'b11100000;
- logic signed [7:0] y = 8'b00010100;
- logic [15:0] z;
- initial begin
- z = x*y;
- $display("%b %b", z[14:7]) // :)
- //$display("%b", (15'(x*y))[14:7]); // :(
- //$display("%b", 15'(x*y)[14:7]); // :(
- //$display("%b", {15'(x*y)}[14:7]); // :(
- //none of the above 3 works
- end
- endmodule
- result <= 15'(a*b)[14:7];
Add Comment
Please, Sign In to add comment