Type and show the complete Verilog code for a One Digit BCD
     Type and show the complete Verilog code for a \"One Digit BCD Decoder\". Use the Verilog conditional operator covered in module 16. The truth table of this decoder is given below. You should download this *.doc file and type your code below the truth table.   
  
  Solution
module BCD_Decoder(
 input [3:0] B,
 output [9:0] D
 );
assign D[0]=B==0000 ? 1\'b1:1\'b0;
 assign D[1]=B==0001 ? 1\'b1:1\'b0;
 assign D[2]=B==0010 ?1\'b1:1\'b0;
 assign D[3]=B==0011 ?1\'b1:1\'b0;
 assign D[4]=B==0100 ?1\'b1:1\'b0;
 assign D[5]=B==0101 ?1\'b1:1\'b0;
 assign D[6]=B==0110 ?1\'b1:1\'b0;
 assign D[7]=B==0111 ?1\'b1:1\'b0;
 assign D[8]=B==1000 ?1\'b1:1\'b0;
 assign D[9]=B==1001 ?1\'b1:1\'b0;
endmodule

