projects
/
yosys.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
fail svinterfaces testcases on yosys error exit
[yosys.git]
/
tests
/
simple
/
constmuldivmod.v
1
module constmuldivmod(input [7:0] A, input [2:0] mode, output reg [7:0] Y);
2
always @* begin
3
case (mode)
4
0: Y = A / 8'd0;
5
1: Y = A % 8'd0;
6
2: Y = A * 8'd0;
7
8
3: Y = A / 8'd1;
9
4: Y = A % 8'd1;
10
5: Y = A * 8'd1;
11
12
6: Y = A / 8'd2;
13
7: Y = A % 8'd2;
14
8: Y = A * 8'd2;
15
16
9: Y = A / 8'd4;
17
10: Y = A % 8'd4;
18
11: Y = A * 8'd4;
19
20
12: Y = A / 8'd8;
21
13: Y = A % 8'd8;
22
14: Y = A * 8'd8;
23
24
default: Y = 8'd16 * A;
25
endcase
26
end
27
endmodule