2021-04-04 18:09:13 +00:00
|
|
|
|
2021-07-14 21:56:49 +00:00
|
|
|
// module sbtm2 (input logic [11:0] a, output logic [10:0] y);
|
2021-04-04 18:09:13 +00:00
|
|
|
|
2021-07-14 21:56:49 +00:00
|
|
|
// // bit partitions
|
|
|
|
// logic [4:0] x0;
|
|
|
|
// logic [2:0] x1;
|
|
|
|
// logic [3:0] x2;
|
|
|
|
// logic [2:0] x2_1cmp;
|
|
|
|
// // mem outputs
|
|
|
|
// logic [12:0] y0;
|
|
|
|
// logic [5:0] y1;
|
|
|
|
// // input to CPA
|
|
|
|
// logic [14:0] op1;
|
|
|
|
// logic [14:0] op2;
|
|
|
|
// logic [14:0] p;
|
|
|
|
// logic cout;
|
2021-04-04 18:09:13 +00:00
|
|
|
|
2021-07-14 21:56:49 +00:00
|
|
|
// assign x0 = a[11:7];
|
|
|
|
// assign x1 = a[6:4];
|
|
|
|
// assign x2 = a[3:0];
|
2021-04-04 18:09:13 +00:00
|
|
|
|
2021-07-14 21:56:49 +00:00
|
|
|
// sbtm_a2 mem1 ({x0[3:0], x1}, y0);
|
|
|
|
// assign op1 = {1'b0, y0, 1'b0};
|
2021-04-04 18:09:13 +00:00
|
|
|
|
2021-07-14 21:56:49 +00:00
|
|
|
// // 1s cmp per sbtm/stam
|
|
|
|
// assign x2_1cmp = x2[3] ? ~x2[2:0] : x2[2:0];
|
|
|
|
// sbtm_a3 mem2 ({x0, x2_1cmp}, y1);
|
|
|
|
// // 1s cmp per sbtm/stam
|
|
|
|
// assign op2 = x2[3] ? {{8{1'b1}}, ~y1, 1'b1} :
|
|
|
|
// {8'b0, y1, 1'b1};
|
2021-04-04 18:09:13 +00:00
|
|
|
|
2021-07-14 21:56:49 +00:00
|
|
|
// // CPA
|
|
|
|
// bk15 cp1 (cout, p, op1, op2, 1'b0);
|
|
|
|
// assign y = p[14:4];
|
2021-04-04 18:09:13 +00:00
|
|
|
|
2021-07-14 21:56:49 +00:00
|
|
|
// endmodule // sbtm2
|
2021-04-04 18:09:13 +00:00
|
|
|
|
|
|
|
|
|
|
|
|