Skip to content

Commit

Permalink
fixed port and yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
fstolzcode committed Mar 12, 2024
1 parent dd84a13 commit fbf7dab
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions info.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pinout:
ui[0]: ""
ui[1]: ""
ui[2]: ""
ui[3]: ""
ui[3]: "rx"
ui[4]: ""
ui[5]: ""
ui[6]: ""
Expand All @@ -38,7 +38,7 @@ pinout:
uo[1]: ""
uo[2]: ""
uo[3]: ""
uo[4]: ""
uo[4]: "tx"
uo[5]: ""
uo[6]: ""
uo[7]: ""
Expand Down
2 changes: 2 additions & 0 deletions src/adder.sv
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ wire [15:0] be; // one front

reg alu_a_c_in;
reg alu_a_c_out;
reg reg_alu_c_out;
alu_a alu_a_inst(aa,ab,alu_a_c_in,ae,reg_alu_c_out);

reg [15:0] bb_shift_in;
Expand All @@ -61,6 +62,7 @@ bb_shifter bb_shift_ins(bb_shift_in,bb_shift_amount,bb_left,bb_shift_out);

reg alu_b_c_in;
reg alu_b_c_out;
reg alu_b_cout;
alu_b alu_b_inst(ba,bb,alu_b_c_in,be,alu_b_cout);

always @ (posedge clk)
Expand Down
6 changes: 3 additions & 3 deletions src/alu.sv
Original file line number Diff line number Diff line change
Expand Up @@ -94,18 +94,18 @@ module alu_b (
input [16:0] a,
input [15:0] b,
input c_in,
output [16:0] out,
output [15:0] out,
output c_out
);
wire [16:0] b_ex = {1'b0,b[15:0]};
wire [16:0] c;
assign out[0] = a[0] ^ b_ex[0] ^ c_in;
assign c[0] = (a[0] & b_ex[0]) | (a[0] & c_in) | (b_ex[0] & c_in);
genvar i;
generate for(i = 1; i < 17; i = i + 1) begin
generate for(i = 1; i < 16; i = i + 1) begin
assign out[i] = a[i] ^ b_ex[i] ^ c[i-1];
assign c[i] = (a[i] & b_ex[i]) | (a[i] & c[i-1]) | (b_ex[i] & c[i-1]);
end
assign c_out = c[16];
assign c_out = (a[16] & b_ex[16]) | (a[16] & c[15]) | (b_ex[16] & c[15]);
endgenerate
endmodule

0 comments on commit fbf7dab

Please sign in to comment.