comp2.v (223B)
1 module comp2(a, y); 2 input [1:0] a; 3 output reg signed [3:0] y; 4 5 always @ (a) begin 6 if (a[0] > a[1]) 7 y = 4'b0001; 8 else if (a[0] == a[1]) 9 y = 4'b0000; 10 else 11 /* 2's complement */ 12 y = 4'b1111; 13 end 14 endmodule
![]() | uniUniversity stuff |
git clone git://git.margiolis.net/uni.git | |
Log | Files | Refs | README | LICENSE |