Skip to content

Commit

Permalink
コメント追加
Browse files Browse the repository at this point in the history
  • Loading branch information
kentaroy47 committed Nov 25, 2021
1 parent 33edf96 commit 3bb670d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion 05_alu/alu.sv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

// 4則演算器のモジュールを定義
module adder(
input logic [31:0] a,
input logic [31:0] b,
Expand Down Expand Up @@ -34,6 +34,7 @@ module divider(
assign out = a / b;
endmodule

// 統合したALUモジュール
module alu(
input logic [31:0] a,
input logic [31:0] b,
Expand All @@ -55,6 +56,7 @@ module alu(
divider div(.a (a), .b (b), .out (y4));

// 一つの出力を選択
// 4:1 multiplexer
assign out = sel[1] ? (sel[0] ? y4 : y3)
: (sel[0] ? y2 : y1);
endmodule

0 comments on commit 3bb670d

Please sign in to comment.