Hex value:
55 × 86 = 2C7E
Hex value:
289A × 4 = A268
Hex value:
2C7E + A268 = CEE6
`timescale 1 ns/1 ns
module EX_110 (a, b, c, d);
input [7:0] a, b;
input [15:0] c;
output [15:0] d;
wire [15:0] d;
wire [15:0] tmp;
assign tmp = a * b;
assign d = tmp + (c<<2);
endmodule
module testbench;
reg [7:0] a, b;
reg [15:0] c;
wire [15:0] d;
EX_110 UUT(
.a(a),
.b(b),
.c(c),
.d(d) );
initial
begin
a = 8'h55; // Time = 0
b = 8'h86;
c = 16'h289a;
#50; // Time = 50
a = 8'h54;
b = 8'h96;
c = 16'h067a;
#50;
$stop;
end
endmodule
沒有留言:
張貼留言