`timescale 1ns / 1ps ////////////////////////////////////////////////////////////////////////////////// // Company: // Engineer: // // Create Date: 17:33:56 06/05/2007 // Design Name: // Module Name: dec8to3v // Project Name: // Target Devices: // Tool versions: // Description: // // Dependencies: // // Revision: // Revision 0.01 - File Created // Additional Comments: // ////////////////////////////////////////////////////////////////////////////////// module dec8to3v(x, y, lose); input [7:0] x; output [2:0] y; output lose; assign y[2] = x[7] | x[6] | x[5] | x[4]; assign y[1] = x[7] | x[6] | x[3] | x[2]; assign y[0] = x[7] | x[5] | x[3] | x[1]; assign lose = (x[7] & (x[6] | x[5] | x[4] | x[3] | x[2] | x[1] | x[0])) | (x[6] & (x[7] | x[5] | x[4] | x[3] | x[2] | x[1] | x[0])) | (x[5] & (x[7] | x[6] | x[4] | x[3] | x[2] | x[1] | x[0])) | (x[4] & (x[7] | x[6] | x[5] | x[3] | x[2] | x[1] | x[0])) | (x[3] & (x[7] | x[6] | x[5] | x[4] | x[2] | x[1] | x[0])) | (x[2] & (x[7] | x[6] | x[5] | x[4] | x[3] | x[1] | x[0])) | (x[1] & (x[7] | x[6] | x[5] | x[4] | x[3] | x[2] | x[0])) | (x[0] & (x[7] | x[6] | x[5] | x[4] | x[3] | x[2] | x[1])) | (~x[7]& ~x[6]& ~x[5]& ~x[4]& ~x[3]& ~x[2]& ~x[1]& ~x[0]); endmodule