|
发表于 2011-11-13 17:27:28
|
显示全部楼层
function [2:0] Cos;
input [7:0] H,I,J,K,L,M,N;
reg Ca [5:0]
begin
if(H > I)
Ca[0] = 1'b1;
else
Ca[0] = 1'b0;
if(H > J)
Ca[1] = 1'b1;
else
Ca[1] = 1'b0;
if(H > K)
Ca[2] = 1'b1;
else
Ca[2] = 1'b0;
if(H > L)
Ca[3] = 1'b1;
else
Ca[3] = 1'b0;
if(H > M)
Ca[4] = 1'b1;
else
Ca[4] = 1'b0;
if(H > N)
Ca[5] = 1'b1;
else
Ca[5] = 1'b0;
Cos = (Ca[0] + Ca[1]) + (Ca[2] + Ca[3]) + (Ca[4] + Ca[5]);
end |
|