bciaren
Newbie level 4
- Joined
- Mar 14, 2013
- Messages
- 7
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,336
In this sample file (from textbook), do these two things mean the same thing?
If not, could you explain why the former is chosen? I'm not following this if that's the case.. thanks
Code:
module eq2(
input wire [1:0] a,b,
output wire aeqb
);
// internal signal declaration
wire e0,e1;
//body
// instatiate two 1-bit comparators
eq1 eq_bit0_unit(.i0(a[0]), .i1(b[0]), .eq(e0));
eq1 eq_bit1_unit (.eq(e1), .i0(a[1]), .i1(b[1]));
// a and b are equal if individual bits are equal
assign aeqb = e0 & e1;
endmodule
Code:
module eq2(
input wire [1:0] a,b,
output wire aeqb
);
// internal signal declaration
wire e0,e1;
//body
// instatiate two 1-bit comparators
eq1 eq_bit0_unit(.i0(a[0]), .i1(b[0]), .eq(e0));
eq1 eq_bit1_unit (i0(a[1]), .i1(b[1]), .eq(e1));
// a and b are equal if individual bits are equal
assign aeqb = e0 & e1;
endmodule
If not, could you explain why the former is chosen? I'm not following this if that's the case.. thanks